File tree 13 files changed +146
-47
lines changed
13 files changed +146
-47
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * aqo.c
3
+ * Adaptive query optimization extension
4
+ *
5
+ * Copyright (c) 2016-2020, Postgres Professional
6
+ *
7
+ * IDENTIFICATION
8
+ * aqo/aqo.c
9
+ */
10
+
1
11
#include "aqo.h"
2
12
3
13
PG_MODULE_MAGIC ;
Original file line number Diff line number Diff line change 108
108
* Copyright (c) 2016-2018, Postgres Professional
109
109
*
110
110
* IDENTIFICATION
111
- * contrib/aqo/aqo.h
111
+ * aqo/aqo.h
112
+ *
112
113
*/
113
114
#ifndef __ML_CARD_H__
114
115
#define __ML_CARD_H__
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* AUTOMATIC QUERY TUNING
6
5
*
7
6
* This module automatically implements basic strategies of tuning AQO for best
8
7
* PostgreSQL performance.
9
8
*
10
- *****************************************************************************/
9
+ *******************************************************************************
10
+ *
11
+ * Copyright (c) 2016-2020, Postgres Professional
12
+ *
13
+ * IDENTIFICATION
14
+ * aqo/auto_tuning.c
15
+ *
16
+ */
17
+
18
+ #include "aqo.h"
11
19
12
20
static double get_mean (double * elems , int nelems );
13
21
static double get_estimation (double * elems , int nelems );
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* CARDINALITY ESTIMATION
6
5
*
7
6
* This is the module in which cardinality estimation problem obtained from
8
7
* cardinality_hooks turns into machine learning problem.
9
8
*
10
- *****************************************************************************/
9
+ *******************************************************************************
10
+ *
11
+ * Copyright (c) 2016-2020, Postgres Professional
12
+ *
13
+ * IDENTIFICATION
14
+ * aqo/cardinality_estimation.c
15
+ *
16
+ */
17
+
18
+ #include "aqo.h"
11
19
12
20
/*
13
21
* General method for prediction the cardinality of given relation.
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* CARDINALITY ESTIMATION HOOKS
6
5
*
17
16
* refusal to predict cardinality. In this case hooks also use default
18
17
* postgreSQL cardinality estimator.
19
18
*
20
- *****************************************************************************/
19
+ *******************************************************************************
20
+ *
21
+ * Copyright (c) 2016-2020, Postgres Professional
22
+ *
23
+ * IDENTIFICATION
24
+ * aqo/cardinality_hooks.c
25
+ *
26
+ */
27
+
28
+ #include "aqo.h"
21
29
22
30
static void call_default_set_baserel_rows_estimate (PlannerInfo * root ,
23
31
RelOptInfo * rel );
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* HASH FUNCTIONS
6
5
*
11
10
* only in the values of their constants. We want query_hash, clause_hash and
12
11
* fss_hash to satisfy this property.
13
12
*
14
- *****************************************************************************/
13
+ *******************************************************************************
14
+ *
15
+ * Copyright (c) 2016-2020, Postgres Professional
16
+ *
17
+ * IDENTIFICATION
18
+ * aqo/hash.c
19
+ *
20
+ */
21
+
22
+ #include "aqo.h"
15
23
16
24
static int get_str_hash (const char * str );
17
25
static int get_node_hash (Node * node );
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* MACHINE LEARNING TECHNIQUES
6
5
*
11
10
* setting after learning procedure. This property also allows to adapt to
12
11
* workloads which properties are slowly changed.
13
12
*
14
- *****************************************************************************/
13
+ *******************************************************************************
14
+ *
15
+ * Copyright (c) 2016-2020, Postgres Professional
16
+ *
17
+ * IDENTIFICATION
18
+ * aqo/machine_learning.c
19
+ *
20
+ */
21
+
22
+ #include "aqo.h"
15
23
16
24
static double fs_distance (double * a , double * b , int len );
17
25
static double fs_similarity (double dist );
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* EXTRACTING PATH INFORMATION UTILITIES
6
5
*
7
- *****************************************************************************/
6
+ *******************************************************************************
7
+ *
8
+ * Copyright (c) 2016-2020, Postgres Professional
9
+ *
10
+ * IDENTIFICATION
11
+ * aqo/path_utils.c
12
+ *
13
+ */
14
+
15
+ #include "aqo.h"
8
16
9
17
/*
10
18
* Returns list of marginal selectivities using as an arguments for each clause
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
- #include "utils/queryenvironment.h"
3
-
4
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
5
3
*
6
4
* QUERY EXECUTION STATISTICS COLLECTING UTILITIES
7
5
*
8
6
* The module which updates data in the feature space linked with executed query
9
7
* type using obtained query execution statistics.
10
8
* Works only if aqo_learn is on.
11
9
*
12
- *****************************************************************************/
10
+ *******************************************************************************
11
+ *
12
+ * Copyright (c) 2016-2020, Postgres Professional
13
+ *
14
+ * IDENTIFICATION
15
+ * aqo/postprocessing.c
16
+ *
17
+ */
18
+
19
+ #include "aqo.h"
20
+ #include "utils/queryenvironment.h"
13
21
14
22
static double cardinality_sum_errors ;
15
23
static int cardinality_num_objects ;
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
- #include "access/parallel.h"
3
-
4
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
5
3
*
6
4
* QUERY PREPROCESSING HOOKS
7
5
*
49
47
* 4. For given fspace_hash we may use its machine learning settings, but now
50
48
* the machine learning setting are fixed for all feature spaces.
51
49
*
52
- *****************************************************************************/
50
+ *******************************************************************************
51
+ *
52
+ * Copyright (c) 2016-2020, Postgres Professional
53
+ *
54
+ * IDENTIFICATION
55
+ * aqo/preprocessing.c
56
+ *
57
+ */
58
+
59
+ #include "aqo.h"
60
+ #include "access/parallel.h"
53
61
54
62
#define CREATE_EXTENSION_STARTSTRING_0 \
55
63
"-- complain if script is sourced in psql, rather than via CREATE EXTENSION"
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* SELECTIVITY CACHE
6
5
*
7
6
* Stores the clause selectivity with the given relids for parametrized
8
7
* clauses, because otherwise it cannot be restored after query execution
9
8
* without PlannerInfo.
10
9
*
11
- *****************************************************************************/
10
+ *******************************************************************************
11
+ *
12
+ * Copyright (c) 2016-2020, Postgres Professional
13
+ *
14
+ * IDENTIFICATION
15
+ * aqo/selectivity_cache.c
16
+ *
17
+ */
18
+
19
+ #include "aqo.h"
12
20
13
21
typedef struct
14
22
{
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* STORAGE INTERACTION
6
5
*
7
6
* This module is responsible for interaction with the storage of AQO data.
8
7
* It does not provide information protection from concurrent updates.
9
8
*
10
- *****************************************************************************/
9
+ *******************************************************************************
10
+ *
11
+ * Copyright (c) 2016-2020, Postgres Professional
12
+ *
13
+ * IDENTIFICATION
14
+ * aqo/storage.c
15
+ *
16
+ */
17
+
18
+ #include "aqo.h"
11
19
12
20
HTAB * deactivated_queries = NULL ;
13
21
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
-
3
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
4
3
*
5
4
* UTILITIES
6
5
*
7
- *****************************************************************************/
6
+ *******************************************************************************
7
+ *
8
+ * Copyright (c) 2016-2020, Postgres Professional
9
+ *
10
+ * IDENTIFICATION
11
+ * aqo/utils.c
12
+ *
13
+ */
14
+
15
+ #include "aqo.h"
8
16
9
17
/* TODO: get rid of those static vars */
10
18
static void * argsort_a ;
You can’t perform that action at this time.
0 commit comments