Re: hyrax vs. RelationBuildPartitionDesc

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: hyrax vs. RelationBuildPartitionDesc
Date: 2019-03-13 18:21:45
Message-ID: 20190313182145.GA488@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Mar-13, Robert Haas wrote:

> On Wed, Mar 13, 2019 at 1:38 PM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> > A bit, yes, but not overly so, and it's less fragile that not having
> > such a protection. Anything that allocates in CacheMemoryContext needs
> > to be very careful anyway.
>
> True, but I think it's more fragile than either of the options I proposed.

You do? Unless I misunderstood, your options are:

1. (the patch you attached) create a temporary memory context that is
used for everything, then at the end copy the good stuff to CacheMemCxt
(or a sub-context thereof). This still needs to copy.

2. create a temp memory context, do everything there, do retail freeing
of everything we don't want, reparenting the context to CacheMemCxt.
Hope we didn't forget to pfree anything.

How is any of those superior to what I propose?

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-03-13 18:26:28 Re: hyrax vs. RelationBuildPartitionDesc
Previous Message Robert Haas 2019-03-13 18:07:27 Re: hyrax vs. RelationBuildPartitionDesc