You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 85b3d4f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,9 +248,9 @@ service = PartitionLifecycleService(repo, metadata, locks, hooks=[ColdStorageHoo
248
248
249
249
-[Getting started](https://bedrock-python.github.io/pg-partsmith/getting-started/installation/) — install, your first partitioned table, running it in production, a multi-tenant event store
250
250
-[Concepts](https://bedrock-python.github.io/pg-partsmith/concepts/overview/) — how it works: schemes, boundaries, lifecycle policies, the plan, ownership, executing DDL, leaf backends
251
-
-[How-to guides](https://bedrock-python.github.io/pg-partsmith/guide/configuration/) — scheduling, monitoring, backfilling, partitioning an existing table, migrating from pg_partman, changing a scheme, archiving, foreign keys, cold tiering, troubleshooting, recipes
251
+
-[How-to guides](https://bedrock-python.github.io/pg-partsmith/guide/configuration/) — scheduling, monitoring, querying, backfilling, partitioning an existing table, migrating from pg_partman, changing a scheme, archiving, foreign keys, cold tiering, troubleshooting, recipes
252
252
-[Reference](https://bedrock-python.github.io/pg-partsmith/reference/) — the API, every configuration field, every finding and error
253
-
-[Design](https://bedrock-python.github.io/pg-partsmith/design/rfc-0001-partition-schemes/) — RFC 0001, the OSS research, PostgreSQL semantics verified on real servers
253
+
-[Design](https://bedrock-python.github.io/pg-partsmith/design/rfc-0001-partition-schemes/) — RFC 0001, the OSS research, PostgreSQL semantics verified on real servers, and the final report on what 1.0 changed
254
254
-[For AI agents](https://bedrock-python.github.io/pg-partsmith/agents/) — the whole API
255
255
surface, the rules that break code when broken and a map of the rest, on one page to hand
Copy file name to clipboardExpand all lines: docs/concepts/plan.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Operations are typed, ordered as they must execute, and nested where order matte
30
30
|`CreatePartition`| create a partition, build its subtree, attach it |`parent_name`, `bounds`, `partition_by` (for a branch), `children`, `counts_as`|
31
31
|`AttachPartition`| re-attach a detached orphan whose window is wanted again |`parent_name`, `bounds`|
32
32
|`DetachPartition`| detach an expired partition, subtree included |`parent_name`, `mode`, `oid`|
33
-
|`DropPartition`| drop a detached, marker-tagged orphan |`oid`, `detached_at`, `follows_detach`|
33
+
|`DropPartition`| drop a detached, marker-tagged orphan |`oid`, `detached_at`, `follows_detach`, `bounds`|
34
34
35
35
Creations come first (each with its subtree inside it), then re-attachments, then
36
36
detaches, then drops. Every operation records:
@@ -125,5 +125,27 @@ What the planner does with each state it can meet, in one table:
125
125
| a partition pending an interrupted `DETACH CONCURRENTLY`| complete the detach with `FINALIZE` (`detach_finalize`); report it (`detach_pending`, INFO) |
126
126
| a wanted name held by a relation with other bounds, or over 63 bytes | report (`name_unusable`) |
127
127
128
-
A converged tree produces no operation at all, so a tick against it costs one catalog
129
-
read and no DDL.
128
+
A converged tree produces no operation at all, so a tick against it costs the catalog
129
+
reads below and no DDL.
130
+
131
+
## What a plan costs
132
+
133
+
Planning itself is a pure function over the configuration and the tree: it never queries
134
+
the database, and it is linear in the number of nodes. Reading the tree is a fixed number
135
+
of statements, whatever the table's size:
136
+
137
+
| Step | Statements | Grows with the tree? |
138
+
|---|---|---|
139
+
| the whole tree — every level, bounds, `relkind`, oids | 1 | no |
140
+
| detached orphans and their markers | 1 | no |
141
+
| sizes and row estimates | 1, and only when a policy asks for them | no |
142
+
143
+
There is no query per partition anywhere in the path. Facts are measured for lifecycle
144
+
units only — the partitions retention decides over — so a nested tree does not multiply
145
+
them: 2 000 monthly branches with eight buckets each are 2 000 targets, not 16 000.
146
+
147
+
For scale, a table of 18 001 nodes (2 000 monthly branches × 8 hash buckets, fifty years
148
+
of history) plans in roughly 0.15 s on a developer machine, and a converged one plans to a
149
+
no-op. Both the statement counts and a loose time budget are pinned by
150
+
`tests/unit/test_scale.py`, so a planner that turned quadratic would fail the suite rather
0 commit comments