@@ -52,13 +52,13 @@ static AQOPlanNode DefaultAQOPlanNode =
5252 .prediction = -1.
5353};
5454
55-
5655/*
5756 * Auxiliary list for relabel equivalence classes
5857 * from pointers to the serial numbers - indexes of this list.
59- * Maybe it's need to use some smart data structure such a HTAB?
58+ * XXX: Maybe it's need to use some smart data structure such a HTAB?
59+ * It must be allocated in AQOCacheMemCtx.
6060 */
61- List * eclass_collector = NIL ;
61+ List * aqo_eclass_collector = NIL ;
6262
6363/*
6464 * Hook on creation of a plan node. We need to store AQO-specific data to
@@ -345,13 +345,6 @@ aqo_get_raw_clauses(PlannerInfo *root, List *restrictlist)
345345 return clauses ;
346346}
347347
348- void
349- eclass_collector_free (void )
350- {
351- list_free (eclass_collector );
352- eclass_collector = NIL ;
353- }
354-
355348static int
356349get_eclass_index (EquivalenceClass * ec )
357350{
@@ -366,16 +359,16 @@ get_eclass_index(EquivalenceClass *ec)
366359 while (ec -> ec_merged )
367360 ec = ec -> ec_merged ;
368361
369- foreach (lc , eclass_collector )
362+ foreach (lc , aqo_eclass_collector )
370363 {
371364 if (lfirst (lc ) == ec )
372365 break ;
373366 i ++ ;
374367 }
375368
376369 old_ctx = MemoryContextSwitchTo (AQOCacheMemCtx );
377- if (i == list_length (eclass_collector ))
378- eclass_collector = lappend (eclass_collector , ec );
370+ if (i == list_length (aqo_eclass_collector ))
371+ aqo_eclass_collector = lappend (aqo_eclass_collector , ec );
379372 MemoryContextSwitchTo (old_ctx );
380373
381374 return i ;
0 commit comments