@@ -243,7 +243,7 @@ extern double log_selectivity_lower_bound;
243
243
/* Parameters for current query */
244
244
extern QueryContextData query_context ;
245
245
extern int njoins ;
246
- extern char * query_text ;
246
+ extern char * query_text ;
247
247
248
248
/* Memory context for long-live data */
249
249
extern MemoryContext AQOMemoryContext ;
@@ -253,63 +253,64 @@ extern post_parse_analyze_hook_type prev_post_parse_analyze_hook;
253
253
extern planner_hook_type prev_planner_hook ;
254
254
extern ExecutorStart_hook_type prev_ExecutorStart_hook ;
255
255
extern 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 ;
266
265
extern ExplainOnePlan_hook_type prev_ExplainOnePlan_hook ;
267
266
268
267
extern void ppi_hook (ParamPathInfo * ppi );
269
268
270
269
/* Hash functions */
271
- int get_query_hash (Query * parse , const char * query_text );
270
+ int get_query_hash (Query * parse , const char * query_text );
272
271
extern 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 );
278
277
279
278
280
279
/* Storage interaction */
281
280
bool find_query (int query_hash ,
282
- Datum * search_values ,
283
- bool * search_nulls );
281
+ Datum * search_values ,
282
+ bool * search_nulls );
284
283
bool 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 );
286
285
bool 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 );
289
288
bool load_fss (int fss_hash , int ncols ,
290
289
double * * matrix , double * targets , int * rows );
291
290
extern bool update_fss (int fss_hash , int nrows , int ncols ,
292
291
double * * 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 );
299
298
300
299
/* Query preprocessing hooks */
301
- void get_query_text (ParseState * pstate , Query * query );
300
+ void get_query_text (ParseState * pstate , Query * query );
302
301
PlannedStmt * call_default_planner (Query * parse ,
303
- int cursorOptions ,
304
- ParamListInfo boundParams );
302
+ const char * query_string ,
303
+ int cursorOptions ,
304
+ ParamListInfo boundParams );
305
305
PlannedStmt * aqo_planner (Query * parse ,
306
- int cursorOptions ,
307
- ParamListInfo boundParams );
306
+ const char * query_string ,
307
+ int cursorOptions ,
308
+ ParamListInfo boundParams );
308
309
void 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 );
313
314
314
315
/* Cardinality estimation hooks */
315
316
extern void aqo_set_baserel_rows_estimate (PlannerInfo * root , RelOptInfo * rel );
0 commit comments