From 1fe39df2024245b66c2822a024a10e2fbdbfcd75 Mon Sep 17 00:00:00 2001 From: Philipp Fent Date: Fri, 2 Oct 2026 12:12:01 +0200 Subject: [PATCH] explicitly document our table partitioning --- content/compatibility/sql_features.md | 156 +++++++++++++------------- content/references/datatypes/inet.md | 2 +- content/references/objects/tables.md | 34 ++++-- 3 files changed, 103 insertions(+), 89 deletions(-) diff --git a/content/compatibility/sql_features.md b/content/compatibility/sql_features.md index 7fc4eeb..d3d5dd9 100644 --- a/content/compatibility/sql_features.md +++ b/content/compatibility/sql_features.md @@ -76,16 +76,16 @@ the [system table compatibility](../system_table) page. ### Privileges -| **Feature** | **Support State** | **Details** | -|-----------------------|-------------------|------------------------------------------------------------| -| CREATE ROLE | Yes | [Documentation](/docs/references/objects/roles) | -| OWNER TO | Yes | | -| ALTER ROLE | Yes | [Documentation](/docs/references/objects/roles) | -| GRANT | Yes | Requires an enterprise license | -| REVOKE | Yes | Requires an enterprise license | -| SET ROLE | Yes | Requires an enterprise license | -| INHERIT | Yes | [Documentation](/docs/references/objects/roles/) | -| Row Security Policies | Yes | Requires an enterprise license | +| **Feature** | **Support State** | **Details** | +|-----------------------|-------------------|--------------------------------------------------| +| CREATE ROLE | Yes | [Documentation](/docs/references/objects/roles) | +| OWNER TO | Yes | | +| ALTER ROLE | Yes | [Documentation](/docs/references/objects/roles) | +| GRANT | Yes | Requires an enterprise license | +| REVOKE | Yes | Requires an enterprise license | +| SET ROLE | Yes | Requires an enterprise license | +| INHERIT | Yes | [Documentation](/docs/references/objects/roles/) | +| Row Security Policies | Yes | Requires an enterprise license | ### Indexes @@ -102,23 +102,23 @@ the [system table compatibility](../system_table) page. ### Misc -| **Feature** | **Support State** | **Details** | -|------------------------|-------------------|-----------------------------------------------------------------------------------------| -| CREATE SCHEMA | Yes | [Documentation](/docs/references/objects/schemas/) | -| DROP SCHEMA | Yes | Only if the schema is empty | -| search_path | Yes | [Documentation](/docs/references/objects/schemas/#using-schemas) | -| Table Inheritance | No | | -| Table Partitioning | Partial | Only hash partitioning. Only at CREATE TABLE time | -| Foreign Data Wrappers | No | | -| Views | Yes | [Documentation](/docs/references/objects/views/) | -| Materialized Views | Yes | [Documentation](/docs/references/objects/materialized_views/) | -| Databases | Yes | [Documentation](/docs/references/objects/databases/) | -| Functions & Procedures | Yes | [Documentation](/docs/references/objects/functions/)
Also in cedar_script language | -| Custom Types | No | | -| Triggers | No | | -| Prepared Statements | Yes | | -| Advisory Locks | Yes | [Documentation](/docs/references/functions/system/#advisory-locks) | -| ALTER SYSTEM | Yes | [Documentation](/docs/references/sessions/altersystem/) | +| **Feature** | **Support State** | **Details** | +|------------------------|-------------------|------------------------------------------------------------------------------------------------------------------------------| +| CREATE SCHEMA | Yes | [Documentation](/docs/references/objects/schemas/) | +| DROP SCHEMA | Yes | Only if the schema is empty | +| search_path | Yes | [Documentation](/docs/references/objects/schemas/#using-schemas) | +| Table Inheritance | No | | +| Table Partitioning | Partial | Only hash partitioning, partitions are created automatically. [Documentation](/docs/references/objects/tables/#partitioning) | +| Foreign Data Wrappers | No | | +| Views | Yes | [Documentation](/docs/references/objects/views/) | +| Materialized Views | Yes | [Documentation](/docs/references/objects/materialized_views/) | +| Databases | Yes | [Documentation](/docs/references/objects/databases/) | +| Functions & Procedures | Yes | [Documentation](/docs/references/objects/functions/)
Also in cedar_script language | +| Custom Types | No | | +| Triggers | No | | +| Prepared Statements | Yes | | +| Advisory Locks | Yes | [Documentation](/docs/references/functions/system/#advisory-locks) | +| ALTER SYSTEM | Yes | [Documentation](/docs/references/sessions/altersystem/) | ## Data Manipulation @@ -321,52 +321,52 @@ the [system table compatibility](../system_table) page. #### Text -| **Feature** | **Support State** | **Details** | -|-----------------------|-------------------|------------------------------------------------------:| -| \|\| | Yes | | -| btrim | Yes | | -| bit_length | Yes | | -| char_length | Yes | | -| lower | Yes | | -| lpad | Yes | | -| ltrim | Yes | | -| normalize | No | | -| octet_length | Yes | | -| overlay | Yes | | -| position | Yes | | -| rpad | Yes | | -| rtrim | Yes | | -| substring | Yes | Currently not supporting regular expression arguments | -| trim | Yes | | -| upper | Yes | | -| ^@ | No | | -| ascii | Yes | | -| chr | Yes | | -| concat | Yes | | -| concat_ws | Yes | | -| format | Yes | | -| initcap | Yes | | -| left | Yes | | -| length | Yes | | -| md5 | Yes | | -| parse_ident | Yes | | -| quote_ident | Yes | | -| quote_literal | Yes | | -| quote_nullable | Yes | | -| repeat | Yes | | -| replace | Yes | | -| reverse | Yes | | -| right | Yes | | -| split_part | Yes | | -| starts_with | Yes | | -| string_to_array | Yes | | -| string_to_table | Yes | | -| strpos | Yes | | -| substr | Yes | | -| to_ascii | No | | -| to_hex | Yes | | -| translate | Yes | | -| unistr | No | | +| **Feature** | **Support State** | **Details** | +|-----------------|-------------------|------------------------------------------------------:| +| \|\| | Yes | | +| btrim | Yes | | +| bit_length | Yes | | +| char_length | Yes | | +| lower | Yes | | +| lpad | Yes | | +| ltrim | Yes | | +| normalize | No | | +| octet_length | Yes | | +| overlay | Yes | | +| position | Yes | | +| rpad | Yes | | +| rtrim | Yes | | +| substring | Yes | Currently not supporting regular expression arguments | +| trim | Yes | | +| upper | Yes | | +| ^@ | No | | +| ascii | Yes | | +| chr | Yes | | +| concat | Yes | | +| concat_ws | Yes | | +| format | Yes | | +| initcap | Yes | | +| left | Yes | | +| length | Yes | | +| md5 | Yes | | +| parse_ident | Yes | | +| quote_ident | Yes | | +| quote_literal | Yes | | +| quote_nullable | Yes | | +| repeat | Yes | | +| replace | Yes | | +| reverse | Yes | | +| right | Yes | | +| split_part | Yes | | +| starts_with | Yes | | +| string_to_array | Yes | | +| string_to_table | Yes | | +| strpos | Yes | | +| substr | Yes | | +| to_ascii | No | | +| to_hex | Yes | | +| translate | Yes | | +| unistr | No | | #### Bytea @@ -822,11 +822,11 @@ the [system table compatibility](../system_table) page. ##### Ordered-Set -| **Feature** | **Support State** | **Details** | -|-----------------|-------------------|--------------------------------------------------------------------------------------------------------------:| -| mode | Yes | [Aggregate Function Documentation](/docs/references/functions/aggregation//#ordered-set-aggregate-functions) | -| percentile_cont | Yes | [Aggregate Function Documentation](/docs/references/functions/aggregation//#ordered-set-aggregate-functions) | -| percentile_disc | Yes | [Aggregate Function Documentation](/docs/references/functions/aggregation//#ordered-set-aggregate-functions) | +| **Feature** | **Support State** | **Details** | +|-----------------|-------------------|-------------------------------------------------------------------------------------------------------------:| +| mode | Yes | [Aggregate Function Documentation](/docs/references/functions/aggregation//#ordered-set-aggregate-functions) | +| percentile_cont | Yes | [Aggregate Function Documentation](/docs/references/functions/aggregation//#ordered-set-aggregate-functions) | +| percentile_disc | Yes | [Aggregate Function Documentation](/docs/references/functions/aggregation//#ordered-set-aggregate-functions) | #### Window diff --git a/content/references/datatypes/inet.md b/content/references/datatypes/inet.md index 6a4c291..310e4b0 100644 --- a/content/references/datatypes/inet.md +++ b/content/references/datatypes/inet.md @@ -9,7 +9,7 @@ For example, `192.168.1.5/24` describes the host `192.168.1.5` in the subnet `19 {{< callout type="info" >}} CedarDB currently only supports basic `inet` functionality. -PostgreSQL's network operators, functions (for example, `<<`, `host()`, or `masklen()`), the `cidr` type, and +PostgreSQL's network operators, functions (for example, `<<`, `host()`, or `masklen()`), the `cidr` type, and non-standard prefix-only IPs (`10/24`) are not yet supported. {{< /callout >}} diff --git a/content/references/objects/tables.md b/content/references/objects/tables.md index 8a2de27..fc82289 100644 --- a/content/references/objects/tables.md +++ b/content/references/objects/tables.md @@ -98,16 +98,6 @@ This copies the column names and types, but not constraints or defaults: CREATE TABLE species_archive (LIKE species); ``` -Create a table partitioned by a hash of a column: - -```sql -CREATE TABLE observations ( - id int, - species int, - site text -) PARTITION BY HASH (id); -``` - Create a table that stores all compressed data on a remote server previously created with name `remote_storage` (see [CREATE SERVER](/docs/references/advanced/createserver) for more information): @@ -124,6 +114,30 @@ CREATE TABLE species (...) WITH (compression = zstd); CREATE TABLE species_uncompressed (...) WITH (compression = none); ``` +### Partitioning + +You can create a table partitioned by a hash of one or more columns: + +```sql +CREATE TABLE observations ( + id int, + species int, + site text +) PARTITION BY HASH (id); +``` + +Unlike PostgreSQL, CedarDB partitions hash-partitioned tables automatically. +So, you don't need to create individual partitions with `CREATE TABLE ... PARTITION OF ... FOR VALUES WITH (MODULUS ..., REMAINDER ...)`. +Instead, CedarDB creates up to 1024 partitions per table, with lazily created partitions on the first insert into them. +The table behaves like a single table for all queries and modifications. + +Partitioning has the following restrictions: + +* Only `HASH` partitioning is supported. `RANGE` and `LIST` partitioning are not yet implemented. +* The partition key must consist of plain column names. Expressions, `COLLATE`, and operator classes are not supported. +* Explicit partitions (`PARTITION OF`) and `ALTER TABLE ... ATTACH / DETACH PARTITION` are not supported. +* You can't drop a column that is part of the partition key. + ### Identity Columns Identity columns automatically generate unique integer values: