@@ -47,13 +47,13 @@ static AQOPlanNode DefaultAQOPlanNode =
4747 .prediction = -1.
4848};
4949
50-
5150/*
5251 * Auxiliary list for relabel equivalence classes
5352 * from pointers to the serial numbers - indexes of this list.
54- * Maybe it's need to use some smart data structure such a HTAB?
53+ * XXX: Maybe it's need to use some smart data structure such a HTAB?
54+ * It must be allocated in AQOCacheMemCtx.
5555 */
56- List * eclass_collector = NIL ;
56+ List * aqo_eclass_collector = NIL ;
5757
5858/*
5959 * Hook on creation of a plan node. We need to store AQO-specific data to
@@ -340,13 +340,6 @@ aqo_get_raw_clauses(PlannerInfo *root, List *restrictlist)
340340 return clauses ;
341341}
342342
343- void
344- eclass_collector_free (void )
345- {
346- list_free (eclass_collector );
347- eclass_collector = NIL ;
348- }
349-
350343static int
351344get_eclass_index (EquivalenceClass * ec )
352345{
@@ -361,16 +354,16 @@ get_eclass_index(EquivalenceClass *ec)
361354 while (ec -> ec_merged )
362355 ec = ec -> ec_merged ;
363356
364- foreach (lc , eclass_collector )
357+ foreach (lc , aqo_eclass_collector )
365358 {
366359 if (lfirst (lc ) == ec )
367360 break ;
368361 i ++ ;
369362 }
370363
371364 old_ctx = MemoryContextSwitchTo (AQOCacheMemCtx );
372- if (i == list_length (eclass_collector ))
373- eclass_collector = lappend (eclass_collector , ec );
365+ if (i == list_length (aqo_eclass_collector ))
366+ aqo_eclass_collector = lappend (aqo_eclass_collector , ec );
374367 MemoryContextSwitchTo (old_ctx );
375368
376369 return i ;
0 commit comments