Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit8615038

Browse files
committed
Bugfix. Do not try to open an AQO heap relation if an index does not exists.
1 parentf6bed7c commit8615038

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

‎aqo--1.2--1.3.sql‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BEGIN
2929
END LOOP;
3030
END IF;
3131

32-
FOR aqo_queries_rowIN (SELECT*FROM aqo_queries)
32+
FOR aqo_queries_rowIN (SELECT*FROMpublic.aqo_queries)
3333
LOOP
3434
IF (delete_row= trueAND fspace_hash_var<>0AND
3535
fspace_hash_var=aqo_queries_row.fspace_hashAND
@@ -103,7 +103,7 @@ BEGIN
103103
aqo_queries.query_hash,
104104
to_char(array_avg(execution_time_without_aqo),'9.99EEEE')::float,
105105
to_char(array_mse(execution_time_without_aqo),'9.99EEEE')::float
106-
FROM aqo_queriesINNER JOIN aqo_query_stat
106+
FROMpublic.aqo_queriesINNER JOIN aqo_query_stat
107107
ONaqo_queries.query_hash=aqo_query_stat.query_hash
108108
GROUP BY (execution_time_without_aqo,aqo_queries.fspace_hash,aqo_queries.query_hash)
109109
ORDER BY execution_timeDESCLIMIT n;
@@ -129,7 +129,7 @@ BEGIN
129129
aqo_queries.query_hash,
130130
to_char(array_avg(cardinality_error_without_aqo),'9.99EEEE')::float,
131131
to_char(array_mse(cardinality_error_without_aqo),'9.99EEEE')::float
132-
FROM aqo_queriesINNER JOIN aqo_query_stat
132+
FROMpublic.aqo_queriesINNER JOIN aqo_query_stat
133133
ONaqo_queries.query_hash=aqo_query_stat.query_hash
134134
GROUP BY (cardinality_error_without_aqo,aqo_queries.fspace_hash,aqo_queries.query_hash)
135135
ORDER BY errorDESCLIMIT n;

‎storage.c‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,30 @@ open_aqo_relation(char *heaprelnspname, char *heaprelname,
5656
RangeVar*rv;
5757

5858
reloid=RelnameGetRelid(indrelname);
59+
if (!OidIsValid(reloid))
60+
gotocleanup;
61+
5962
rv=makeRangeVar(heaprelnspname,heaprelname,-1);
6063
*hrel=table_openrv_extended(rv,lockmode, true);
61-
if (!OidIsValid(reloid)||*hrel==NULL)
62-
{
63-
/*
64-
* Absence of any AQO-related table tell us that someone executed
65-
* a 'DROP EXTENSION aqo' command. We disable AQO for all future queries
66-
* in this backend. For performance reasons we do it locally.
67-
* Clear profiling hash table.
68-
* Also, we gently disable AQO for the rest of the current query
69-
* execution process.
70-
*/
71-
aqo_enabled= false;
72-
disable_aqo_for_query();
73-
74-
return false;
75-
}
64+
if (*hrel==NULL)
65+
gotocleanup;
7666

7767
*irel=index_open(reloid,lockmode);
7868
return true;
69+
70+
cleanup:
71+
/*
72+
* Absence of any AQO-related table tell us that someone executed
73+
* a 'DROP EXTENSION aqo' command. We disable AQO for all future queries
74+
* in this backend. For performance reasons we do it locally.
75+
* Clear profiling hash table.
76+
* Also, we gently disable AQO for the rest of the current query
77+
* execution process.
78+
*/
79+
aqo_enabled= false;
80+
disable_aqo_for_query();
81+
return false;
82+
7983
}
8084

8185
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp