hi,All
I have read this question:Is deleting multiple partitions with IN() operator better than deleting partitions one by one?, and I have an idea of deleting multiple partitions by grouping.
For example, there are 10 records :{pk1, pk2,....,pk10};
for replication factor of 3 in a single-DC cluster,after grouping(using token-aware policy), I know :
- pk1, pk2 and pk3 are located in node1, node2, node3;
- pk4, pk5 and pk6 are located in node3, node4, node5;
- pk7, pk8, pk9 and pk10 are located in node4, node5, node6;
Now I can delete these records:
DELETE FROM table_name WHERE pk IN (pk1, pk2, pk3); DELETE FROM table_name WHERE pk IN (pk4, pk5, pk6); DELETE FROM table_name WHERE pk IN (pk7, pk8, pk9, pk10);
In this way, we can reduce the number of replicas which the coordinator need to coordinate.
I wonder if this is a better way to delete partitions compared to deleting partitions one by one.
Thanks.