8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1a7199 commit 8651c23Copy full SHA for 8651c23
postprocessing.c
@@ -279,11 +279,14 @@ learnOnPlanState(PlanState *p, void *context)
279
learn_rows = p->instrument->ntuples / p->instrument->nloops;
280
}
281
282
- /* Calculate predicted cardinality */
283
- if (p->plan->predicted_cardinality > 0.)
+ /*
+ * Calculate predicted cardinality.
284
+ * We could find a positive value of predicted cardinality in the case of
285
+ * reusing plan caused by the rewriting procedure.
286
+ * Also it may be caused by using of a generic plan.
287
+ */
288
+ if (p->plan->predicted_cardinality > 0. && query_context.use_aqo)
289
{
- Assert(query_context.use_aqo);
-
290
/* AQO made prediction. use it. */
291
predicted = p->plan->predicted_cardinality;
292
0 commit comments