Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit56c61e5

Browse files
committed
update README.md
1 parent15e74e3 commit56c61e5

File tree

1 file changed

+38
-12
lines changed

1 file changed

+38
-12
lines changed

‎README.md

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77

88
The`pg_pathman` module provides optimized partitioning mechanism and functions to manage partitions.
99

10-
The extension is compatible with PostgreSQL 9.5+.
10+
The extension is compatible with:
11+
* PostgreSQL 9.5, 9.6, 10;
12+
* Postgres Pro Standard 9.5, 9.6;
13+
* Postgres Pro Enterprise;
14+
15+
By the way, we have a growing Wiki[out there](https://github.com/postgrespro/pg_pathman/wiki);
1116

1217
##Overview
1318
**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:
@@ -41,6 +46,7 @@ More interesting features are yet to come. Stay tuned!
4146
##Feature highlights
4247

4348
* HASH and RANGE partitioning schemes;
49+
* Partitioning by expression and composite key;
4450
* Both automatic and manual partition management;
4551
* Support for integer, floating point, date and other types, including domains;
4652
* Effective query planning for partitioned tables (JOINs, subselects etc);
@@ -55,9 +61,11 @@ More interesting features are yet to come. Stay tuned!
5561
* Various GUC toggles and configurable settings.
5662

5763
##Roadmap
64+
65+
* Multi-level partitioning (ver 1.5);
66+
* Improved referential integrity + foreign keys on partitioned tables (ver 1.5);
5867

59-
* Implement LIST partitioning scheme;
60-
* Optimize hash join (both tables are partitioned by join key).
68+
Take a look at[this page](https://github.com/postgrespro/pg_pathman/wiki/Roadmap);
6169

6270
##Installation guide
6371
To install`pg_pathman`, execute this in the module's directory:
@@ -97,30 +105,30 @@ SET pg_pathman.enable = t;
97105
###Partition creation
98106
```plpgsql
99107
create_hash_partitions(relation REGCLASS,
100-
attributeTEXT,
108+
exprTEXT,
101109
partitions_countINTEGER,
102110
partition_dataBOOLEAN DEFAULT TRUE,
103111
partition_namesTEXT[] DEFAULTNULL,
104112
tablespacesTEXT[] DEFAULTNULL)
105113
```
106-
Performs HASH partitioning for`relation` byinteger key`attribute`. The`partitions_count` parameter specifies the number of partitions to create; it cannot be changed afterwards. If`partition_data` is`true` then all the data will be automatically copied from the parent table to partitions. Note that data migration may took a while to finish and the table will be locked until transaction commits. See`partition_table_concurrently()` for a lock-free way to migrate data. Partition creation callback is invoked for each partition if set beforehand (see`set_init_callback()`).
114+
Performs HASH partitioning for`relation` bypartitioning expression`expr`. The`partitions_count` parameter specifies the number of partitions to create; it cannot be changed afterwards. If`partition_data` is`true` then all the data will be automatically copied from the parent table to partitions. Note that data migration may took a while to finish and the table will be locked until transaction commits. See`partition_table_concurrently()` for a lock-free way to migrate data. Partition creation callback is invoked for each partition if set beforehand (see`set_init_callback()`).
107115

108116
```plpgsql
109117
create_range_partitions(relation REGCLASS,
110-
attributeTEXT,
118+
exprTEXT,
111119
start_value ANYELEMENT,
112120
p_interval ANYELEMENT,
113121
p_countINTEGER DEFAULTNULL
114122
partition_dataBOOLEAN DEFAULT TRUE)
115123

116124
create_range_partitions(relation REGCLASS,
117-
attributeTEXT,
125+
exprTEXT,
118126
start_value ANYELEMENT,
119127
p_interval INTERVAL,
120128
p_countINTEGER DEFAULTNULL,
121129
partition_dataBOOLEAN DEFAULT TRUE)
122130
```
123-
Performs RANGE partitioning for`relation` by partitioningkey`attribute`,`start_value` argument specifies initial value,`p_interval` sets the default range for auto created partitions or partitions created with`append_range_partition()` or`prepend_range_partition()` (if`NULL` then auto partition creation feature won't work),`p_count` is the number of premade partitions (if not set then`pg_pathman` tries to determine it based onattribute values). Partition creation callback is invoked for each partition if set beforehand.
131+
Performs RANGE partitioning for`relation` by partitioningexpression`expr`,`start_value` argument specifies initial value,`p_interval` sets the default range for auto created partitions or partitions created with`append_range_partition()` or`prepend_range_partition()` (if`NULL` then auto partition creation feature won't work),`p_count` is the number of premade partitions (if not set then`pg_pathman` tries to determine it based onexpression's values). Partition creation callback is invoked for each partition if set beforehand.
124132

125133

126134
###Data migration
@@ -141,7 +149,7 @@ Stops a background worker performing a concurrent partitioning task. Note: worke
141149
```plpgsql
142150
create_hash_update_trigger(parent REGCLASS)
143151
```
144-
Creates the trigger on UPDATE for HASH partitions. The UPDATE trigger isn't created by default because of the overhead. It's useful in cases when thekey attribute might change.
152+
Creates the trigger on UPDATE for HASH partitions. The UPDATE trigger isn't created by default because of the overhead. It's useful in cases when thepartitioning expression's value might change.
145153
```plpgsql
146154
create_range_update_trigger(parent REGCLASS)
147155
```
@@ -281,9 +289,10 @@ When INSERTing new data beyond the partitioning range, use SpawnPartitionsWorker
281289
```plpgsql
282290
CREATETABLEIF NOT EXISTS pathman_config (
283291
partrel REGCLASSNOT NULLPRIMARY KEY,
284-
attnameTEXTNOT NULL,
292+
exprTEXTNOT NULL,
285293
parttypeINTEGERNOT NULL,
286-
range_intervalTEXT);
294+
range_intervalTEXT,
295+
cooked_exprTEXT);
287296
```
288297
This table stores a list of partitioned tables.
289298

@@ -325,7 +334,7 @@ RETURNS TABLE (
325334
parent REGCLASS,
326335
partition REGCLASS,
327336
parttype INT4,
328-
partattrTEXT,
337+
exprTEXT,
329338
range_minTEXT,
330339
range_maxTEXT)
331340
AS'pg_pathman','show_partition_list_internal'
@@ -336,6 +345,23 @@ AS SELECT * FROM show_partition_list();
336345
```
337346
This view lists all existing partitions, as well as their parents and range boundaries (NULL for HASH partitions).
338347

348+
###`pathman_cache_stats` --- per-backend memory consumption
349+
```plpgsql
350+
-- helper SRF function
351+
CREATEOR REPLACE FUNCTION @extschema@.show_cache_stats()
352+
RETURNS TABLE (
353+
contextTEXT,
354+
size INT8,
355+
used INT8,
356+
entries INT8)
357+
AS'pg_pathman','show_cache_stats_internal'
358+
LANGUAGE C STRICT;
359+
360+
CREATEOR REPLACE VIEW @extschema@.pathman_cache_stats
361+
ASSELECT*FROM @extschema@.show_cache_stats();
362+
```
363+
Shows memory consumption of various caches.
364+
339365

340366
##Custom plan nodes
341367
`pg_pathman` provides a couple of[custom plan nodes](https://wiki.postgresql.org/wiki/CustomScanAPI) which aim to reduce execution time, namely:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp