From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Changeset Extraction v7.5 |
Date: | 2014-02-12 15:56:09 |
Message-ID: | 20140212155609.GA3391@alap3.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2014-02-11 11:22:24 -0500, Robert Haas wrote:
> + context = AllocSetContextCreate(CurrentMemoryContext,
> +
> "Changeset Extraction Context",
> +
> ALLOCSET_DEFAULT_MINSIZE,
> +
> ALLOCSET_DEFAULT_INITSIZE,
> +
> ALLOCSET_DEFAULT_MAXSIZE);
>
> I have my doubts about whether it's wise to make this the child of
> CurrentMemoryContext. Certainly, if we do that, then expectations
> around what that context is need to be documented. Short-lived
> contexts are presumably unsuitable.
Well, it depends on the type of usage. In the walsender, yes, it needs
to be a longliving context. Not so much in the SQL case, inside the SRF
we spill all the data into a tuplestore after which we are done. I don't
see which context would be more suitable as a default parent; it used to
be TopMemoryContext but that requires pointless cleanup routines to
handle errors...
So I think documenting the requirement is the best way?
I'm working on the other comments, pushing individual changes to
git. Will send a new version onlist once I'm through.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2014-02-12 15:58:20 | Re: narwhal and PGDLLIMPORT |
Previous Message | Kohei KaiGai | 2014-02-12 15:42:29 | Re: contrib/cache_scan (Re: What's needed for cache-only table scan?) |