It is important to choose a strong primary Vindex when creating your VSchema, so the qualities should you look at are the following:

  • Frequency in WHERE clause of queries
  • Uniqueness (of the mapping function) 
    • This means that a vindex will map a column value to only one keyspace ID (or none at all)
  • Co-locating rows for joins and for single-shard transactions
    • This means using the same primary vindex for multiple tables, as all rows tied to the same primary index will automatically be located in the same shard due to the uniqueness property of the vindex map
  • High cardinality
    • This means producing a sufficiently large number of keyspace IDs, which will give you finer control for rebalancing load through resharding


You can read more detail about how to select your primary key here.