File tree 13 files changed +156
-57
lines changed 13 files changed +156
-57
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-2020, 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
/*
13
21
* Auto tuning criteria criteria of an query convergence by overall cardinality
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
- #include "optimizer/optimizer.h"
3
-
4
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
5
3
*
6
4
* CARDINALITY ESTIMATION
7
5
*
8
6
* This is the module in which cardinality estimation problem obtained from
9
7
* cardinality_hooks turns into machine learning problem.
10
8
*
11
- *****************************************************************************/
9
+ *******************************************************************************
10
+ *
11
+ * Copyright (c) 2016-2020, Postgres Professional
12
+ *
13
+ * IDENTIFICATION
14
+ * aqo/cardinality_estimation.c
15
+ *
16
+ */
17
+
18
+ #include "aqo.h"
19
+ #include "optimizer/optimizer.h"
12
20
13
21
/*
14
22
* 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
double predicted_ppi_rows ;
23
31
double fss_ppi_hash ;
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
- #include "optimizer/optimizer.h"
3
-
4
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
5
3
*
6
4
* EXTRACTING PATH INFORMATION UTILITIES
7
5
*
8
- *****************************************************************************/
6
+ *******************************************************************************
7
+ *
8
+ * Copyright (c) 2016-2020, Postgres Professional
9
+ *
10
+ * IDENTIFICATION
11
+ * aqo/path_utils.c
12
+ *
13
+ */
14
+
15
+ #include "aqo.h"
16
+ #include "optimizer/optimizer.h"
9
17
10
18
/*
11
19
* 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 "access/parallel.h"
3
- #include "optimizer/optimizer.h"
4
- #include "utils/queryenvironment.h"
5
-
6
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
7
3
*
8
4
* QUERY EXECUTION STATISTICS COLLECTING UTILITIES
9
5
*
10
6
* The module which updates data in the feature space linked with executed query
11
7
* type using obtained query execution statistics.
12
8
* Works only if aqo_learn is on.
13
9
*
14
- *****************************************************************************/
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 "access/parallel.h"
21
+ #include "optimizer/optimizer.h"
22
+ #include "utils/queryenvironment.h"
15
23
16
24
typedef struct
17
25
{
Original file line number Diff line number Diff line change 1
- #include "aqo.h"
2
- #include "access/parallel.h"
3
- #include "access/table.h"
4
- #include "commands/extension.h"
5
-
6
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
7
3
*
8
4
* QUERY PREPROCESSING HOOKS
9
5
*
51
47
* 4. For given fspace_hash we may use its machine learning settings, but now
52
48
* the machine learning setting are fixed for all feature spaces.
53
49
*
54
- *****************************************************************************/
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"
61
+ #include "access/table.h"
62
+ #include "commands/extension.h"
55
63
56
64
static bool isQueryUsingSystemRelation (Query * query );
57
65
static bool isQueryUsingSystemRelation_walker (Node * node , void * context );
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
- #include "access/heapam.h"
4
- #include "access/table.h"
5
- #include "access/tableam.h"
6
-
7
- /*****************************************************************************
1
+ /*
2
+ *******************************************************************************
8
3
*
9
4
* STORAGE INTERACTION
10
5
*
11
6
* This module is responsible for interaction with the storage of AQO data.
12
7
* It does not provide information protection from concurrent updates.
13
8
*
14
- *****************************************************************************/
9
+ *******************************************************************************
10
+ *
11
+ * Copyright (c) 2016-2020, Postgres Professional
12
+ *
13
+ * IDENTIFICATION
14
+ * aqo/storage.c
15
+ *
16
+ */
17
+
18
+ #include "aqo.h"
19
+
20
+ #include "access/heapam.h"
21
+ #include "access/table.h"
22
+ #include "access/tableam.h"
15
23
16
24
HTAB * deactivated_queries = NULL ;
17
25
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