Learn more about computerscience with this collection
Understanding machine learning models
Improving data analysis and decision-making
How Google uses logic in machine learning
Cassandra stores columns on disk in the clustering order of your table. Therefore, to get the performance, your queries with ORDER BY should match the table's clustering order.
For example, if you often query the newest data in the table, then you should set your clustering order to be (insertion_time DESC)
:
CREATE TABLE timeseries ( event_type text, insertion_time timestamp, event blob, PRIMARY KEY (event_type, insertion_time) ) WITH CLUSTERING ORDER BY (insertion_time DESC);
1
6 reads
Cassandra allows you to sort your query results in reverse clustering order, but it comes at a cost. Cassandra has to read all partition rows/columns and sort them in-memory, making your queries slower and increasing load on the cluster.
The slowdown is proportional to the number of rows and columns you have, and it can become a serious problem if your partitions grow to thousands of rows and dozens of columns.
See more info on StackOverflow.
1
7 reads
Alt account of @ocp. I use it to stash ideas about software engineering
More like this
8 ideas
8 Things to Know to Master Value Sorting in Pandas
towardsdatascience.com
7 ideas
Database indexes
en.wikipedia.org
2 ideas
PostgreSQL - How to Configure Slow Query Log
postgresql.org
Read & Learn
20x Faster
without
deepstash
with
deepstash
with
deepstash
Access to 200,000+ ideas
β
Access to the mobile app
β
Unlimited idea saving & library
β
β
Unlimited history
β
β
Unlimited listening to ideas
β
β
Downloading & offline access
β
β
Personalized recommendations
β
β
Supercharge your mind with one idea per day
Enter your email and spend 1 minute every day to learn something new.
I agree to receive email updates