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: contrib/pathman/README.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
#pathman
1
+
#pg_pathman
2
2
3
-
The`pathman` module provides optimized partitioning mechanism and functions to manage partitions.
3
+
The`pg_pathman` module provides optimized partitioning mechanism and functions to manage partitions.
4
4
5
-
##pathman Concepts
5
+
##pg_pathman Concepts
6
6
7
7
Partitioning refers to splitting one large table into smaller pieces. Each row in such table assigns to a single partition based on partitioning key. Common partitioning strategies are:
8
8
@@ -20,7 +20,7 @@ CREATE TABLE test_2 (CHECK ( id >= 200 AND id < 300 )) INHERITS (test);
20
20
21
21
Despite the flexibility of this approach it has weakness. If query uses filtering the optimizer forced to perform an exhaustive search and check constraints for each partition to determine partitions from which it should select data. If the number of partitions is large the overhead may be significant.
22
22
23
-
The`pathman` module provides functions to manage partitions and partitioning mechanism optimized based on knowledge of the partitions structure. It stores partitioning configuration in the`pathman_config` table, each row of which contains single entry for partitioned table (relation name, partitioning key and type). During initialization the`pathman` module caches information about child partitions in shared memory in form convenient to perform rapid search. When user executes SELECT querypathman analyzes conditions tree looking for conditions like:
23
+
The`pg_pathman` module provides functions to manage partitions and partitioning mechanism optimized based on knowledge of the partitions structure. It stores partitioning configuration in the`pathman_config` table, each row of which contains single entry for partitioned table (relation name, partitioning key and type). During initialization the`pg_pathman` module caches information about child partitions in shared memory in form convenient to perform rapid search. When user executes SELECT querypg_pathman analyzes conditions tree looking for conditions like:
24
24
25
25
```
26
26
VARIABLE OP CONST
@@ -31,22 +31,22 @@ where `VARIABLE` is partitioning key, `OP` is comparison operator (supported ope
31
31
WHERE id = 150
32
32
```
33
33
34
-
Based on partitioning type and operator the`pathman` searches corresponding partitions and builds the plan.
34
+
Based on partitioning type and operator the`pg_pathman` searches corresponding partitions and builds the plan.
35
35
36
36
##Installation
37
37
38
-
To installpathman run in psql:
38
+
To installpg_pathman run in psql:
39
39
```
40
40
CREATE SCHEMA pathman;
41
-
CREATE EXTENSIONpathman SCHEMA pathman;
41
+
CREATE EXTENSIONpg_pathman SCHEMA pathman;
42
42
```
43
43
Then modify shared_preload_libraries parameter in postgres.conf as following:
44
44
```
45
-
shared_preload_libraries = 'pathman'
45
+
shared_preload_libraries = 'pg_pathman'
46
46
```
47
47
It will require to restart the PostgreSQL instance.
48
48
49
-
##Pathman Functions
49
+
##pg_pathman Functions
50
50
51
51
###Partitions Creation
52
52
```
@@ -110,7 +110,7 @@ Prepends new partition with the range equal to the range of the first partition.
110
110
```
111
111
disable_partitioning(relation TEXT)
112
112
```
113
-
Disables`pathman` partitioning mechanism for the specified parent table and removes an insert trigger. Partitions itself remain unchanged.
113
+
Disables`pg_pathman` partitioning mechanism for the specified parent table and removes an insert trigger. Partitions itself remain unchanged.
Copy file name to clipboardExpand all lines: contrib/pathman/README.rus.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
#pathman
1
+
#pg_pathman
2
2
3
-
Модуль`pathman` предоставляет оптимизированный механизм секционирования, а также функции для создания и управления секциями.
3
+
Модуль`pg_pathman` предоставляет оптимизированный механизм секционирования, а также функции для создания и управления секциями.
4
4
5
-
##Концепцияpathman
5
+
##Концепцияpg_pathman
6
6
7
7
Секционирование -- это способ разбиения одной большой таблицы на множество меньших по размеру. Для каждой записи можно однозначно определить секцию, в которой она должна храниться посредством вычисления ключа. Традиционно выделяют три стратегии секционирования:
8
8
@@ -20,9 +20,9 @@ CREATE TABLE test_2 (CHECK ( id >= 200 AND id < 300 )) INHERITS (test);
20
20
21
21
Несмотря на гибкость, этот механизм обладает недостатками. Так при фильтрации данных оптимизатор вынужден перебирать все дочерние секции и сравнивать условие запроса с CHECK CONSTRAINT-ами секции, чтобы определить из каких секций ему следует загружать данные. При большом количестве секций это создает дополнительные накладные расходы, которые могут свести на нет выигрыш в производительности от применения секционирования.
22
22
23
-
Модуль`pathman` предоставляет функции для создания и управления
23
+
Модуль`pg_pathman` предоставляет функции для создания и управления
24
24
секциями (см. следующий раздел) и механизм секционирования,
25
-
оптимизированный с учетом знания о структуре дочерних таблиц. Конфигурация сохраняется таблице`pathman_config`, каждая строка которой содержит запись для одной секционированной таблицы (название таблицы, атрибут и тип разбиения). В процессе инициализации модуля в разделяемую память сохраняется конфигурация дочерних таблиц в удобном для поиска формате. Получив запрос типа`SELECT` к секционированной таблице,`pathman` анализирует дерево условий запроса и выделяет из него условия вида:
25
+
оптимизированный с учетом знания о структуре дочерних таблиц. Конфигурация сохраняется таблице`pathman_config`, каждая строка которой содержит запись для одной секционированной таблицы (название таблицы, атрибут и тип разбиения). В процессе инициализации модуля в разделяемую память сохраняется конфигурация дочерних таблиц в удобном для поиска формате. Получив запрос типа`SELECT` к секционированной таблице,`pg_pathman` анализирует дерево условий запроса и выделяет из него условия вида:
26
26
27
27
```
28
28
ПЕРЕМЕННАЯ ОПЕРАТОР КОНСТАНТА
@@ -32,23 +32,23 @@ CREATE TABLE test_2 (CHECK ( id >= 200 AND id < 300 )) INHERITS (test);
32
32
```
33
33
WHERE id = 150
34
34
```
35
-
Затем основываясь на стратегии секционирования и условиях запроса`pathman` выбирает соответствующие секции и строит план.
35
+
Затем основываясь на стратегии секционирования и условиях запроса`pg_pathman` выбирает соответствующие секции и строит план.
36
36
37
37
##Installation
38
38
39
-
Для установкиpathman выполните в командной строке:
39
+
Для установкиpg_pathman выполните в командной строке:
40
40
```
41
41
CREATE SCHEMA pathman;
42
-
CREATE EXTENSIONpathman SCHEMA pathman;
42
+
CREATE EXTENSIONpg_pathman SCHEMA pathman;
43
43
44
44
```
45
45
Затем модифицируйте параметр shared_preload_libraries в конфигурационном файле postgres.conf:
46
46
```
47
-
shared_preload_libraries = 'pathman'
47
+
shared_preload_libraries = 'pg_pathman'
48
48
```
49
49
Для вступления изменений в силу потребуется перезагрузка сервера PostgreSQL.
Отключает механизм секционирования`pathman` для заданной таблицы и удаляет триггер на вставку. При этом созданные ранее секции остаются без изменений.
115
+
Отключает механизм секционирования`pg_pathman` для заданной таблицы и удаляет триггер на вставку. При этом созданные ранее секции остаются без изменений.