A composite primary key combines multiple columns to identify a row. In ScyllaDB, its first component becomes the partition key, while additional components help organize rows within that partition. section 3.3.2
Choose the columns by tracing the queries the table must support:
- Put the query’s grouping value first so related rows share a partition instead of forcing a cross-partition query. section 3.3.2
Restaurant reviews
A review table can define PRIMARY KEY (restaurant, ordered_at, food). This groups reviews by restaurant and orders them by timestamp and food within each restaurant partition.







