From: | Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: create_unique_path and GEQO |
Date: | 2017-03-24 05:45:22 |
Message-ID: | CAFjFpRd1OdEqpXLsWJVn7Qq0wy+cWX5KFt7KZH-+e3e3GOHAog@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Mar 22, 2017 at 3:43 PM, Ashutosh Bapat
<ashutosh(dot)bapat(at)enterprisedb(dot)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()?
>
tried this change as attached patch. I ran make installcheck with
geqo_threshold = 2. Only join.sql failed several plans changed, which
is expected. There was one difference related to changed output order
but that's because of the changed plan.
Adding this to the commitfest.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
Attachment | Content-Type | Size |
---|---|---|
pg_upath_geqo.patch | application/octet-stream | 1.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Kuntal Ghosh | 2017-03-24 05:58:28 | BUG: pg_dump generates corrupted gzip file in Windows |
Previous Message | Peter Eisentraut | 2017-03-24 05:18:48 | Re: identity columns |