Re: things I learned from working on memory allocation - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: things I learned from working on memory allocation
Date
Msg-id CAA4eK1K11N9RM=xnXEjvdObkPcpnjP0nPdpqLfSAn8437L0D8Q@mail.gmail.com
Whole thread Raw
In response to things I learned from working on memory allocation  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: things I learned from working on memory allocation
List pgsql-hackers
On Tue, Jul 8, 2014 at 1:27 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> 6. In general, I'm worried that it's going to be hard to keep the
> overhead of parallel sort from leaking into the non-parallel case.
> With the no-allocator approach, every place that uses
> GetMemoryChunkSpace() or repalloc() or pfree() will have to handle the
> DSM and non-DSM cases differently, which isn't great for either
> performance or maintainability.  And even with an allocator, the
> SortTuple array will need to use relative pointers in a DSM; that
> might burden the non-DSM case.

I think you are right in saying that there can be a performance impact
for non-parallel case due to pfree() (or other similar calls) and/or due
to usage of relative pointers, but can it have measurable impact during
actual sort operation?  Changes for any of them doesn't seem to cause
much impact for overall sort operation, although I am not sure what kind
of impact usage of relative pointers can cause, do you any specific point
in mind due to which you think that it can cause noticeable performance
impact. 

If there is an noticeable impact, then do you think having separate
file/infrastructure for parallel sort can help, basically non-parallel
and parallel sort will have some common and some specific parts.
The above layer will call the parallel/non-parallel functions based on
operation need.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: 9.5: UPDATE/DELETE .. ORDER BY .. LIMIT ..
Next
From: Fujii Masao
Date:
Subject: Re: psql: show only failed queries