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

From Rushabh Lathia
Subject Re: [HACKERS] create_unique_path and GEQO
Date
Msg-id CAGPqQf3GUeeRa94jfJox9EAK+dF=VKfz7tzooeUEJ=QnzKFToA@mail.gmail.com
Whole thread Raw
In response to [HACKERS] create_unique_path and GEQO  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: [HACKERS] create_unique_path and GEQO  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers


On Wed, Mar 22, 2017 at 3:43 PM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote:
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()?


Do you have test case, which can reproduce the issue you
explained above?
 
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



--
Rushabh Lathia

pgsql-hackers by date:

Previous
From: Kuntal Ghosh
Date:
Subject: Re: [HACKERS] BUG: pg_dump generates corrupted gzip file in Windows
Next
From: Craig Ringer
Date:
Subject: Re: [HACKERS] Logical decoding on standby