|
| 1 | +-- Create the extension. Drop all lumps which could survive from |
| 2 | +-- previous pass (repeated installcheck as an example). |
| 3 | +CREATE EXTENSION IF NOT EXISTS aqo; |
| 4 | +SELECT true AS success FROM aqo_reset(); |
| 5 | + success |
| 6 | +--------- |
| 7 | + t |
| 8 | +(1 row) |
| 9 | + |
1 | 10 | CREATE TABLE aqo_test0(a int, b int, c int, d int); |
2 | 11 | WITH RECURSIVE t(a, b, c, d) |
3 | 12 | AS ( |
|
16 | 25 | ) INSERT INTO aqo_test1 (SELECT * FROM t); |
17 | 26 | CREATE INDEX aqo_test1_idx_a ON aqo_test1 (a); |
18 | 27 | ANALYZE aqo_test1; |
19 | | -CREATE EXTENSION aqo; |
20 | | -SET aqo.join_threshold = 0; |
21 | 28 | SET aqo.mode = 'controlled'; |
22 | 29 | CREATE TABLE tmp1 AS SELECT * FROM aqo_test0 |
23 | 30 | WHERE a < 3 AND b < 3 AND c < 3 AND d < 3; |
@@ -151,11 +158,12 @@ SELECT count(*) FROM aqo_queries WHERE queryid <> fs; -- Should be zero |
151 | 158 | SET aqo.mode = 'controlled'; |
152 | 159 | SELECT count(*) FROM |
153 | 160 | (SELECT queryid AS id FROM aqo_queries) AS q1, |
154 | | - LATERAL aqo_queries_update(q1.id, NULL, true, true, false) |
| 161 | + LATERAL aqo_queries_update(q1.id, NULL, true, true, false) AS ret |
| 162 | +WHERE NOT ret |
155 | 163 | ; -- Enable all disabled query classes |
156 | 164 | count |
157 | 165 | ------- |
158 | | - 5 |
| 166 | + 1 |
159 | 167 | (1 row) |
160 | 168 |
|
161 | 169 | EXPLAIN SELECT * FROM aqo_test0 |
@@ -223,15 +231,8 @@ SELECT count(*) FROM aqo_queries WHERE queryid <> fs; -- Should be zero |
223 | 231 | 0 |
224 | 232 | (1 row) |
225 | 233 |
|
226 | | --- XXX: extension dropping doesn't clear file storage. Do it manually. |
227 | | -SELECT 1 FROM aqo_reset(); |
228 | | - ?column? |
229 | | ----------- |
230 | | - 1 |
231 | | -(1 row) |
232 | | - |
233 | | -DROP EXTENSION aqo; |
234 | 234 | DROP INDEX aqo_test0_idx_a; |
235 | 235 | DROP TABLE aqo_test0; |
236 | 236 | DROP INDEX aqo_test1_idx_a; |
237 | 237 | DROP TABLE aqo_test1; |
| 238 | +DROP EXTENSION aqo; |
0 commit comments