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

Commit86ac7f5

Browse files
Alexandra PervushinaDaniil Anisimov
Alexandra Pervushina
authored and
Daniil Anisimov
committed
Print aqo details regardless of IsQueryDisabled
1 parent7cbb504 commit86ac7f5

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

‎aqo.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ MemoryContext AQOLearnMemCtx = NULL;
9696
MemoryContextAQOStorageMemCtx=NULL;
9797

9898
/* Additional plan info */
99-
intnjoins;
99+
intnjoins=-1;
100100

101101

102102
/*****************************************************************************

‎postprocessing.c‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ static void StoreToQueryEnv(QueryDesc *queryDesc);
8585
staticvoidStorePlanInternals(QueryDesc*queryDesc);
8686
staticboolExtractFromQueryEnv(QueryDesc*queryDesc);
8787

88-
8988
/*
9089
* This is the critical section: only one runner is allowed to be inside this
9190
* function for one feature subspace.
@@ -766,6 +765,7 @@ aqo_ExecutorEnd(QueryDesc *queryDesc)
766765

767766
cardinality_sum_errors=0.;
768767
cardinality_num_objects=0;
768+
njoins=-1;
769769

770770
if (IsQueryDisabled()|| !ExtractFromQueryEnv(queryDesc))
771771
/* AQO keep all query-related preferences at the query context.
@@ -996,7 +996,8 @@ print_into_explain(PlannedStmt *plannedstmt, IntoClause *into,
996996
(*aqo_ExplainOnePlan_next)(plannedstmt,into,es,queryString,
997997
params,planduration,queryEnv);
998998

999-
if (IsQueryDisabled()|| !aqo_show_details)
999+
if (!(aqo_mode!=AQO_MODE_DISABLED||force_collect_stat)||
1000+
!aqo_show_details)
10001001
return;
10011002

10021003
/* Report to user about aqo state only in verbose mode */
@@ -1031,13 +1032,10 @@ print_into_explain(PlannedStmt *plannedstmt, IntoClause *into,
10311032
* Query class provides an user the conveniently use of the AQO
10321033
* auxiliary functions.
10331034
*/
1034-
if (aqo_mode!=AQO_MODE_DISABLED||force_collect_stat)
1035-
{
1036-
if (aqo_show_hash)
1037-
ExplainPropertyInteger("Query hash",NULL,
1038-
query_context.query_hash,es);
1039-
ExplainPropertyInteger("JOINS",NULL,njoins,es);
1040-
}
1035+
if (aqo_show_hash)
1036+
ExplainPropertyInteger("Query hash",NULL,
1037+
(int64)query_context.query_hash,es);
1038+
ExplainPropertyInteger("JOINS",NULL,njoins,es);
10411039
}
10421040

10431041
staticvoid

‎preprocessing.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
127127
* all execution stages.
128128
*/
129129
disable_aqo_for_query();
130+
query_context.query_hash=0;
130131

131132
return (*aqo_planner_next)(parse,query_string,cursorOptions,boundParams);
132133
}
@@ -233,7 +234,11 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
233234
*/
234235
if (!query_context.learn_aqo&& !query_context.use_aqo&&
235236
!query_context.auto_tuning&& !force_collect_stat)
237+
{
236238
add_deactivated_query(query_context.query_hash);
239+
disable_aqo_for_query();
240+
gotoignore_query_settings;
241+
}
237242

238243
/*
239244
* That we can do if query exists in database.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp