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

Commit5425c0f

Browse files
committed
pathman: warnings fix, documentation
1 parent1aa7e48 commit5425c0f

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

‎contrib/pg_pathman/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Based on partitioning type and operator the `pg_pathman` searches corresponding
3737

3838
To install pg_pathman run in psql:
3939
```
40-
CREATE SCHEMA pathman;
41-
CREATE EXTENSION pg_pathman SCHEMA pathman;
40+
CREATE EXTENSION pg_pathman;
4241
```
4342
Then modify shared_preload_libraries parameter in postgres.conf as following:
4443
```
@@ -121,7 +120,7 @@ CREATE TABLE hash_rel (
121120
value INTEGER);
122121
INSERT INTO hash_rel (value) SELECT g FROM generate_series(1, 10000) as g;
123122
```
124-
Then run create_hash_partitions() function with appropriate arguments:
123+
If partitions are supposed to have indexes, then they should be created for parent table before partitioning. In this case pg_pathman will automaticaly create indexes for partitions.Then run create_hash_partitions() function with appropriate arguments:
125124
```
126125
SELECT create_hash_partitions('hash_rel', 'value', 100);
127126
```

‎contrib/pg_pathman/README.rus.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ WHERE id = 150
3838

3939
Для установки pg_pathman выполните в командной строке:
4040
```
41-
CREATE SCHEMA pathman;
42-
CREATE EXTENSION pg_pathman SCHEMA pathman;
41+
CREATE EXTENSION pg_pathman;
4342
4443
```
4544
Затем модифицируйте параметр shared_preload_libraries в конфигурационном файле postgres.conf:
@@ -123,7 +122,7 @@ CREATE TABLE hash_rel (
123122
value INTEGER);
124123
INSERT INTO hash_rel (value) SELECT g FROM generate_series(1, 10000) as g;
125124
```
126-
Разобьем таблицу`hash_rel` на 100 секций по полю`value`:
125+
Если дочерние секции подразумевают наличие индексов, то стоит их создать в родительской таблице до разбиения. Тогда при разбиении pg_pathman автоматически создаст соответствующие индексы в дочерних.таблицах.Разобьем таблицу`hash_rel` на 100 секций по полю`value`:
127126
```
128127
SELECT create_hash_partitions('hash_rel', 'value', 100);
129128
```

‎contrib/pg_pathman/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ load_check_constraints(Oid parent_oid)
208208
{
209209
SPITupleTable*tuptable=SPI_tuptable;
210210
Oid*children;
211-
RangeEntry*ranges;
211+
RangeEntry*ranges=NULL;
212212
Datummin;
213213
Datummax;
214214
inthash;

‎contrib/pg_pathman/pg_pathman.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,9 @@ handle_binary_opexpr(const PartRelationInfo *prel, WrapperNode *result,
644644
if (rangerel!=NULL)
645645
{
646646
RangeEntry*re;
647-
boolfound= false,
648-
lossy= false;
647+
boollossy= false;
649648
#ifdefUSE_ASSERT_CHECKING
649+
boolfound= false;
650650
intcounter=0;
651651
#endif
652652
intstartidx=0,
@@ -718,7 +718,9 @@ handle_binary_opexpr(const PartRelationInfo *prel, WrapperNode *result,
718718
lossy= false;
719719
else
720720
lossy= true;
721+
#ifdefUSE_ASSERT_CHECKING
721722
found= true;
723+
#endif
722724
break;
723725
}
724726

@@ -808,8 +810,10 @@ range_binary_search(const RangeRelation *rangerel, FmgrInfo *cmp_func, Datum val
808810
cmp_max,
809811
i=0,
810812
startidx=0,
811-
endidx=rangerel->ranges.length-1,
812-
counter=0;
813+
endidx=rangerel->ranges.length-1;
814+
#ifdefUSE_ASSERT_CHECKING
815+
intcounter=0;
816+
#endif
813817

814818
*foundPtr= false;
815819

‎contrib/pg_pathman/rangeset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ irange_list_union(List *a, List *b)
5252

5353
while (ca||cb)
5454
{
55-
IndexRangenext;
55+
IndexRangenext=0;
5656

5757
/* Fetch next range with lesser lower bound */
5858
if (ca&&cb)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp