132
132
#include "nodes/nodeFuncs.h"
133
133
#include "optimizer/pathnode.h"
134
134
#include "optimizer/planner.h"
135
- #include "optimizer/cost.h"
136
135
#include "parser/analyze.h"
137
136
#include "parser/parsetree.h"
138
137
#include "utils/builtins.h"
139
138
#include "utils/guc.h"
140
139
#include "utils/hsearch.h"
141
140
#include "utils/memutils.h"
142
141
#include "utils/rel.h"
143
- #include "utils/fmgroids.h"
144
142
#include "utils/snapmgr.h"
145
143
146
144
#include "machine_learning.h"
147
- //#include "storage.h"
148
145
149
146
/* Check PostgreSQL version (9.6.0 contains important changes in planner) */
150
147
#if PG_VERSION_NUM < 90600
@@ -237,58 +234,15 @@ extern MemoryContext AQOCacheMemCtx;
237
234
extern MemoryContext AQOPredictMemCtx ;
238
235
extern MemoryContext AQOLearnMemCtx ;
239
236
240
- /* Saved hook values in case of unload */
241
- extern post_parse_analyze_hook_type prev_post_parse_analyze_hook ;
242
- extern planner_hook_type prev_planner_hook ;
243
- extern ExecutorStart_hook_type prev_ExecutorStart_hook ;
244
- extern ExecutorRun_hook_type prev_ExecutorRun ;
245
- extern ExecutorEnd_hook_type prev_ExecutorEnd_hook ;
246
- extern set_baserel_rows_estimate_hook_type
247
- prev_set_foreign_rows_estimate_hook ;
248
- extern set_baserel_rows_estimate_hook_type
249
- prev_set_baserel_rows_estimate_hook ;
250
- extern get_parameterized_baserel_size_hook_type
251
- prev_get_parameterized_baserel_size_hook ;
252
- extern set_joinrel_size_estimates_hook_type
253
- prev_set_joinrel_size_estimates_hook ;
254
- extern get_parameterized_joinrel_size_hook_type
255
- prev_get_parameterized_joinrel_size_hook ;
256
- extern ExplainOnePlan_hook_type prev_ExplainOnePlan_hook ;
257
- extern ExplainOneNode_hook_type prev_ExplainOneNode_hook ;
258
-
259
- extern void ppi_hook (ParamPathInfo * ppi );
260
237
extern int aqo_statement_timeout ;
261
238
262
- /* Hash functions */
263
- void get_eclasses (List * clauselist , int * nargs , int * * args_hash ,
264
- int * * eclass_hash );
265
- int get_clause_hash (Expr * clause , int nargs , int * args_hash , int * eclass_hash );
266
-
267
-
268
- /* Storage interaction */
269
- extern bool load_fss_ext (uint64 fs , int fss , OkNNrdata * data , List * * reloids );
270
- extern bool update_fss_ext (uint64 fs , int fss , OkNNrdata * data , List * reloids );
271
-
272
- /* Query preprocessing hooks */
273
- extern void print_into_explain (PlannedStmt * plannedstmt , IntoClause * into ,
274
- ExplainState * es , const char * queryString ,
275
- ParamListInfo params ,
276
- const instr_time * planduration ,
277
- QueryEnvironment * queryEnv );
278
- extern void print_node_explain (ExplainState * es , PlanState * ps , Plan * plan );
279
-
280
239
/* Cardinality estimation */
281
240
extern double predict_for_relation (List * restrict_clauses , List * selectivities ,
282
241
List * relsigns , int * fss );
283
242
284
- /* Query execution statistics collecting hooks */
285
- void aqo_ExecutorStart (QueryDesc * queryDesc , int eflags );
286
- void aqo_ExecutorRun (QueryDesc * queryDesc , ScanDirection direction ,
287
- uint64 count , bool execute_once );
288
- void aqo_ExecutorEnd (QueryDesc * queryDesc );
289
-
290
243
/* Automatic query tuning */
291
244
extern void automatical_query_tuning (uint64 query_hash , struct StatEntry * stat );
245
+ extern double get_mean (double * elems , int nelems );
292
246
293
247
/* Utilities */
294
248
extern int int_cmp (const void * a , const void * b );
@@ -306,8 +260,10 @@ extern void selectivity_cache_clear(void);
306
260
307
261
extern bool IsQueryDisabled (void );
308
262
309
- extern bool update_query_timeout (uint64 queryid , int64 smart_timeout );
310
- extern double get_mean (double * elems , int nelems );
311
-
312
263
extern List * cur_classes ;
264
+
265
+ extern void aqo_cardinality_hooks_init (void );
266
+ extern void aqo_preprocessing_init (void );
267
+ extern void aqo_postprocessing_init (void );
268
+
313
269
#endif
0 commit comments