---
source: https://iinventedlight.com/library/notes/cassandra-partition-keys.md
title: "A Cassandra primary key starts with the partition key that places the row"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Apache Cassandra); Apache-2.0 (Apache Cassandra); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Apache Cassandra, CQL DDL; Apache Cassandra, cassandra.yaml token and partitioner comments. Apache-2.0; Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-20
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-20
as_of: 2026-11-20
confidence: medium
untested: "Not reproduced (2026-11-20). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: Cassandra partition keys"
tags: [cassandra, cql, data-modeling, databases]
client: Librarian
sources:
  - id: S1
    title: "CQL DDL"
    publisher: Apache Cassandra
    url: https://cassandra.apache.org/doc/latest/cassandra/developing/cql/ddl.html
    accessed: 2026-11-20
    license: "Apache-2.0"
  - id: S2
    title: "cassandra.yaml token and partitioner comments"
    publisher: Apache Cassandra
    url: https://raw.githubusercontent.com/apache/cassandra/trunk/conf/cassandra.yaml
    accessed: 2026-11-20
    license: "Apache-2.0"
---
# A Cassandra primary key starts with the partition key that places the row
**Answer:** A CQL table has a primary key. Rows that have the same partition key belong to the same partition. Clustering columns distinguish rows in that partition.

## Primary key and static columns

- `PRIMARY KEY (pk, t)` pk is the partition key and t is clustering
- `static` a column shared by every row in the same partition
- `CREATE TABLE t` example table in the documentation
- `s` the static column whose value is the same for both rows in the partition

A static column is shared by every row in the same partition (the rows that share a partition key). A later insertion overrides the value for that static column. A table without clustering columns cannot have static columns, as listed in the restrictions.

## Tokens

The configuration sets how many tokens this node is randomly assigned on the ring. More tokens, relative to other nodes, mean a larger share of the data for this node. Nodes with equal hardware capability should usually have the same token count. Some token allocation works only with the Murmur3Partitioner. Replica factor comes from the replication strategy of the specified keyspace.

## See also

- [postgres-partitioning](https://iinventedlight.com/library/notes/postgres-partitioning/)
- [postgres-indexes-basics](https://iinventedlight.com/library/notes/postgres-indexes-basics/)
- [cassandra-consistency-levels](https://iinventedlight.com/library/notes/cassandra-consistency-levels/)

## Claims

- id: C1
  claim: Rows that share a partition key belong to the same partition; clustering columns distinguish rows inside it.
  source: S1
  evidence: "all the rows belonging to the same partition (having the same partition key )"

- id: C2
  claim: In CREATE TABLE, PRIMARY KEY (pk, t) uses pk as the partition key and t as a clustering column.
  source: S1
  evidence: "PRIMARY KEY (pk, t)"

- id: C3
  claim: The node's token count on the ring controls how much data it stores relative to other nodes.
  source: S2
  evidence: "the number of tokens randomly assigned to this node on the ring"

## Sources

- [S1] CQL DDL. Apache Cassandra. https://cassandra.apache.org/doc/latest/cassandra/developing/cql/ddl.html . License: Apache-2.0. Accessed 2026-11-20.

- [S2] cassandra.yaml token and partitioner comments. Apache Cassandra. https://raw.githubusercontent.com/apache/cassandra/trunk/conf/cassandra.yaml . License: Apache-2.0. Accessed 2026-11-20.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Apache Cassandra, CQL DDL; Apache Cassandra, cassandra.yaml token and partitioner comments. Apache-2.0; Apache-2.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
