Re: IN OPERATOR VS BATCH QUERY

2020-02-20 Thread Attila Wind
Hi Sergio, AFAIK you use batches when you want to get "all or nothing" approach from Cassandra. So turning multiple statements into one atomic operation. One very typical use case for this is when you have denormalized data in multiple tables (optimized for different queries) but you need to

Re: IN OPERATOR VS BATCH QUERY

2020-02-20 Thread Sergio
The current approach is delete from key_value where id = whatever and it is performed asynchronously from the client. I was thinking to reduce at least the network round-trips between client and coordinator with that Batch approach. :) In any case, I would test it it will improve or not. So when

Re: IN OPERATOR VS BATCH QUERY

2020-02-20 Thread Erick Ramirez
Batches aren't really meant for optimisation in the same way as RDBMS. If anything, it will just put pressure on the coordinator having to fire off multiple requests to lots of replicas. The IN operator falls into the same category and I personally wouldn't use it with more than 2 or 3 partitions

IN OPERATOR VS BATCH QUERY

2020-02-20 Thread Sergio Bilello
Hi guys! Let's say we have a KEY-VALUE schema The goal is to delete the KEYS in batches without burning the cluster and be efficient as soon as possible I would like to know if it is better to run the query with DELETE FROM KEY_VALUE_COLUMN_FAMILY WHERE KEY IN ('A','B','C'); At most 10 KEYS