From: Seebs <seebs@seebs.net>
To: Euler Taveira <euler@eulerto.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: index access method documentation light on details on ii_AmCache
Date: Wed, 13 Sep 2023 16:48:22 -0500
Message-ID: <20230913164822.41e4c0bd@seebsdell> (raw)
In-Reply-To: <a52489dd-e6ca-425b-a23d-d0139728419f@app.fastmail.com>
References: <169454016225.2433963.11433530945607791340@wrigleys.postgresql.org>
<a52489dd-e6ca-425b-a23d-d0139728419f@app.fastmail.com>
On Wed, 13 Sep 2023 15:48:41 -0300
"Euler Taveira" <euler@eulerto.com> wrote:
> Unless you change it, ii_Context is CurrentMemoryContext (see
> makeIndexInfo). Hence, your AM state information is freed when the
> current memory context is freed.
A thing I am now wondering:
Is there anything in the postgresql documentation which explains this,
or says when a given memory context will be freed? Like, is the
ii_Context there for the lifetime of the index? For the lifetime of the
query? For the lifetime of a single insert operation?
I've found a reference to it in a third-party blog post, but I actually
can't find anything in the docs explaining memory contexts, and a bit
of experimenting makes me think they are doing things that aren't
obvious to me. For instance, I tried *not* deleting a memory context
when done with it, then looping doing a query which tried to create and
populate it, and... memory usage did not go up. Making me think that
maybe it gets reused? Or maybe it's implicitly deleted because it had
a parent context?
-s
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-docs@postgresql.org
Cc: seebs@seebs.net, euler@eulerto.com, pgsql-docs@lists.postgresql.org
Subject: Re: index access method documentation light on details on ii_AmCache
In-Reply-To: <20230913164822.41e4c0bd@seebsdell>
* 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