@@ -35,6 +35,7 @@ SET statement_timeout = 80; -- [0.1s]
3535SELECT *, pg_sleep(0.1) FROM t;
3636NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
3737ERROR: canceling statement due to statement timeout
38+ RESET statement_timeout;
3839SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;'); -- haven't any partial data
3940 check_estimated_rows
4041----------------------
@@ -46,6 +47,7 @@ SET statement_timeout = 350;
4647SELECT *, pg_sleep(0.1) FROM t;
4748NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
4849ERROR: canceling statement due to statement timeout
50+ RESET statement_timeout;
4951SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
5052 check_estimated_rows
5153----------------------
@@ -64,6 +66,7 @@ SELECT *, pg_sleep(0.1) FROM t;
6466 5 |
6567(5 rows)
6668
69+ RESET statement_timeout;
6770SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
6871 check_estimated_rows
6972----------------------
@@ -84,6 +87,7 @@ SET statement_timeout = 80;
8487SELECT *, pg_sleep(0.1) FROM t; -- Not learned
8588NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
8689ERROR: canceling statement due to statement timeout
90+ RESET statement_timeout;
8791SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
8892 check_estimated_rows
8993----------------------
@@ -94,6 +98,7 @@ SET statement_timeout = 350;
9498SELECT *, pg_sleep(0.1) FROM t; -- Learn!
9599NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
96100ERROR: canceling statement due to statement timeout
101+ RESET statement_timeout;
97102SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
98103 check_estimated_rows
99104----------------------
@@ -111,6 +116,7 @@ SELECT *, pg_sleep(0.1) FROM t; -- Get reliable data
111116 5 |
112117(5 rows)
113118
119+ RESET statement_timeout;
114120SELECT check_estimated_rows('SELECT *, pg_sleep(0.1) FROM t;');
115121 check_estimated_rows
116122----------------------
@@ -134,18 +140,19 @@ SELECT count(*) FROM aqo_data; -- Must be zero
134140SELECT x, pg_sleep(0.1) FROM t WHERE x > 0;
135141NOTICE: [AQO] Time limit for execution of the statement was expired. AQO tried to learn on partial data.
136142ERROR: canceling statement due to statement timeout
143+ RESET statement_timeout;
137144SELECT count(*) FROM aqo_data; -- Must be one
138145 count
139146-------
140147 1
141148(1 row)
142149
150+ DROP TABLE t;
151+ DROP FUNCTION check_estimated_rows;
143152SELECT true AS success FROM aqo_reset();
144153 success
145154---------
146155 t
147156(1 row)
148157
149- DROP TABLE t;
150158DROP EXTENSION aqo;
151- DROP FUNCTION check_estimated_rows;
0 commit comments