From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Maksim Milyutin <milyutinma@gmail.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Subject: Re: Proposal: Local indexes for partitioned table
Date: Fri, 3 Nov 2017 18:30:42 +0100
Message-ID: <20171103173042.rgtuwowlfbv54sae@alvherre.pgsql> (raw)
In-Reply-To: <12195.1509139543@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
> Robert Haas <robertmhaas@gmail.com> writes:
> > We could do that, but the motivation for the current system was to
> > avoid leaking memory in a long-lived context.
Yeah, my approach here is to use a CATCH block that deletes the memory
context just created, thus avoiding a long-lived leak.
Tom Lane wrote:
> Another key point is to avoid leaving a corrupted relcache entry behind
> if you fail partway through.
Sure ... in the code as I have it we only assign the local variable to
the relcache entry if everything is succesful. So no relcache
corruption should result.
> It might work to build the new key in a context that's initially a
> child of CurrentMemoryContext, then reparent it to be a child of
> CacheMemoryContext when done.
That's another way (than the PG_TRY block), but I think it's more
complicated with no gain.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, milyutinma@gmail.com, Langote_Amit_f8@lab.ntt.co.jp
Subject: Re: Proposal: Local indexes for partitioned table
In-Reply-To: <20171103173042.rgtuwowlfbv54sae@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox