Skip to content

Commit 330a60f

Browse files
author
Oleg Ivanov
committed
Renamed manual mode into controlled mode
1 parent bf3526a commit 330a60f

13 files changed

+23
-22
lines changed

contrib/aqo/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ DATA = aqo--1.0.sql
77
OBJS = aqo.o auto_tuning.o cardinality_estimation.o cardinality_hooks.o \
88
hash.o machine_learning.o path_utils.o postprocessing.o preprocessing.o \
99
selectivity_cache.o storage.o utils.o $(WIN32RES)
10-
REGRESS = aqo_disabled aqo_manual aqo_intelligent aqo_forced
10+
REGRESS = aqo_disabled aqo_controlled aqo_intelligent aqo_forced
1111

1212
MODULE_big = aqo
1313
ifdef USE_PGXS

contrib/aqo/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ of per-connection.
2121
## Usage
2222

2323
Note that the extension works bad with dynamically generated views. If they
24-
appear in workload, please use "aqo.mode='manual'".
24+
appear in workload, please use "aqo.mode='controlled'".
2525

2626
This extension has intelligent self-tuning mode. If you want to rely completely
2727
on it, just add line "aqo.mode = 'intelligent'" into your postgresql.conf.
@@ -36,8 +36,8 @@ For handling workloads with dynamically generated query structures the forced
3636
mode "aqo.mode = 'forced'" is provided. We cannot guarantee performance
3737
improvement with this mode, but you may try it nevertheless.
3838

39-
If you want to completely control how PostgreSQL optimizes queries, use manual
40-
mode "aqo.mode = 'manual'" and
39+
If you want to completely control how PostgreSQL optimizes queries, use controlled
40+
mode "aqo.mode = 'controlled'" and
4141
contrib/aqo/learn_queries.sh file_with_sql_queries.sql "psql -d YOUR_DATABASE"
4242
where file_with_sql_queries.sql is a textfile with queries on which AQO is
4343
supposed to learn. Please use only SELECT queries file_with_sql_queries.sql.

contrib/aqo/aqo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int aqo_mode;
1212
static const struct config_enum_entry format_options[] = {
1313
{"intelligent", AQO_MODE_INTELLIGENT, false},
1414
{"forced", AQO_MODE_FORCED, false},
15-
{"manual", AQO_MODE_MANUAL, false},
15+
{"controlled", AQO_MODE_CONTROLLED, false},
1616
{"disabled", AQO_MODE_DISABLED, false},
1717
{NULL, 0, false}
1818
};
@@ -74,7 +74,7 @@ _PG_init(void)
7474
"Mode of aqo usage.",
7575
NULL,
7676
&aqo_mode,
77-
AQO_MODE_MANUAL,
77+
AQO_MODE_CONTROLLED,
7878
format_options,
7979
PGC_SUSET,
8080
0,

contrib/aqo/aqo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* "forced" mode makes no difference between query types and use AQO for them
3535
* all in the similar way. It considers each new query type as linked to special
3636
* feature space called COMMON with hash 0.
37-
* "manual" mode ignores unknown query types. In this case AQO is completely
37+
* "Controlled" mode ignores unknown query types. In this case AQO is completely
3838
* configured manually by user.
3939
* Current mode is stored in aqo.mode variable.
4040
*
@@ -148,7 +148,7 @@ typedef enum
148148
/* Treats new query types as linked to the common feature space */
149149
AQO_MODE_FORCED,
150150
/* New query types are not linked with any feature space */
151-
AQO_MODE_MANUAL,
151+
AQO_MODE_CONTROLLED,
152152
/* Aqo is disabled for all queries */
153153
AQO_MODE_DISABLED,
154154
} AQO_MODE;

