Difference between partition key, composite key and clustering key in Cassandra?

前端 未结 8 1167
無奈伤痛
無奈伤痛 2020-11-22 12:18

I have been reading articles around the net to understand the differences between the following key types. But it just seems hard for me to grasp. Examples will

8条回答
  •  悲哀的现实
    2020-11-22 13:19

    In brief sense:

    Partition Key is nothing but identification for a row, that identification most of the times is the single column (called Primary Key) sometimes a combination of multiple columns (called Composite Partition Key).

    Cluster key is nothing but Indexing & Sorting. Cluster keys depend on few things:

    1. What columns you use in where clause except primary key columns.

    2. If you have very large records then on what concern I can divide the date for easy management. Example, I have data of 1million a county population records. So for easy management, I cluster data based on state and after pincode and so on.

提交回复
热议问题