@@ -139,15 +139,12 @@ aqo_set_baserel_rows_estimate(PlannerInfo *root, RelOptInfo *rel)
139
139
List * restrict_clauses ;
140
140
int fss = 0 ;
141
141
142
- if (query_context .use_aqo || query_context . learn_aqo )
142
+ if (query_context .use_aqo )
143
143
selectivities = get_selectivities (root , rel -> baserestrictinfo , 0 ,
144
144
JOIN_INNER , NULL );
145
-
146
- if (!query_context .use_aqo )
145
+ else
147
146
{
148
- if (query_context .learn_aqo )
149
- list_free_deep (selectivities );
150
-
147
+ rel -> predicted_cardinality = -2. ;
151
148
call_default_set_baserel_rows_estimate (root , rel );
152
149
return ;
153
150
}
@@ -207,7 +204,7 @@ aqo_get_parameterized_baserel_size(PlannerInfo *root,
207
204
int current_hash ;
208
205
int fss = 0 ;
209
206
210
- if (query_context .use_aqo || query_context . learn_aqo )
207
+ if (query_context .use_aqo )
211
208
{
212
209
MemoryContext mcxt ;
213
210
@@ -232,14 +229,9 @@ aqo_get_parameterized_baserel_size(PlannerInfo *root,
232
229
pfree (args_hash );
233
230
pfree (eclass_hash );
234
231
}
235
-
236
- if (!query_context .use_aqo )
232
+ else
237
233
{
238
- if (query_context .learn_aqo )
239
- {
240
- list_free_deep (selectivities );
241
- list_free (allclauses );
242
- }
234
+ predicted_ppi_rows = -3. ;
243
235
return call_default_get_parameterized_baserel_size (root , rel ,
244
236
param_clauses );
245
237
}
@@ -281,15 +273,12 @@ aqo_set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
281
273
List * current_selectivities = NULL ;
282
274
int fss = 0 ;
283
275
284
- if (query_context .use_aqo || query_context . learn_aqo )
276
+ if (query_context .use_aqo )
285
277
current_selectivities = get_selectivities (root , restrictlist , 0 ,
286
278
sjinfo -> jointype , sjinfo );
287
-
288
- if (!query_context .use_aqo )
279
+ else
289
280
{
290
- if (query_context .learn_aqo )
291
- list_free_deep (current_selectivities );
292
-
281
+ rel -> predicted_cardinality = -2. ;
293
282
call_default_set_joinrel_size_estimates (root , rel ,
294
283
outer_rel ,
295
284
inner_rel ,
@@ -352,15 +341,12 @@ aqo_get_parameterized_joinrel_size(PlannerInfo *root,
352
341
List * current_selectivities = NULL ;
353
342
int fss = 0 ;
354
343
355
- if (query_context .use_aqo || query_context . learn_aqo )
344
+ if (query_context .use_aqo )
356
345
current_selectivities = get_selectivities (root , restrict_clauses , 0 ,
357
346
sjinfo -> jointype , sjinfo );
358
-
359
- if (!query_context .use_aqo )
347
+ else
360
348
{
361
- if (query_context .learn_aqo )
362
- list_free_deep (current_selectivities );
363
-
349
+ predicted_ppi_rows = -3. ;
364
350
return call_default_get_parameterized_joinrel_size (root , rel ,
365
351
outer_path ,
366
352
inner_path ,
0 commit comments