contrib/aqo/expected/aqo_manual.out renamed to contrib/aqo/expected/aqo_controlled.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ AS (
2626
CREATE INDEX aqo_test2_idx_a ON aqo_test2 (a);
2727
ANALYZE aqo_test2;
2828
CREATE EXTENSION aqo;
29-
SET aqo.mode = 'manual';
29+
SET aqo.mode = 'controlled';
3030
EXPLAIN (COSTS FALSE)
3131
SELECT * FROM aqo_test0
3232
WHERE a < 3 AND b < 3 AND c < 3 AND d < 3;
@@ -105,7 +105,7 @@ SELECT count(*) FROM tmp1;
105105
(1 row)
106106

107107
DROP TABLE tmp1;
108-
SET aqo.mode = 'manual';
108+
SET aqo.mode = 'controlled';
109109
UPDATE aqo_queries SET auto_tuning=false;
110110
UPDATE aqo_queries SET learn_aqo=true;
111111
UPDATE aqo_queries SET use_aqo=false;

contrib/aqo/expected/aqo_disabled.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ SELECT count(*) FROM tmp1;
8383
(1 row)
8484

8585
DROP TABLE tmp1;
86-
SET aqo.mode = 'manual';
86+
SET aqo.mode = 'controlled';
8787
UPDATE aqo_queries SET learn_aqo = true, use_aqo = true, auto_tuning = false;
8888
EXPLAIN SELECT * FROM aqo_test0
8989
WHERE a < 3 AND b < 3 AND c < 3 AND d < 3;

contrib/aqo/expected/aqo_forced.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AS (
1717
CREATE INDEX aqo_test1_idx_a ON aqo_test1 (a);
1818
ANALYZE aqo_test1;
1919
CREATE EXTENSION aqo;
20-
SET aqo.mode = 'manual';
20+
SET aqo.mode = 'controlled';
2121
EXPLAIN (COSTS FALSE)
2222
SELECT * FROM aqo_test0
2323
WHERE a < 3 AND b < 3 AND c < 3 AND d < 3;

contrib/aqo/expected/aqo_intelligent.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ SELECT count(*) FROM tmp1;
296296
(1 row)
297297

298298
DROP TABLE tmp1;
299-
SET aqo.mode = 'manual';
299+
SET aqo.mode = 'controlled';
300300
UPDATE aqo_queries SET learn_aqo = false, use_aqo = false, auto_tuning = false;
301301
EXPLAIN SELECT * FROM aqo_test0
302302
WHERE a < 3 AND b < 3 AND c < 3 AND d < 3;

contrib/aqo/preprocessing.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* typing strategy by changing hash function.
2727
* 2. New query type proceeding. The handling policy for new query types is
2828
* contained in variable 'aqo.mode'. It accepts three values:
29-
* "intelligent", "forced", and "manual".
29+
* "intelligent", "forced", "controlled" and "disabled".
3030
* Intelligent linking strategy means that for each new query type the new
3131
* separate feature space is created. The hash of new feature space is
3232
* set the same as the hash of new query type. Auto tuning is on by
@@ -35,10 +35,11 @@
3535
* Forced linking strategy means that every new query type is linked to
3636
* the common feature space with hash 0, but we don't memorize
3737
* the hash and the settings for this query.
38-
* Manual linking strategy means that new query types do not induce new
39-
* feature spaces neither interact AQO somehow. In this mode the
38+
* Controlled linking strategy means that new query types do not induce
39+
* new feature spaces neither interact AQO somehow. In this mode the
4040
* configuration of settings for different query types lies completely on
4141
* user.
42+
* Disabled strategy means that AQO is disabled for all queries.
4243
* 3. For given query type we determine its query_hash, use_aqo, learn_aqo,
4344
* fspace_hash and auto_tuning parameters.
4445
* 4. For given fspace_hash we may use its machine learning settings, but now
@@ -145,7 +146,7 @@ aqo_planner(Query *parse,
145146
fspace_hash = 0;
146147
collect_stat = false;
147148
break;
148-
case AQO_MODE_MANUAL:
149+
case AQO_MODE_CONTROLLED:
149150
adding_query = false;
150151
learn_aqo = false;
151152
use_aqo = false;

contrib/aqo/sql/aqo_manual.sql renamed to contrib/aqo/sql/aqo_controlled.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ANALYZE aqo_test2;
3030

3131
CREATE EXTENSION aqo;
3232

33-
SET aqo.mode = 'manual';
33+
SET aqo.mode = 'controlled';
3434

3535
EXPLAIN (COSTS FALSE)
3636
SELECT * FROM aqo_test0
@@ -75,7 +75,7 @@ WHERE t1.a = t2.b AND t2.a = t3.b AND t3.a = t4.b;
7575
SELECT count(*) FROM tmp1;
7676
DROP TABLE tmp1;
7777

78-
SET aqo.mode = 'manual';
78+
SET aqo.mode = 'controlled';
7979
UPDATE aqo_queries SET auto_tuning=false;
8080

8181
UPDATE aqo_queries SET learn_aqo=true;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy