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
Copy file name to clipboardExpand all lines: README.md
+23-5Lines changed: 23 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,12 @@
5
5
6
6
The `pg_pathman` module provides optimized partitioning mechanism and functions to manage partitions.
7
7
8
-
The extension is compatible with PostgreSQL 9.5 (9.6 support is coming soon).
8
+
The extension is compatible with PostgreSQL 9.5+.
9
9
10
10
## Overview
11
11
**Partitioning** means splitting one large table into smaller pieces. Each row in such table is moved to a single partition according to the partitioning key. PostgreSQL supports partitioning via table inheritance: each partition must be created as a child table with CHECK CONSTRAINT. For example:
12
12
13
-
```
13
+
```plpgsql
14
14
CREATETABLEtest (id SERIALPRIMARY KEY, title TEXT);
15
15
CREATETABLEtest_1 (CHECK ( id >=100AND id <200 )) INHERITS (test);
16
16
CREATETABLEtest_2 (CHECK ( id >=200AND id <300 )) INHERITS (test);
@@ -25,7 +25,7 @@ VARIABLE OP CONST
25
25
```
26
26
where `VARIABLE` is a partitioning key, `OP` is a comparison operator (supported operators are =, <, <=, >, >=), `CONST` is a scalar value. For example:
27
27
28
-
```
28
+
```plpgsql
29
29
WHERE id =150
30
30
```
31
31
@@ -36,6 +36,22 @@ Based on the partitioning type and condition's operator, `pg_pathman` searches f
36
36
37
37
More interesting features are yet to come. Stay tuned!
38
38
39
+
## Feature highlights
40
+
41
+
* HASH and RANGE partitioning schemes;
42
+
* Both automatic and manual partition management;
43
+
* Support for integer, floating point, date and other types, including domains;
44
+
* Effective query planning for partitioned tables (JOINs, subselects etc);
45
+
*`RuntimeAppend` & `RuntimeMergeAppend` custom plan nodes to pick partitions at runtime;
46
+
*`PartitionFilter`: an efficient drop-in replacement for INSERT triggers;
47
+
* Automatic partition creation for new INSERTed data (only for RANGE partitioning);
48
+
* Improved `COPY FROM\TO` statement that is able to insert rows directly into partitions;
49
+
* UPDATE triggers generation out of the box (will be replaced with custom nodes too);
50
+
* User-defined callbacks for partition creation event handling;
51
+
* Non-blocking concurrent table partitioning;
52
+
* FDW support (foreign partitions);
53
+
* Various GUC toggles and configurable settings.
54
+
39
55
## Roadmap
40
56
41
57
* Implement LIST partitioning scheme;
@@ -462,6 +478,8 @@ NOTICE: 100 rows copied from part_test_2
462
478
(3 rows)
463
479
```
464
480
481
+
- You can turn foreign tables into partitions using the `attach_range_partition()` function. Rows that were meant to be inserted into parent will be redirected to foreign partitions (as usual, PartitionFilter will be involved), though by default it is prohibited to insert rows into partitions provided not by `postgres_fdw`. Only superuser is allowed to set `pg_pathman.insert_into_fdw` GUC variable.
482
+
465
483
### HASH partitioning
466
484
Consider an example of HASH partitioning. First create a table with some integer column:
467
485
```plpgsql
@@ -587,7 +605,7 @@ EXPLAIN SELECT * FROM journal WHERE dt >= '2015-06-01' AND dt < '2015-06-03';
587
605
### Disabling `pg_pathman`
588
606
There are several user-accessible [GUC](https://www.postgresql.org/docs/9.5/static/config-setting.html) variables designed to toggle the whole module or specific custom nodes on and off:
0 commit comments