Cassandra read performance slow on 2000 rows java datastax driver

38 views
Skip to first unread message

Sumeet Kumar

unread,
Jan 12, 2022, 11:18:37 PM1/12/22
to DataStax Java Driver for Apache Cassandra User Mailing List

Question also asked at :

 https://stackoverflow.com/questions/70691127/cassandra-read-performance-slow-on-2000-rows-java-datastax-driver

I am using apache Cassandra with below configuration and trying to fetch 2000 rows by using DataStacks java driver . The number of columns in table is 25 and has 1 partition key and 2 clustering key .

I am running 5 node cluster in azure managed Cassandra instance and key space has replication factor of 3.

SQL - Select * from T1 where c1 = 'x'; // This query fetches 2000 rows and takes around 110 ms via datastax java driver . select query for single row works faster around 6 ms , but when we select has to fetch more rows from single partition time increases . How to decrease read time and bring down read query time around 10-15 ms with 2000 rows select. In my scenario for one partition key c1 , it can have 2000 distinct c2 value . So when I select c1 by query , I want to get all 2000 rows associated with c1 .

CREATE TABLE T1 ( c1 text, c2 text, c3 int, c4 text, c5 text, c6 int, c7 int, c8 int, c9 int, c10 text, c11 int, c12 int, c13 int, c14 int, c15 int, c16 int, c17 int, c18 int, c19 text, c20 int, c21 int, c22 timestamp, c23 int, c24 int, c25 int, PRIMARY KEY (c1, c2, c3) ) WITH CLUSTERING ORDER BY (c2 ASC, c3 ASC) AND bloom_filter_fp_chance = 0.01 AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'} AND comment = '' AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'} AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'} AND crc_check_chance = 1.0 AND dclocal_read_repair_chance = 0.1 AND default_time_to_live = 0 AND gc_grace_seconds = 864000 AND max_index_interval = 2048 AND memtable_flush_period_in_ms = 0 AND min_index_interval = 128 AND read_repair_chance = 0.0 AND speculative_retry = '99PERCENTILE';

Example : I am fetching C1 = X all value

C1| C2| C3| C3 .....
 X | A | M | 
 X | B | P |
 X | C | U | 
 X | D | I |
Reply all
Reply to author
Forward
0 new messages