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

Commit9471ce0

Browse files
committed
Force optimiser to use AJ paths.
To check the feature we need good covering of tests. Force AJ wheneverpossible by drastically reducing startup and total costs of OTHER_JOINREL,generated by the AJ code.
1 parent348744b commit9471ce0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1874,10 +1874,11 @@ try_asymmetric_partitionwise_join(PlannerInfo *root,
18741874
nappinfos,appinfos)));
18751875

18761876
/* And make paths for the child join */
1877+
force_path= true;
18771878
populate_joinrel_with_paths(root,outer_child,inner_rel,
18781879
child_joinrel,child_sjinfo,
18791880
child_restrictlist);
1880-
1881+
force_path= false;
18811882
pfree(appinfos);
18821883

18831884
/*

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ typedef enum
4646
*/
4747
#defineSTD_FUZZ_FACTOR 1.01
4848

49+
boolforce_path= false;
50+
4951
staticList*translate_sub_tlist(List*tlist,intrelid);
5052
staticintappend_total_cost_compare(constListCell*a,constListCell*b);
5153
staticintappend_startup_cost_compare(constListCell*a,constListCell*b);
@@ -425,6 +427,12 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
425427
List*new_path_pathkeys;
426428
ListCell*p1;
427429

430+
if (force_path)
431+
{
432+
new_path->startup_cost=0.0001;
433+
new_path->total_cost=0.0001;
434+
}
435+
428436
/*
429437
* This is a convenient place to check for query cancel --- no part of the
430438
* planner goes very long without calling add_path().

‎src/include/optimizer/pathnode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include"nodes/pathnodes.h"
1919

2020

21+
externboolforce_path;
22+
2123
/*
2224
* prototypes for pathnode.c
2325
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp