Skip to content

Commit 86796f0

Browse files
committed
Second stage of arrangement with stable15
1 parent 7e953d2 commit 86796f0

10 files changed

+16
-18
lines changed

aqo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void _PG_init(void);
3737
#define AQO_MODULE_MAGIC (1234)
3838

3939
/* Strategy of determining feature space for new queries. */
40-
int aqo_mode;
40+
int aqo_mode = AQO_MODE_CONTROLLED;
4141
bool force_collect_stat;
4242

4343
/*

aqo_shared.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ shmem_startup_hook_type prev_shmem_startup_hook = NULL;
2626
AQOSharedState *aqo_state = NULL;
2727
HTAB *fss_htab = NULL;
2828
static int aqo_htab_max_items = 1000;
29-
int fs_max_items = 1; /* Max number of different feature spaces in ML model */
30-
int fss_max_items = 1; /* Max number of different feature subspaces in ML model */
29+
int fs_max_items = 10000; /* Max number of different feature spaces in ML model */
30+
int fss_max_items = 100000; /* Max number of different feature subspaces in ML model */
3131
static uint32 temp_storage_size = 1024 * 1024 * 10; /* Storage size, in bytes */
3232
static dsm_segment *seg = NULL;
3333

expected/relocatable.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ ORDER BY (learn_aqo, use_aqo, auto_tuning);
114114
t | t | f
115115
(3 rows)
116116

117+
RESET search_path;
117118
DROP TABLE test CASCADE;
118119
DROP SCHEMA IF EXISTS test CASCADE;
119120
NOTICE: drop cascades to extension aqo
120121
DROP EXTENSION IF EXISTS aqo CASCADE;
121122
NOTICE: extension "aqo" does not exist, skipping
122-
RESET search_path;

expected/statement_timeout.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ SELECT check_estimated_rows('SELECT *, pg_sleep(1) FROM t;');
111111
5
112112
(1 row)
113113

114-
DROP TABLE t;
115114
SELECT 1 FROM aqo_reset();
116115
?column?
117116
----------
118117
1
119118
(1 row)
120119

120+
DROP TABLE t;
121121
DROP EXTENSION aqo;
122122
DROP FUNCTION check_estimated_rows;

expected/unsupported.out

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ EXPLAIN (COSTS OFF)
4343
(11 rows)
4444

4545
SELECT str FROM expln('
46-
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
47-
SELECT * FROM t GROUP BY (x) HAVING x > 3;
46+
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
47+
SELECT * FROM t GROUP BY (x) HAVING x > 3;
4848
') AS str WHERE str NOT LIKE '%Memory Usage%';
4949
str
5050
-----------------------------------------------
@@ -586,10 +586,6 @@ ORDER BY (md5(query_text),error) DESC;
586586
| SELECT count(*) FROM t WHERE +
587587
| x = (SELECT avg(x) FROM t t0 WHERE t0.x = t.x + 21) OR +
588588
| x IN (SELECT avg(x) FROM t t0 WHERE t0.x = t.x + 21);
589-
0.106 | +
590-
| EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) +
591-
| SELECT * FROM t GROUP BY (x) HAVING x > 3; +
592-
|
593589
0.454 | SELECT count(*) FROM (SELECT x, y FROM t1 GROUP BY GROUPING SETS ((x,y), (x), (y), ())) AS q1;
594590
0.000 | SELECT count(*) FROM ( +
595591
| SELECT count(*) AS x FROM ( +
@@ -602,6 +598,10 @@ ORDER BY (md5(query_text),error) DESC;
602598
0.000 | EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) +
603599
| SELECT count(*) FROM t WHERE (SELECT avg(x) FROM t t0 WHERE t0.x = t.x) = +
604600
| (SELECT avg(x) FROM t t0 WHERE t0.x = t.x);
601+
0.106 | +
602+
| EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) +
603+
| SELECT * FROM t GROUP BY (x) HAVING x > 3; +
604+
|
605605
0.000 | SELECT count(*) FROM +
606606
| (SELECT * FROM t WHERE x % 3 < (SELECT avg(x) FROM t t0 WHERE t0.x = t.x)) AS q1 +
607607
| JOIN +

postprocessing.c

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#include "postgres.h"
2020

21-
#include "aqo.h"
22-
2321
#include "access/parallel.h"
2422
#include "optimizer/optimizer.h"
2523
#include "postgres_fdw.h"

preprocessing.c

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
#include "preprocessing.h"
6868
#include "storage.h"
6969

70-
7170
/* List of feature spaces, that are processing in this backend. */
7271
List *cur_classes = NIL;
7372

sql/relocatable.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ SELECT aqo_enable_query(id) FROM (
4848
SELECT learn_aqo, use_aqo, auto_tuning FROM test.aqo_queries
4949
ORDER BY (learn_aqo, use_aqo, auto_tuning);
5050

51+
RESET search_path;
5152
DROP TABLE test CASCADE;
5253
DROP SCHEMA IF EXISTS test CASCADE;
5354
DROP EXTENSION IF EXISTS aqo CASCADE;
54-
RESET search_path;

sql/statement_timeout.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ SET statement_timeout = 5500;
6060
SELECT *, pg_sleep(1) FROM t; -- Get reliable data
6161
SELECT check_estimated_rows('SELECT *, pg_sleep(1) FROM t;');
6262

63-
DROP TABLE t;
6463
SELECT 1 FROM aqo_reset();
64+
DROP TABLE t;
6565
DROP EXTENSION aqo;
6666
DROP FUNCTION check_estimated_rows;

sql/unsupported.sql

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ ANALYZE t, t1;
2727
SELECT count(*) FROM (SELECT * FROM t GROUP BY (x) HAVING x > 3) AS q1;
2828
EXPLAIN (COSTS OFF)
2929
SELECT count(*) FROM (SELECT * FROM t GROUP BY (x) HAVING x > 3) AS q1;
30+
3031
SELECT str FROM expln('
31-
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
32-
SELECT * FROM t GROUP BY (x) HAVING x > 3;
32+
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF)
33+
SELECT * FROM t GROUP BY (x) HAVING x > 3;
3334
') AS str WHERE str NOT LIKE '%Memory Usage%';
3435

3536
--

0 commit comments

Comments
 (0)