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

Commit480f1f4

Browse files
committed
Teach adjust_appendrel_attrs(_multilevel) to do multiple translations.
Currently, child relations are always base relations, so when wetranslate parent relids to child relids, we only need to translatea singler relid. However, the proposed partition-wise join featurewill create child joins, which will mean we need to translate a setof parent relids to the corresponding child relids. This ispreliminary refactoring to make that possible.Ashutosh Bapat. Review and testing of the larger patch set of whichthis is a part by Amit Langote, Rajkumar Raghuwanshi, Rafia Sabih,Thomas Munro, Dilip Kumar, and me. Some adjustments, mostlycosmetic, by me.Discussion:http://postgr.es/m/CA+TgmobQK80vtXjAsPZWWXd7c8u13G86gmuLupN+uUJjA+i4nA@mail.gmail.com
1 parentd57929a commit480f1f4

File tree

5 files changed

+200
-72
lines changed

5 files changed

+200
-72
lines changed

‎src/backend/optimizer/path/allpaths.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
942942
Assert(IsA(rinfo,RestrictInfo));
943943
childqual=adjust_appendrel_attrs(root,
944944
(Node*)rinfo->clause,
945-
appinfo);
945+
1,&appinfo);
946946
childqual=eval_const_expressions(root,childqual);
947947
/* check for flat-out constant */
948948
if (childqual&&IsA(childqual,Const))
@@ -1061,11 +1061,11 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
10611061
childrel->joininfo= (List*)
10621062
adjust_appendrel_attrs(root,
10631063
(Node*)rel->joininfo,
1064-
appinfo);
1064+
1,&appinfo);
10651065
childrel->reltarget->exprs= (List*)
10661066
adjust_appendrel_attrs(root,
10671067
(Node*)rel->reltarget->exprs,
1068-
appinfo);
1068+
1,&appinfo);
10691069

10701070
/*
10711071
* We have to make child entries in the EquivalenceClass data

‎src/backend/optimizer/path/equivclass.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,8 @@ generate_join_implied_equalities_broken(PlannerInfo *root,
13291329
if (IS_OTHER_REL(inner_rel)&&result!=NIL)
13301330
result= (List*)adjust_appendrel_attrs_multilevel(root,
13311331
(Node*)result,
1332-
inner_rel);
1332+
inner_rel->relids,
1333+
inner_rel->top_parent_relids);
13331334

13341335
returnresult;
13351336
}
@@ -2112,7 +2113,7 @@ add_child_rel_equivalences(PlannerInfo *root,
21122113
child_expr= (Expr*)
21132114
adjust_appendrel_attrs(root,
21142115
(Node*)cur_em->em_expr,
2115-
appinfo);
2116+
1,&appinfo);
21162117

21172118
/*
21182119
* Transform em_relids to match. Note we do *not* do

‎src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ inheritance_planner(PlannerInfo *root)
11421142
subroot->parse= (Query*)
11431143
adjust_appendrel_attrs(root,
11441144
(Node*)parse,
1145-
appinfo);
1145+
1,&appinfo);
11461146

11471147
/*
11481148
* If there are securityQuals attached to the parent, move them to the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp