File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,43 @@ WHERE (aqs.query_hash = aq.query_hash) AND
62
62
aqs .query_hash = $1 ;
63
63
$func$ LANGUAGE SQL;
64
64
65
+ CREATE FUNCTION public .aqo_enable_query(hash int )
66
+ RETURNS VOID
67
+ AS $func$
68
+ UPDATE aqo_queries SET
69
+ learn_aqo = ' true' ,
70
+ use_aqo = ' true'
71
+ WHERE query_hash = $1 ;
72
+ $func$ LANGUAGE SQL;
73
+
74
+ CREATE FUNCTION public .aqo_disable_query(hash int )
75
+ RETURNS VOID
76
+ AS $func$
77
+ UPDATE aqo_queries SET
78
+ learn_aqo = ' false' ,
79
+ use_aqo = ' false' ,
80
+ auto_tuning = ' false'
81
+ WHERE query_hash = $1 ;
82
+ $func$ LANGUAGE SQL;
83
+
84
+ CREATE FUNCTION public .aqo_clear_hist(hash int )
85
+ RETURNS VOID
86
+ AS $func$
87
+ DELETE FROM aqo_data WHERE fspace_hash= $1 ;
88
+ $func$ LANGUAGE SQL;
89
+
65
90
-- Show queries that contains 'Never executed' nodes at the plan.
66
91
CREATE FUNCTION public .aqo_ne_queries()
67
92
RETURNS SETOF int
68
93
AS $func$
69
94
SELECT query_hash FROM aqo_query_stat aqs WHERE - 1 = ANY (cardinality_error_with_aqo::double precision []);
70
95
$func$ LANGUAGE SQL;
96
+
97
+ CREATE FUNCTION public .aqo_drop(hash int )
98
+ RETURNS VOID
99
+ AS $func$
100
+ DELETE FROM aqo_queries aq WHERE (aq .query_hash = $1 );
101
+ DELETE FROM aqo_data ad WHERE (ad .fspace_hash = $1 );
102
+ DELETE FROM aqo_query_stat aq WHERE (aq .query_hash = $1 );
103
+ DELETE FROM aqo_query_texts aq WHERE (aq .query_hash = $1 );
104
+ $func$ LANGUAGE SQL;
You can’t perform that action at this time.
0 commit comments