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
+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 query pathman 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 query pg_pathman analyzes conditions tree looking for conditions like:
24
24
25
25
```
26
26
VARIABLE OP CONST
@@ -31,25 +31,25 @@ 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 install pathman run in pathman directory:
38
+
To install pg_pathman run in pg_pathman directory:
39
39
```
40
40
make install USE_PGXS=1
41
41
```
42
42
Modify shared_preload_libraries parameter in postgres.conf as following:
43
43
```
44
-
shared_preload_libraries = 'pathman'
44
+
shared_preload_libraries = 'pg_pathman'
45
45
```
46
46
It will require to restart the PostgreSQL instance. Then execute following query in psql:
47
47
```
48
48
CREATE SCHEMA pathman;
49
-
CREATE EXTENSION pathman SCHEMA pathman;
49
+
CREATE EXTENSION pg_pathman SCHEMA pathman;
50
50
```
51
51
52
-
## Pathman Functions
52
+
## pg_pathman Functions
53
53
54
54
### Partitions Creation
55
55
```
@@ -113,7 +113,7 @@ Prepends new partition with the range equal to the range of the first partition.
113
113
```
114
114
disable_partitioning(relation TEXT)
115
115
```
116
-
Disables `pathman` partitioning mechanism for the specified parent table and removes an insert trigger. Partitions itself remain unchanged.
116
+
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: README.rus.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
-
Модуль `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,22 +32,22 @@ 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
make install USE_PGXS=1
42
42
```
43
43
Модифицируйте параметр shared_preload_libraries в конфигурационном файле postgres.conf:
44
44
```
45
-
shared_preload_libraries = 'pathman'
45
+
shared_preload_libraries = 'pg_pathman'
46
46
```
47
47
Для вступления изменений в силу потребуется перезагрузка сервера PostgreSQL. Затем выполните в psql:
Отключает механизм секционирования `pathman` для заданной таблицы и удаляет триггер на вставку. При этом созданные ранее секции остаются без изменений.
117
+
Отключает механизм секционирования `pg_pathman` для заданной таблицы и удаляет триггер на вставку. При этом созданные ранее секции остаются без изменений.
0 commit comments