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

Commitc8151e6

Browse files
committed
Don't copy PartitionBoundInfo in set_relation_partition_info.
I (tgl) remain dubious that it's a good idea for PartitionDirectoryto hold a pin on a relcache entry throughout planning, rather thancopying the data or using some kind of refcount scheme. However, it'scertainly the responsibility of the PartitionDirectory code to ensurethat what it's handing back is a stable data structure, not that ofits caller. So this is a pretty clear oversight in commit898e5e3,and one that can cost a lot of performance when there are manypartitions.Amit Langote (extracted from a much larger patch set)Discussion:https://postgr.es/m/CA+TgmoY3bRmGB6-DUnoVy5fJoreiBJ43rwMrQRCdPXuKt4Ykaw@mail.gmail.comDiscussion:https://postgr.es/m/9d7c5112-cb99-6a47-d3be-cf1ee6862a1d@lab.ntt.co.jp
1 parentb5fd497 commitc8151e6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎src/backend/optimizer/util/plancat.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include"optimizer/optimizer.h"
4040
#include"optimizer/plancat.h"
4141
#include"optimizer/prep.h"
42-
#include"partitioning/partbounds.h"
4342
#include"partitioning/partdesc.h"
4443
#include"parser/parse_relation.h"
4544
#include"parser/parsetree.h"
@@ -2082,16 +2081,14 @@ set_relation_partition_info(PlannerInfo *root, RelOptInfo *rel,
20822081
Relationrelation)
20832082
{
20842083
PartitionDescpartdesc;
2085-
PartitionKeypartkey;
20862084

20872085
Assert(relation->rd_rel->relkind==RELKIND_PARTITIONED_TABLE);
20882086

20892087
partdesc=PartitionDirectoryLookup(root->glob->partition_directory,
20902088
relation);
2091-
partkey=RelationGetPartitionKey(relation);
20922089
rel->part_scheme=find_partition_scheme(root,relation);
20932090
Assert(partdesc!=NULL&&rel->part_scheme!=NULL);
2094-
rel->boundinfo=partition_bounds_copy(partdesc->boundinfo,partkey);
2091+
rel->boundinfo=partdesc->boundinfo;
20952092
rel->nparts=partdesc->nparts;
20962093
set_baserel_partition_key_exprs(relation,rel);
20972094
rel->partition_qual=RelationGetPartitionQual(relation);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp