Skip to content

Commit 1fb13a5

Browse files
committed
Adapt AQO extension for feature-freezed PostgreSQL v.12
Because of changes in PostgreSQL heap access methods, this version of extension not backward compatible. In addition, we fix the bug on updating aqo_* relations.
1 parent ae85caf commit 1fb13a5

File tree

7 files changed

+1242
-88
lines changed

7 files changed

+1242
-88
lines changed

aqo.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ double log_selectivity_lower_bound = -30;
5555
*/
5656
MemoryContext AQOMemoryContext;
5757
QueryContextData query_context;
58+
/* Additional plan info */
59+
int njoins;
60+
5861
char *query_text = NULL;
5962

6063
/* Saved hook values */

aqo.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ extern int auto_tuning_max_iterations;
226226
extern int auto_tuning_infinite_loop;
227227

228228
/* Machine learning parameters */
229+
230+
/* Max number of matrix rows - max number of possible neighbors. */
229231
#define aqo_K (30)
230232

231233
extern const double object_selection_prediction_threshold;
@@ -236,6 +238,7 @@ extern double log_selectivity_lower_bound;
236238

237239
/* Parameters for current query */
238240
extern QueryContextData query_context;
241+
extern int njoins;
239242
extern char *query_text;
240243

241244
/* Memory context for long-live data */
@@ -298,7 +301,8 @@ PlannedStmt *aqo_planner(Query *parse,
298301
ParamListInfo boundParams);
299302
void print_into_explain(PlannedStmt *plannedstmt, IntoClause *into,
300303
ExplainState *es, const char *queryString,
301-
ParamListInfo params, const instr_time *planduration);
304+
ParamListInfo params, const instr_time *planduration,
305+
QueryEnvironment *queryEnv);
302306
void disable_aqo_for_query(void);
303307

304308
/* Cardinality estimation hooks */

0 commit comments

Comments
 (0)