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

Commitd12a1fe

Browse files
committed
Add basic regression test on FDW support.
Switch from AQO_EXPLAIN define to the two user GUCS: aqo.detailsand aqo.show_hash.New ExplainOneNode hook allows to add info into explain of each node.
1 parent904ed19 commitd12a1fe

File tree

7 files changed

+295
-159
lines changed

7 files changed

+295
-159
lines changed

‎Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ REGRESS =aqo_disabled \
1414
aqo_forced\
1515
aqo_learn\
1616
schema\
17+
aqo_fdw\
1718
aqo_CVE-2020-14350
1819

1920
fdw_srcdir =$(top_srcdir)/contrib/postgres_fdw
2021
PG_CPPFLAGS += -I$(libpq_srcdir) -I$(fdw_srcdir)
2122
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
23+
EXTRA_INSTALL = contrib/postgres_fdw
2224

2325
DATA = aqo--1.0.sql aqo--1.0--1.1.sql aqo--1.1--1.2.sql aqo--1.2.sql
2426

‎aqo.c‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ void _PG_init(void);
1818
/* Strategy of determining feature space for new queries. */
1919
intaqo_mode;
2020
boolforce_collect_stat;
21+
boolaqo_show_hash;
22+
boolaqo_details;
2123

2224
/* GUC variables */
2325
staticconststructconfig_enum_entryformat_options[]= {
@@ -83,6 +85,7 @@ set_joinrel_size_estimates_hook_typeprev_set_joinrel_size_estimates_hook;
8385
get_parameterized_joinrel_size_hook_typeprev_get_parameterized_joinrel_size_hook;
8486
copy_generic_path_info_hook_typeprev_copy_generic_path_info_hook;
8587
ExplainOnePlan_hook_typeprev_ExplainOnePlan_hook;
88+
ExplainOneNode_hook_typeprev_ExplainOneNode_hook;
8689

8790
/*****************************************************************************
8891
*
@@ -116,7 +119,33 @@ _PG_init(void)
116119
NULL,
117120
NULL,
118121
NULL
119-
);
122+
);
123+
124+
DefineCustomBoolVariable(
125+
"aqo.show_hash",
126+
"Show query and node hash on explain.",
127+
"Hash value depend on each instance and is not good to enable it in regression or TAP tests.",
128+
&aqo_show_hash,
129+
false,
130+
PGC_USERSET,
131+
0,
132+
NULL,
133+
NULL,
134+
NULL
135+
);
136+
137+
DefineCustomBoolVariable(
138+
"aqo.details",
139+
"Show AQO state on a query.",
140+
NULL,
141+
&aqo_details,
142+
false,
143+
PGC_USERSET,
144+
0,
145+
NULL,
146+
NULL,
147+
NULL
148+
);
120149

121150
prev_planner_hook=planner_hook;
122151
planner_hook=aqo_planner;
@@ -139,6 +168,8 @@ _PG_init(void)
139168
copy_generic_path_info_hook=aqo_copy_generic_path_info;
140169
prev_ExplainOnePlan_hook=ExplainOnePlan_hook;
141170
ExplainOnePlan_hook=print_into_explain;
171+
prev_ExplainOneNode_hook=ExplainOneNode_hook;
172+
ExplainOneNode_hook=print_node_explain;
142173
parampathinfo_postinit_hook=ppi_hook;
143174

144175
init_deactivated_queries_storage();

‎aqo.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ typedef enum
174174

175175
externintaqo_mode;
176176
externboolforce_collect_stat;
177+
externboolaqo_show_hash;
178+
externboolaqo_details;
177179

178180
/*
179181
* It is mostly needed for auto tuning of query. with auto tuning mode aqo
@@ -312,6 +314,10 @@ void print_into_explain(PlannedStmt *plannedstmt, IntoClause *into,
312314
ExplainState*es,constchar*queryString,
313315
ParamListInfoparams,constinstr_time*planduration,
314316
QueryEnvironment*queryEnv);
317+
externvoidprint_node_explain(ExplainState*es,
318+
PlanState*ps,
319+
Plan*plan,
320+
doublerows);
315321
voiddisable_aqo_for_query(void);
316322

317323
/* Cardinality estimation hooks */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp