[HACKERS] create_unique_path and GEQO - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject [HACKERS] create_unique_path and GEQO
Date
Msg-id CAFjFpRcXkHHrXyD9BCvkgGJV4TnHG2SWJ0PhJfrDu3NAcQvh7g@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] create_unique_path and GEQO  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Re: [HACKERS] create_unique_path and GEQO  (Rushabh Lathia <rushabh.lathia@gmail.com>)
List pgsql-hackers
Hi,
In create_unique_path() there's comment   /*    * We must ensure path struct and subsidiary data are allocated in main
 * planning context; otherwise GEQO memory management causes trouble.    */   oldcontext =
MemoryContextSwitchTo(root->planner_cxt);
   pathnode = makeNode(UniquePath);

This means that when GEQO resets the memory context, the RelOptInfo
for which this path is created and may be set to cheapest_unique_path
goes away, the unique path lingers on in the planner context.
Shouldn't we instead allocate the path in the same context as the
RelOptInfo similar to mark_dummy_rel()?

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company



pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: [HACKERS] segfault in hot standby for hash indexes
Next
From: Pavan Deolasee
Date:
Subject: Re: [HACKERS] Patch: Write Amplification Reduction Method (WARM)