0
votes

I have a table with 4 million unique partition keys select count(*) from "KS".table;

count

4355748 (1 rows)

I have read the cardinality of Partition Key should not too high and also not too low, which means don’t make partition key too unique. Is it correct? The table does not have any clustering key. Will changing data partitioning help with the load?

2

2 Answers

0
votes

It really depends on the use case... If you don't have natural clustering by partition, then maybe little sense to introduce it. Also, what are the read patterns? Do you need to read multiple rows in one go, or not?

Number of partitions has an effect on the size of the bloom filter, key cache, etc., so as you increase the number of partitions, bloom filter is increased, and key cache has less hits (until you increase its size).

0
votes

As far as I know, Cassandra is using consistent hashing for mapping partition key to physical partition, so cardinality should not matter.