8000 Remove an ignored node detection feature. · postgrespro/aqo@df901da · GitHub
[go: up one dir, main page]

Skip to content

Commit df901da

Browse files
committed
Remove an ignored node detection feature.
1 parent 892713f commit df901da

File tree

9 files changed

+2
-309
lines changed

9 files changed

+2
-309
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PGFILEDESC = "AQO - Adaptive Query Optimization"
66
MODULE_big = aqo
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 \
9-
selectivity_cache.o storage.o utils.o ignorance.o $(WIN32RES)
9+
selectivity_cache.o storage.o utils.o $(WIN32RES)
1010

1111
TAP_TESTS = 1
1212

aqo.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
#include "aqo.h"
12-
#include "ignorance.h"
1312

1413
#include "access/relation.h"
1514
#include "access/table.h"
@@ -188,19 +187,6 @@ _PG_init(void)
188187
NULL
189188
);
190189

191-
DefineCustomBoolVariable(
192-
"aqo.log_ignorance",
193-
"Log in a special table all feature spaces for which the AQO prediction was not successful.",
194-
NULL,
195-
&aqo_log_ignorance,
196-
false,
197-
PGC_SUSET,
198-
0,
199-
NULL,
200-
set_ignorance,
201-
NULL
202-
);
203-
204190
prev_planner_hook = planner_hook;
205191
planner_hook = aqo_planner;
206192
prev_post_parse_analyze_hook = post_parse_analyze_hook;

expected/gucs.out

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -29,61 +29,3 @@ EXPLAIN (ANALYZE, VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF)
2929
(6 rows)
3030

3131
DROP EXTENSION aqo;
32-
SET aqo.log_ignorance = 'on';
33-
SET aqo.log_ignorance = 'off';
34-
SET aqo.log_ignorance = 'off';
35-
SET aqo.log_ignorance = 'on';
36-
CREATE EXTENSION aqo;
37-
SET aqo.log_ignorance = 'off';
38-
SET aqo.log_ignorance = 'on';
39-
SET aqo.log_ignorance = 'on';
40-
\d aqo_ignorance
41-
Table "public.aqo_ignorance"
42-
Column | Type | Collation | Nullable | Default
43-
-----------+---------+-----------+----------+---------
44-
qhash | integer | | |
45-
fhash | integer | | |
46-
fss_hash | integer | | |
47-
node_type | integer | | |
48-
node | text | | |
49-
Indexes:
50-
"aqo_ignorance_idx" UNIQUE, btree (qhash, fhash, fss_hash)
51-
52-
EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF)
53-
SELECT * FROM t;
54-
QUERY PLAN
55-
-----------------------------------------
56-
Seq Scan on t (actual rows=100 loops=1)
57-
AQO not used
58-
Using aqo: true
59-
AQO mode: LEARN
60-
JOINS: 0
61-
(5 rows)
62-
63-
SELECT node_type FROM aqo_ignorance;
64-
node_type
65-
-----------
66-
(0 rows)
67-
68-
EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT * FROM t;
69-
QUERY PLAN
70-
-----------------------------------------
71-
Seq Scan on t (actual rows=100 loops=1)
72-
AQO: rows=100, error=0%
73-
Using aqo: true
74-
AQO mode: LEARN
75-
JOINS: 0
76-
(5 rows)
77-
78-
SELECT node_type FROM aqo_ignorance;
79-
node_type
80-
-----------
81-
(0 rows)
82-
83-
-- This GUC can be changed by an admin only.
84-
CREATE ROLE noadmin;
85-
SET ROLE noadmin;
86-
SET aqo.log_ignorance = 'off';
87-
ERROR: permission denied to set parameter "aqo.log_ignorance"
88-
RESET ROLE;
89-
DROP EXTENSION aqo;

ignorance.c

Lines changed: 0 additions & 184 deletions
This file was deleted.

ignorance.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

postprocessing.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
#include "aqo.h"
20-
#include "ignorance.h"
2120

2221
#include "access/parallel.h"
2322
#include "optimizer/optimizer.h"
@@ -115,16 +114,6 @@ learn_sample(List *clauselist, List *selectivities, List *relidslist,
115114
fss_hash = get_fss_for_object(clauselist, selectivities, relidslist,
116115
&nfeatures, &features);
117116

118-
if (aqo_log_ignorance && plan->predicted_cardinality <= 0 &&
119-
load_fss(fhash, fss_hash, 0, NULL, NULL, NULL) )
120-
{
121-
/*
122-
* If ignorance logging is enabled and the feature space was existed in
123-
* the ML knowledge base, log this issue.
124-
*/
125-
update_ignorance(query_context.query_hash, fhash, fss_hash, plan);
126-
}
127-
128117
if (nfeatures > 0)
129118
for (i = 0; i < aqo_K; ++i)
130119
matrix[i] = palloc(sizeof(double) * nfeatures);

preprocessing.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ IsAQORelation(Relation rel)
366366
if (strcmp(relname, "aqo_data") == 0 ||
367367
strcmp(relname, "aqo_query_texts") == 0 ||
368368
strcmp(relname, "aqo_query_stat") == 0 ||
369-
strcmp(relname, "aqo_queries") == 0 ||
370-
strcmp(relname, "aqo_ignorance") == 0
369+
strcmp(relname, "aqo_queries") == 0
371370
)
372371
return true;
373372

sql/gucs.sql

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,3 @@ EXPLAIN (ANALYZE, VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF)
1212
SELECT x FROM t;
1313

1414
DROP EXTENSION aqo;
15-
16-
SET aqo.log_ignorance = 'on';
17-
SET aqo.log_ignorance = 'off';
18-
SET aqo.log_ignorance = 'off';
19-
SET aqo.log_ignorance = 'on';
20-
21-
CREATE EXTENSION aqo;
22-
SET aqo.log_ignorance = 'off';
23-
SET aqo.log_ignorance = 'on';
24-
SET aqo.log_ignorance = 'on';
25-
\d aqo_ignorance
26-
27-
EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF)
28-
SELECT * FROM t;
29-
SELECT node_type FROM aqo_ignorance;
30-
31-
EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT * FROM t;
< AA8D /td>
32-
SELECT node_type FROM aqo_ignorance;
33-
34-
-- This GUC can be changed by an admin only.
35-
CREATE ROLE noadmin;
36-
SET ROLE noadmin;
37-
SET aqo.log_ignorance = 'off';
38-
RESET ROLE;
39-
40-
DROP EXTENSION aqo;

t/001_pgbench.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
shared_preload_libraries = 'aqo'
1111
log_statement = 'none'
1212
aqo.mode = 'intelligent'
13-
aqo.log_ignorance = 'on'
1413
});
1514

1615
$node->start();

0 commit comments

Comments
 (0)
0