@@ -176,33 +176,55 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
176176 {
177177 case AQO_MODE_INTELLIGENT :
178178 query_context .adding_query = true;
179+ query_context .adding_fss = true;
179180 query_context .learn_aqo = true;
180181 query_context .use_aqo = false;
181182 query_context .auto_tuning = true;
182183 query_context .collect_stat = true;
183184 break ;
184185 case AQO_MODE_FORCED :
185186 query_context .adding_query = false;
187+ query_context .adding_fss = true;
186188 query_context .learn_aqo = true;
187189 query_context .use_aqo = true;
188190 query_context .auto_tuning = false;
189191 query_context .fspace_hash = 0 ; /* Use common feature space */
190192 query_context .collect_stat = false;
191193 break ;
194+ case AQO_MODE_FORCED_CONTROLLED :
195+ query_context .adding_query = false;
196+ query_context .adding_fss = false;
197+ query_context .learn_aqo = true;
198+ query_context .use_aqo = true;
199+ query_context .auto_tuning = false;
200+ query_context .fspace_hash = 0 ; /* Use common feature space */
201+ query_context .collect_stat = false;
202+ break ;
203+ case AQO_MODE_FORCED_FROZEN :
204+ query_context .adding_query = false;
205+ query_context .adding_fss = false;
206+ query_context .learn_aqo = false;
207+ query_context .use_aqo = true;
208+ query_context .auto_tuning = false;
209+ query_context .fspace_hash = 0 ; /* Use common feature space */
210+ query_context .collect_stat = false;
211+ break ;
192212 case AQO_MODE_CONTROLLED :
193213 case AQO_MODE_FROZEN :
194214 /*
195215 * if query is not in the AQO knowledge base than disable AQO
196216 * for this query.
197217 */
198218 query_context .adding_query = false;
219+ query_context .adding_fss = true;
199220 query_context .learn_aqo = false;
200221 query_context .use_aqo = false;
201222 query_context .auto_tuning = false;
202223 query_context .collect_stat = false;
203224 break ;
204225 case AQO_MODE_LEARN :
205226 query_context .adding_query = true;
227+ query_context .adding_fss = true;
206228 query_context .learn_aqo = true;
207229 query_context .use_aqo = true;
208230 query_context .auto_tuning = false;
@@ -222,6 +244,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
222244 else /* Query class exists in a ML knowledge base. */
223245 {
224246 query_context .adding_query = false;
247+ query_context .adding_fss = true;
225248
226249 /* Other query_context fields filled in the find_query() routine. */
227250
@@ -243,6 +266,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
243266 * In this mode we will suppress all writings to the knowledge base.
244267 * AQO will be used for all known queries, if it is not suppressed.
245268 */
269+ query_context .adding_fss = false;
246270 query_context .learn_aqo = false;
247271 query_context .auto_tuning = false;
248272 query_context .collect_stat = false;
@@ -256,6 +280,22 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
256280 query_context .collect_stat = true;
257281 break ;
258282
283+ case AQO_MODE_FORCED_CONTROLLED :
284+ /*
285+ * AQO will be learned for all known feature sub spaces.
286+ */
287+ query_context .adding_fss = false;
288+ break ;
289+
290+ case AQO_MODE_FORCED_FROZEN :
291+ /*
292+ * In this mode we will suppress all writings to the knowledge base.
293+ * AQO will be used for all known feature sub spaces.
294+ */
295+ query_context .adding_fss = false;
296+ query_context .learn_aqo = false;
297+ break ;
298+
259299 case AQO_MODE_INTELLIGENT :
260300 case AQO_MODE_FORCED :
261301 case AQO_MODE_CONTROLLED :
0 commit comments