Skip to content

feat: implement postgres style table partitioning - #776

Open
adsharma wants to merge 1 commit into
mainfrom
partioned_tables
Open

feat: implement postgres style table partitioning#776
adsharma wants to merge 1 commit into
mainfrom
partioned_tables

Conversation

@adsharma

@adsharma adsharma commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Writes are not routed yet.

Idea: store partitioned tables in subgraphs which could live on object storage and/or accessed via a columnar network protocol.

-- Hash partitioning on an eligible column.
CREATE NODE TABLE Orders (
    id     INT64  PRIMARY KEY,
    region STRING,
    amount INT64
) PARTITION BY HASH (region) PARTITIONS 4;

-- Range partitioning (bounds are derived; see design below).
CREATE NODE TABLE Events (
    id    INT64 PRIMARY KEY,
    ts    TIMESTAMP,
    value DOUBLE
) PARTITION BY RANGE (ts) PARTITIONS 5;

@adsharma
adsharma force-pushed the partioned_tables branch 2 times, most recently from 8c3c463 to 9b71128 Compare August 4, 2026 02:05
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant