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

Commit2bbdd2d

Browse files
author
Maksim Milyutin
committed
Add compat version of get_cheapest_path_for_pathkeys routine
1 parent639f014 commit2bbdd2d

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

‎src/include/compat/pg_compat.h‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,25 @@ extern List *get_all_actual_clauses(List *restrictinfo_list);
300300
#endif
301301

302302

303+
/*
304+
* get_cheapest_path_for_pathkeys()
305+
*/
306+
#ifPG_VERSION_NUM >=100000
307+
#defineget_cheapest_path_for_pathkeys_compat(paths,pathkeys,required_outer, \
308+
cost_criterion, \
309+
require_parallel_safe) \
310+
get_cheapest_path_for_pathkeys((paths), (pathkeys), (required_outer), \
311+
(cost_criterion), \
312+
(require_parallel_safe))
313+
#elifPG_VERSION_NUM >=90500
314+
#defineget_cheapest_path_for_pathkeys_compat(paths,pathkeys,required_outer, \
315+
cost_criterion, \
316+
require_parallel_safe) \
317+
get_cheapest_path_for_pathkeys((paths), (pathkeys), (required_outer), \
318+
(cost_criterion))
319+
#endif
320+
321+
303322
/*
304323
* get_parameterized_joinrel_size()
305324
*/

‎src/pg_pathman.c‎

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,31 +1489,18 @@ generate_mergeappend_paths(PlannerInfo *root, RelOptInfo *rel,
14891489
*cheapest_total;
14901490

14911491
/* Locate the right paths, if they are available. */
1492-
#ifPG_VERSION_NUM >=100000
1493-
cheapest_startup=
1494-
get_cheapest_path_for_pathkeys(childrel->pathlist,
1495-
pathkeys,
1496-
NULL,
1497-
STARTUP_COST,
1498-
true);
1499-
cheapest_total=
1500-
get_cheapest_path_for_pathkeys(childrel->pathlist,
1501-
pathkeys,
1502-
NULL,
1503-
TOTAL_COST,
1504-
true);
1505-
#else
15061492
cheapest_startup=
1507-
get_cheapest_path_for_pathkeys(childrel->pathlist,
1508-
pathkeys,
1509-
NULL,
1510-
STARTUP_COST);
1493+
get_cheapest_path_for_pathkeys_compat(childrel->pathlist,
1494+
pathkeys,
1495+
NULL,
1496+
STARTUP_COST,
1497+
false);
15111498
cheapest_total=
1512-
get_cheapest_path_for_pathkeys(childrel->pathlist,
1513-
pathkeys,
1514-
NULL,
1515-
TOTAL_COST);
1516-
#endif
1499+
get_cheapest_path_for_pathkeys_compat(childrel->pathlist,
1500+
pathkeys,
1501+
NULL,
1502+
TOTAL_COST,
1503+
false);
15171504

15181505
/*
15191506
* If we can't find any paths with the right order just use the
@@ -2091,18 +2078,11 @@ get_cheapest_parameterized_child_path(PlannerInfo *root, RelOptInfo *rel,
20912078
* parameterization. If it has exactly the needed parameterization, we're
20922079
* done.
20932080
*/
2094-
#ifPG_VERSION_NUM >=100000
2095-
cheapest=get_cheapest_path_for_pathkeys(rel->pathlist,
2096-
NIL,
2097-
required_outer,
2098-
TOTAL_COST,
2099-
false);
2100-
#else
2101-
cheapest=get_cheapest_path_for_pathkeys(rel->pathlist,
2102-
NIL,
2103-
required_outer,
2104-
TOTAL_COST);
2105-
#endif
2081+
cheapest=get_cheapest_path_for_pathkeys_compat(rel->pathlist,
2082+
NIL,
2083+
required_outer,
2084+
TOTAL_COST,
2085+
false);
21062086
Assert(cheapest!=NULL);
21072087
if (bms_equal(PATH_REQ_OUTER(cheapest),required_outer))
21082088
returncheapest;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp