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

Commit 8683934

Browse files
committed
Add a foreign relation estimation hook into the core and extension.
Improve the elog panic message introduced in previous commit. Fix ForeignScan estimation logic.
1 parent 46fb4de commit 8683934

File tree

5 files changed

+152
-87
lines changed

5 files changed

+152
-87
lines changed

aqo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ post_parse_analyze_hook_type prev_post_parse_analyze_hook;
7676
planner_hook_type prev_planner_hook;
7777
ExecutorStart_hook_type prev_ExecutorStart_hook;
7878
ExecutorEnd_hook_type prev_ExecutorEnd_hook;
79+
set_baserel_rows_estimate_hook_type prev_set_foreign_rows_estimate_hook;
7980
set_baserel_rows_estimate_hook_type prev_set_baserel_rows_estimate_hook;
8081
get_parameterized_baserel_size_hook_type prev_get_parameterized_baserel_size_hook;
8182
set_joinrel_size_estimates_hook_type prev_set_joinrel_size_estimates_hook;
@@ -126,6 +127,7 @@ _PG_init(void)
126127
prev_ExecutorEnd_hook = ExecutorEnd_hook;
127128
ExecutorEnd_hook = aqo_ExecutorEnd;
128129
prev_set_baserel_rows_estimate_hook = set_baserel_rows_estimate_hook;
130+
set_foreign_rows_estimate_hook = aqo_set_baserel_rows_estimate;
129131
set_baserel_rows_estimate_hook = aqo_set_baserel_rows_estimate;
130132
prev_get_parameterized_baserel_size_hook = get_parameterized_baserel_size_hook;
131133
get_parameterized_baserel_size_hook = aqo_get_parameterized_baserel_size;

aqo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ extern post_parse_analyze_hook_type prev_post_parse_analyze_hook;
253253
extern planner_hook_type prev_planner_hook;
254254
extern ExecutorStart_hook_type prev_ExecutorStart_hook;
255255
extern ExecutorEnd_hook_type prev_ExecutorEnd_hook;
256+
extern set_baserel_rows_estimate_hook_type
257+
prev_set_foreign_rows_estimate_hook;
256258
extern set_baserel_rows_estimate_hook_type
257259
prev_set_baserel_rows_estimate_hook;
258260
extern get_parameterized_baserel_size_hook_type

0 commit comments

Comments
 (0)