@@ -243,7 +243,7 @@ extern double log_selectivity_lower_bound;
243243/* Parameters for current query */
244244extern QueryContextData query_context ;
245245extern int njoins ;
246- extern char * query_text ;
246+ extern char * query_text ;
247247
248248/* Memory context for long-live data */
249249extern MemoryContext AQOMemoryContext ;
@@ -253,63 +253,64 @@ extern post_parse_analyze_hook_type prev_post_parse_analyze_hook;
253253extern planner_hook_type prev_planner_hook ;
254254extern ExecutorStart_hook_type prev_ExecutorStart_hook ;
255255extern ExecutorEnd_hook_type prev_ExecutorEnd_hook ;
256- extern set_baserel_rows_estimate_hook_type
257- prev_set_baserel_rows_estimate_hook ;
258- extern get_parameterized_baserel_size_hook_type
259- prev_get_parameterized_baserel_size_hook ;
260- extern set_joinrel_size_estimates_hook_type
261- prev_set_joinrel_size_estimates_hook ;
262- extern get_parameterized_joinrel_size_hook_type
263- prev_get_parameterized_joinrel_size_hook ;
264- extern copy_generic_path_info_hook_type
265- prev_copy_generic_path_info_hook ;
256+ extern set_baserel_rows_estimate_hook_type
257+ prev_set_baserel_rows_estimate_hook ;
258+ extern get_parameterized_baserel_size_hook_type
259+ prev_get_parameterized_baserel_size_hook ;
260+ extern set_joinrel_size_estimates_hook_type
261+ prev_set_joinrel_size_estimates_hook ;
262+ extern get_parameterized_joinrel_size_hook_type
263+ prev_get_parameterized_joinrel_size_hook ;
264+ extern copy_generic_path_info_hook_type prev_copy_generic_path_info_hook ;
266265extern ExplainOnePlan_hook_type prev_ExplainOnePlan_hook ;
267266
268267extern void ppi_hook (ParamPathInfo * ppi );
269268
270269/* Hash functions */
271- int get_query_hash (Query * parse ,const char * query_text );
270+ int get_query_hash (Query * parse ,const char * query_text );
272271extern int get_fss_for_object (List * clauselist ,List * selectivities ,
273- List * relidslist ,int * nfeatures ,double * * features );
274- void get_eclasses ( List * clauselist , int * nargs ,
275- int * * args_hash ,int * * eclass_hash );
276- int get_clause_hash ( Expr * clause , int nargs ,
277- int * args_hash ,int * eclass_hash );
272+ List * relidslist ,int * nfeatures ,
273+ double * * features );
274+ void get_eclasses ( List * clauselist , int * nargs ,int * * args_hash ,
275+ int * * eclass_hash );
276+ int get_clause_hash ( Expr * clause , int nargs , int * args_hash ,int * eclass_hash );
278277
279278
280279/* Storage interaction */
281280bool find_query (int query_hash ,
282- Datum * search_values ,
283- bool * search_nulls );
281+ Datum * search_values ,
282+ bool * search_nulls );
284283bool add_query (int query_hash ,bool learn_aqo ,bool use_aqo ,
285- int fspace_hash ,bool auto_tuning );
284+ int fspace_hash ,bool auto_tuning );
286285bool update_query (int query_hash ,bool learn_aqo ,bool use_aqo ,
287- int fspace_hash ,bool auto_tuning );
288- bool add_query_text (int query_hash ,const char * query_text );
286+ int fspace_hash ,bool auto_tuning );
287+ bool add_query_text (int query_hash ,const char * query_text );
289288bool load_fss (int fss_hash ,int ncols ,
290289double * * matrix ,double * targets ,int * rows );
291290extern bool update_fss (int fss_hash ,int nrows ,int ncols ,
292291double * * matrix ,double * targets );
293- QueryStat * get_aqo_stat (int query_hash );
294- void update_aqo_stat (int query_hash ,QueryStat * stat );
295- void init_deactivated_queries_storage (void );
296- void fini_deactivated_queries_storage (void );
297- bool query_is_deactivated (int query_hash );
298- void add_deactivated_query (int query_hash );
292+ QueryStat * get_aqo_stat (int query_hash );
293+ void update_aqo_stat (int query_hash ,QueryStat * stat );
294+ void init_deactivated_queries_storage (void );
295+ void fini_deactivated_queries_storage (void );
296+ bool query_is_deactivated (int query_hash );
297+ void add_deactivated_query (int query_hash );
299298
300299/* Query preprocessing hooks */
301- void get_query_text (ParseState * pstate ,Query * query );
300+ void get_query_text (ParseState * pstate ,Query * query );
302301PlannedStmt * call_default_planner (Query * parse ,
303- int cursorOptions ,
304- ParamListInfo boundParams );
302+ const char * query_string ,
303+ int cursorOptions ,
304+ ParamListInfo boundParams );
305305PlannedStmt * aqo_planner (Query * parse ,
306- int cursorOptions ,
307- ParamListInfo boundParams );
306+ const char * query_string ,
307+ int cursorOptions ,
308+ ParamListInfo boundParams );
308309void print_into_explain (PlannedStmt * plannedstmt ,IntoClause * into ,
309- ExplainState * es ,const char * queryString ,
310- ParamListInfo params ,const instr_time * planduration ,
311- QueryEnvironment * queryEnv );
312- void disable_aqo_for_query (void );
310+ ExplainState * es ,const char * queryString ,
311+ ParamListInfo params ,const instr_time * planduration ,
312+ QueryEnvironment * queryEnv );
313+ void disable_aqo_for_query (void );
313314
314315/* Cardinality estimation hooks */
315316extern void aqo_set_baserel_rows_estimate (PlannerInfo * root ,RelOptInfo * rel );