8000 Merge commit '27fbf0fddbeded5b114a48fd609c5bb9707a9e3d' into PGPROEE9… · postgrespro/aqo@952a3c5 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 952a3c5

Browse files
committed
Merge commit '27fbf0fddbeded5b114a48fd609c5bb9707a9e3d' into PGPROEE9_6_DEV_PGPRO-2315
2 parents 6797db3 + 27fbf0f commit 952a3c5

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

expected/schema.out

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,26 @@ SELECT * FROM test;
2121
1 | string
2222
(1 row)
2323

24-
SELECT * FROM public.aqo_query_texts;
25-
query_hash | query_text
26-
------------+--------------------------------------------
27-
0 | COMMON feature space (do not delete!)
28-
1136691690 | INSERT INTO test (data) VALUES ('string');
29-
868705076 | SELECT * FROM test;
30-
826229959 | SELECT * FROM public.aqo_query_texts;
24+
-- Check AQO service relations state after some manipulations
25+
-- Exclude fields with hash values from the queries. Hash is depend on
26+
-- nodefuncs code which is highly PostgreSQL version specific.
27+
SELECT query_text FROM public.aqo_query_texts;
28+
query_text
29+
------------------------------------------------
30+
COMMON feature space (do not delete!)
31+
INSERT INTO test (data) VALUES ('string');
32+
SELECT * FROM test;
33+
SELECT query_text FROM public.aqo_query_texts;
3134
(4 rows)
3235

33-
SELECT * FROM public.aqo_queries;
34-
query_hash | learn_aqo | use_aqo | fspace_hash | auto_tuning
35-
------------+-----------+---------+-------------+-------------
36-
0 | f | f | 0 | f
37-
1136691690 | t | f | 1136691690 | t
38-
868705076 | t | f | 868705076 | t
39-
826229959 | t | f | 826229959 | t
40-
2145866904 | t | f | 2145866904 | t
36+
SELECT learn_aqo, use_aqo, auto_tuning FROM public.aqo_queries;
37+
learn_aqo | use_aqo | auto_tuning
38+
-----------+---------+-------------
39+
f | f | f
40+
t | f | t
41+
t | f | t
42+
t | f | t
43+
t | f | t
4144
(5 rows)
4245

4346
DROP SCHEMA IF EXISTS test1 CASCADE;

preprocessing.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ aqo_planner(Query *parse,
122122
strlen(CREATE_EXTENSION_STARTSTRING_0)) == 0 ||
123123
strncmp(query_text, CREATE_EXTENSION_STARTSTRING_1,
124124
strlen(CREATE_EXTENSION_STARTSTRING_1)) == 0 ||
125+
IsInParallelMode() ||
125126
aqo_mode == AQO_MODE_DISABLED || isQueryUsingSystemRelation(parse))
126127
{
127128
disable_aqo_for_query();

sql/schema.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ SET aqo.mode = 'intelligent';
1515

1616
CREATE TABLE test (id SERIAL, data TEXT);
1717
INSERT INTO test (data) VALUES ('string');
18-
1918
SELECT * FROM test;
20-
SELECT * FROM public.aqo_query_texts;
21-
SELECT * FROM public.aqo_queries;
19+
20+
-- Check AQO service relations state after some manipulations
21+
-- Exclude fields with hash values from the queries. Hash is depend on
22+
-- nodefuncs code which is highly PostgreSQL version specific.
23+
SELECT query_text FROM public.aqo_query_texts;
24+
SELECT learn_aqo, use_aqo, auto_tuning FROM public.aqo_queries;
25+
2226
DROP SCHEMA IF EXISTS test1 CASCADE;

storage.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ add_query(int query_hash, bool learn_aqo, bool use_aqo,
146146
{
147147
CommandCounterIncrement();
148148
simple_heap_delete(aqo_queries_heap, &(tuple->t_self));
149+
PG_RE_THROW();
149150
}
150151
PG_END_TRY();
151152

@@ -289,6 +290,7 @@ add_query_text(int query_hash, const char *query_text)
289290
{
290291
CommandCounterIncrement();
291292
simple_heap_delete(aqo_query_texts_heap, &(tuple->t_self));
293+
PG_RE_THROW();
292294
}
293295
PG_END_TRY();
294296

@@ -480,6 +482,7 @@ update_fss(int fss_hash, int nrows, int ncols,
480482
{
481483
CommandCounterIncrement();
482484
simple_heap_delete(aqo_data_heap, &(tuple->t_self));
485+
PG_RE_THROW();
483486
}
484487
PG_END_TRY();
485488
}
@@ -676,6 +679,7 @@ update_aqo_stat(int query_hash, QueryStat *stat)
676679
{
677680
CommandCounterIncrement();
678681
simple_heap_delete(aqo_stat_heap, &(tuple->t_self));
682+
PG_RE_THROW();
679683
}
680684
PG_END_TRY();
681685
}

0 commit comments

Comments
 (0)
0