@@ -35,6 +35,7 @@ SET statement_timeout = 80; -- [0.1s]
35
35
SELECT *, pg_sleep(0.1) FROM t;
36
36
NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
37
37
ERROR: canceling statement due to statement timeout
38
+ RESET statement_timeout;
38
39
SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;'); -- haven't any partial data
39
40
check_estimated_rows
40
41
----------------------
@@ -46,6 +47,7 @@ SET statement_timeout = 350;
46
47
SELECT *, pg_sleep(0.1) FROM t;
47
48
NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
48
49
ERROR: canceling statement due to statement timeout
50
+ RESET statement_timeout;
49
51
SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
50
52
check_estimated_rows
51
53
----------------------
@@ -64,6 +66,7 @@ SELECT *, pg_sleep(0.1) FROM t;
64
66
5 |
65
67
(5 rows)
66
68
69
+ RESET statement_timeout;
67
70
SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
68
71
check_estimated_rows
69
72
----------------------
@@ -84,6 +87,7 @@ SET statement_timeout = 80;
84
87
SELECT *, pg_sleep(0.1) FROM t; -- Not learned
85
88
NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
86
89
ERROR: canceling statement due to statement timeout
90
+ RESET statement_timeout;
87
91
SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
88
92
check_estimated_rows
89
93
----------------------
@@ -94,6 +98,7 @@ SET statement_timeout = 350;
94
98
SELECT *, pg_sleep(0.1) FROM t; -- Learn!
95
99
NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
96
100
ERROR: canceling statement due to statement timeout
101
+ RESET statement_timeout;
97
102
SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
98
103
check_estimated_rows
99
104
----------------------
@@ -111,6 +116,7 @@ SELECT *, pg_sleep(0.1) FROM t; -- Get reliable data
111
116
5 |
112
117
(5 rows)
113
118
119
+ RESET statement_timeout;
114
120
SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
115
121
check_estimated_rows
116
122
----------------------
@@ -134,18 +140,19 @@ SELECT count(*) FROM aqo_data; -- Must be zero
134
140
SELECT x, pg_sleep(0.1) FROM t WHERE x > 0;
135
141
NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
136
142
ERROR: canceling statement due to statement timeout
143
+ RESET statement_timeout;
137
144
SELECT count(*) FROM aqo_data; -- Must be one
138
145
count
139
146
-------
140
147
1
141
148
(1 row)
142
149
150
+ DROP TABLE t;
151
+ DROP FUNCTION check_estimated_rows;
143
152
SELECT true AS success FROM aqo_reset();
144
153
success
145
154
---------
146
155
t
147
156
(1 row)
148
157
149
- DROP TABLE t;
150
158
DROP EXTENSION aqo;
151
- DROP FUNCTION check_estimated_rows;
0 commit comments