feat: implement postgres style table partitioning - #776
Open
adsharma wants to merge 2 commits into
Open
Conversation
adsharma
force-pushed
the
partioned_tables
branch
3 times, most recently
from
August 4, 2026 02:07
9b71128 to
c5d4bae
Compare
adsharma
force-pushed
the
partioned_tables
branch
2 times, most recently
from
August 18, 2026 19:12
815f03c to
f771009
Compare
… storage
Add declarative RANGE/HASH partitioning to CREATE NODE TABLE:
CREATE NODE TABLE t (...) PARTITION BY (HASH|RANGE) (col) PARTITIONS n;
Each partition is backed by its own node-table subgraph (<t>_p<i>); the
logical parent owns the schema but no physical storage. Reads on the parent
(MATCH) transparently union over every partition via the existing multi-table
node scan. Writes to the parent (COPY/CREATE/MERGE) raise an actionable error
until routing lands; the partition subgraphs are directly writable.
- Parser: PARTITION BY clause + new keywords (regenerated grammar)
- Catalog: parent + partition subgraph entries, persistence (storage v44),
DROP cascade
- Storage: parents skipped in create/checkpoint/serialize/rollback; partitions
managed as ordinary node tables
- Query: expand parent label to partition subgraphs for scanning
- Validation: partition column must be an eligible existing column
- Tests: ddl/partitioned.test (5 cases) pass
- Docs: docs/partitioning.md with architecture and roadmap (write routing,
pruning, ADBC remote partitions)
adsharma
force-pushed
the
partioned_tables
branch
from
August 18, 2026 20:45
f771009 to
a408ead
Compare
…r node table CREATE, COPY and MERGE into a partitioned parent now evaluate each row's partition key and route it into the matching partition subgraph (hash(value) % numPartitions, used for HASH and, until declarative range bounds land, RANGE partitions). Single-row inserts route at runtime in NodeInsertExecutor; batched COPY routes consecutive same-partition runs in NodeBatchInsert. Each child is an ordinary NodeTable, so primary-key uniqueness and WAL/MVCC apply per partition. Every node table is now backed by a subgraph (a GraphCatalogEntry in the catalog's `graphs` set), so SHOW_GRAPHS lists node tables and their partition subgraphs. Subgraphs are created and dropped with their table (creation skips WAL logging since the table's create record implies them), follow ALTER TABLE ... RENAME, and DROP GRAPH refuses a node-table subgraph. Adds NodePartitionWriteInfo routing metadata carried from the binder through NodeBatchInsertInfo, updates docs/partitioning.md, and extends the partitioned e2e test with write-routing and show_graphs coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Idea: store partitioned tables in subgraphs which could live on object storage and/or accessed via a columnar network protocol.
Each partition lives in a separate subgraph which can be dropped independently.