In your schema case, for each client_id you will get a single 'when' row. Just one. Even when there are multiple rows (clustering keys)
On Thu, May 7, 2020 at 12:14 AM Check Peck <comptechge...@gmail.com> wrote: > > I have a scylla table as shown below: > > > cqlsh:sampleks> describe table test; > > > CREATE TABLE test ( > > client_id int, > > when timestamp, > > process_ids list<int>, > > md text, > > PRIMARY KEY (client_id, when) ) WITH CLUSTERING ORDER BY (when DESC) > > AND bloom_filter_fp_chance = 0.01 > > AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'} > > AND comment = '' > > AND compaction = {'class': 'TimeWindowCompactionStrategy', > 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS'} > > AND compression = {'sstable_compression': > '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 = 172800 > > AND max_index_interval = 1024 > > AND memtable_flush_period_in_ms = 0 > > AND min_index_interval = 128 > > AND read_repair_chance = 0.0 > > AND speculative_retry = '99.0PERCENTILE'; > > > And I see this is how we are querying it. It's been a long time I worked on > cassandra so this “PER PARTITION LIMIT” is new thing to me (looks like > recently added). Can someone explain what does this do with some example in a > layman language? I couldn't find any good doc on that which explains easily. > > > SELECT * FROM test WHERE client_id IN ? PER PARTITION LIMIT 1; --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org For additional commands, e-mail: user-h...@cassandra.apache.org