Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8a2523f

Browse files
committed
Tweak API of new function clause_is_computable_at().
Pass it the RestrictInfo under consideration, not just the clause_relids. This should save some trivial amount of code at the call sites, and it gives us more flexibility about what clause_is_computable_at() does. There's no actual functional change here, though. Discussion: https://postgr.es/m/3564467.1684352557@sss.pgh.pa.us
1 parent 1c634f6 commit 8a2523f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/backend/optimizer/util/relnode.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,7 @@ subbuild_joinrel_restrictlist(PlannerInfo *root,
13461346
Assert(!RINFO_IS_PUSHED_DOWN(rinfo, joinrel->relids));
13471347
if (!bms_is_subset(rinfo->required_relids, both_input_relids))
13481348
continue;
1349-
if (!clause_is_computable_at(root, rinfo->clause_relids,
1350-
both_input_relids))
1349+
if (!clause_is_computable_at(root, rinfo, both_input_relids))
13511350
continue;
13521351
}
13531352
else
@@ -1358,13 +1357,13 @@ subbuild_joinrel_restrictlist(PlannerInfo *root,
13581357
*/
13591358
#ifdef USE_ASSERT_CHECKING
13601359
if (RINFO_IS_PUSHED_DOWN(rinfo, joinrel->relids))
1361-
Assert(clause_is_computable_at(root, rinfo->clause_relids,
1360+
Assert(clause_is_computable_at(root, rinfo,
13621361
joinrel->relids));
13631362
else
13641363
{
13651364
Assert(bms_is_subset(rinfo->required_relids,
13661365
both_input_relids));
1367-
Assert(clause_is_computable_at(root, rinfo->clause_relids,
1366+
Assert(clause_is_computable_at(root, rinfo,
13681367
both_input_relids));
13691368
}
13701369
#endif

src/backend/optimizer/util/restrictinfo.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,10 @@ extract_actual_join_clauses(List *restrictinfo_list,
541541
*/
542542
bool
543543
clause_is_computable_at(PlannerInfo *root,
544-
Relids clause_relids,
544+
RestrictInfo *rinfo,
545545
Relids eval_relids)
546546
{
547+
Relids clause_relids = rinfo->clause_relids;
547548
ListCell *lc;
548549

549550
/* Nothing to do if no outer joins have been performed yet. */

src/include/optimizer/restrictinfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern void extract_actual_join_clauses(List *restrictinfo_list,
4040
List **joinquals,
4141
List **otherquals);
4242
extern bool clause_is_computable_at(PlannerInfo *root,
43-
Relids clause_relids,
43+
RestrictInfo *rinfo,
4444
Relids eval_relids);
4545
extern bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel);
4646
extern bool join_clause_is_movable_into(RestrictInfo *rinfo,

0 commit comments

Comments
 (0)