@@ -766,6 +766,7 @@ aqo_ExecutorEnd(QueryDesc *queryDesc)
766766
767767 cardinality_sum_errors = 0. ;
768768 cardinality_num_objects = 0 ;
769+ njoins = -1 ;
769770
770771 if (IsQueryDisabled () || !ExtractFromQueryEnv (queryDesc ))
771772 /* AQO keep all query-related preferences at the query context.
@@ -996,7 +997,7 @@ print_into_explain(PlannedStmt *plannedstmt, IntoClause *into,
996997 (* aqo_ExplainOnePlan_next )(plannedstmt , into , es , queryString ,
997998 params , planduration , queryEnv );
998999
999- if (IsQueryDisabled ( ) || !aqo_show_details )
1000+ if (!( aqo_mode != AQO_MODE_DISABLED || force_collect_stat ) || !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