Re: Changeset Extraction v7.5 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Changeset Extraction v7.5
Date
Msg-id 20140212155609.GA3391@alap3.anarazel.de
Whole thread Raw
In response to Re: Changeset Extraction v7.5  (Robert Haas <robertmhaas@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: contrib/cache_scan (Re: What's needed for cache-only table scan?)
Next
From: Tom Lane
Date:
Subject: Re: narwhal and PGDLLIMPORT