You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
-- Show execution time of queries, for which AQO has statistics.
@@ -141,44 +125,17 @@ ELSE
141
125
END IF;
142
126
END;
143
127
$$ LANGUAGE plpgsql;
144
-
145
128
COMMENT ON FUNCTION aqo_execution_time(boolean) IS
146
129
'Get execution time of queries. If controlled = true (AQO could advise cardinality estimations), show time of last execution attempt. Another case (AQO not used), return an average value of execution time across all known executions.';
147
130
148
131
--
149
-
-- Remove all information about a query class from AQO storage.
132
+
-- Remove query class settings, text, statistics and ML data from AQO storage.
133
+
-- Return number of FSS records, removed from the storage.
150
134
--
151
-
CREATE OR REPLACEFUNCTIONaqo_drop_class(queryid_rmbigint)
152
-
RETURNSintegerAS $$
153
-
DECLARE
154
-
lfsbigint;
155
-
numinteger;
156
-
BEGIN
157
-
IF (queryid_rm=0) THEN
158
-
raise EXCEPTION'[AQO] Cannot remove basic class %.', queryid_rm;
159
-
END IF;
160
-
161
-
SELECT fsFROM aqo_queriesWHERE (queryid= queryid_rm) INTO lfs;
162
-
163
-
IF (lfs ISNULL) THEN
164
-
raise WARNING'[AQO] Nothing to remove for the class %.', queryid_rm;
165
-
RETURN0;
166
-
END IF;
167
-
168
-
IF (lfs<> queryid_rm) THEN
169
-
raise WARNING'[AQO] Removing query class has non-generic feature space value: id = %, fs = %.', queryid_rm, fs;
170
-
END IF;
171
-
172
-
SELECTcount(*)FROM aqo_dataWHERE fs= lfs INTO num;
173
-
174
-
PERFORM aqo_queries_remove(queryid_rm);
175
-
PERFORM aqo_stat_remove(queryid_rm);
176
-
PERFORM aqo_qtexts_remove(queryid_rm);
177
-
PERFORM aqo_data_remove(lfs,NULL);
178
-
RETURN num;
179
-
END;
180
-
$$ LANGUAGE plpgsql;
181
-
135
+
CREATE OR REPLACEFUNCTIONaqo_drop_class(queryidbigint)
136
+
RETURNSinteger
137
+
AS'MODULE_PATHNAME','aqo_drop_class'
138
+
LANGUAGE C STRICT VOLATILE;
182
139
COMMENT ON FUNCTION aqo_drop_class(bigint) IS
183
140
'Remove info about an query class from AQO ML knowledge base.';
184
141
@@ -190,9 +147,8 @@ COMMENT ON FUNCTION aqo_drop_class(bigint) IS
190
147
-- Returns number of deleted rows from aqo_queries and aqo_data tables.
191
148
--
192
149
CREATE OR REPLACEFUNCTIONaqo_cleanup(OUT nfsinteger, OUT nfssinteger)