@@ -85,7 +85,6 @@ static void StoreToQueryEnv(QueryDesc *queryDesc);
8585static void StorePlanInternals (QueryDesc * queryDesc );
8686static bool ExtractFromQueryEnv (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
10431041static void
0 commit comments