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

Known limitations

Dmitry Ivanov edited this pageOct 9, 2017 ·8 revisions

This a non-exhaustive list of known limitations of pg_pathman:

Sub-partitions are not supported

Currently you can't create multilevel partitioning scheme.

INSERT ... ON CONFLICT is not supported

createtabletest(idintnot null, val float8);createunique indexon test (id);select create_range_partitions('test','id',1,10,3);insert into testvalues (0,0)on conflict (id) doupdateset val=1;ERROR:ON CONFLICT clause is not supported with partitioned tables

Global primary keys are not supported

createtabletest(idintprimary key,datetimestampnot null);select create_range_partitions('test','date', now(),'1 day'::interval,4);insert into testvalues(1, now());insert into testvalues(1, now()+'1 day');table test; id |date----+----------------------------1 |2017-10-0316:33:24.9530121 |2017-10-0416:33:31.476003(2 rows)

Foreign keys pointing to partitioned tables are not supported

createtabletest(idintnot null);createunique indexon test (id);select create_range_partitions('test','id',1,10,3);insert into testvalues (1);createtablesimple(idintreferences test(id));insert into simplevalues (1);ERROR:  insertorupdateon table"simple" violatesforeign keyconstraint"simple_id_fkey"DETAIL:  Key (id)=(1) is not presentin table"test".

DIY logical replication is not supported (?)

This includes Londiste, pg_logical etc. Instead, take a look atpg_shardman.

Some optimizations may not be available on PostgreSQL 9.5

Due to significant API changes, these optimizations are not available on 9.5:

  • Faster partition pruning inSELECT ... subqueries under UPDATE and DELETE statements;
  • Faster partition pruning inSELECT ... FOR SHARE/UPDATE/etc.

Seethis page for more information.

UPDATE and DELETE queries on a partitioned table joined with another partitioned table

We've noticed that certain queries cannot be planned by pg_pathman:

  • DELETE FROM partitioned_table_1 USING partitioned_table_2 ...;
  • UPDATE partitioned_table_1 FROM partitioned_table_2 ...;

This is due to some limitations of PostgreSQL's planner: we can't hook inheritance planner used for DELETE and UPDATE queries on partitioned tables. As a result, we can't plan and execute queries that are going to modifyseveral partitions:

createtablea(valintnot null);select create_range_partitions('a','val',1,10,3);createtableb(valintnot null);select create_range_partitions('b','val',1,10,3);deletefrom a using bwherea.val=b.val;ERROR:DELETEandUPDATE queries with ajoin of partitioned tables are not supported

However, query will work as expected if it'sobvious to the planner that it wants to modify only 1 (or 0) partition:

explain (costs off)deletefrom a using bwherea.val=b.valanda.val<10;               QUERY PLAN-----------------------------------------Deleteon a_1->  MergeJoin         Merge Cond: (a_1.val=b_1.val)->  Sort               Sort Key:a_1.val->  Seq Scanon a_1                     Filter: (val<10)->  Sort               Sort Key:b_1.val->  Append->  Seq Scanon b_1->  Seq Scanon b_2->  Seq Scanon b_3(13 rows)

As a workaround, you can use WITH statement to hide the joined partitioned table:

explain (costs off) with qas (select*from b)deletefrom a using qwherea.val=q.val;              QUERY PLAN---------------------------------------Deleteon aDeleteon aDeleteon a_1Deleteon a_2Deleteon a_3   CTE q->  Append->  Seq Scanon b_1->  Seq Scanon b_2->  Seq Scanon b_3->  HashJoin         Hash Cond: (q.val=a.val)->  CTE Scanon q->  Hash->  Seq Scanon a->  MergeJoin         Merge Cond: (a_1.val=q.val)->  Sort               Sort Key:a_1.val->  Seq Scanon a_1->  Sort               Sort Key:q.val->  CTE Scanon q->  MergeJoin         Merge Cond: (a_2.val=q.val)->  Sort               Sort Key:a_2.val->  Seq Scanon a_2->  Sort               Sort Key:q.val->  CTE Scanon q->  MergeJoin         Merge Cond: (a_3.val=q.val)->  Sort               Sort Key:a_3.val->  Seq Scanon a_3->  Sort               Sort Key:q.val->  CTE Scanon q(39 rows)
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp