Re: [HACKERS] Small improvement to compactify_tuples - Mailing list pgsql-hackers

From Claudio Freire
Subject Re: [HACKERS] Small improvement to compactify_tuples
Date
Msg-id CAGTBQpa7-t41u_AkfgEWtVFDi2j6qZ2-YbnSHhN8oaGkbOJF4Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Small improvement to compactify_tuples  (Юрий Соколов <funny.falcon@gmail.com>)
Responses Re: [HACKERS] Small improvement to compactify_tuples  (Юрий Соколов <funny.falcon@gmail.com>)
List pgsql-hackers
On Mon, Nov 6, 2017 at 11:50 AM, Юрий Соколов <funny.falcon@gmail.com> wrote:
>> Maybe leave a fallback to qsort if some corner case produces big buckets?
>
> For 8kb pages, each bucket is per 32 bytes. So, for heap pages it is at
> most 1 heap-tuple per bucket, and for index pages it is at most 2 index
> tuples per bucket. For 32kb pages it is 4 heap-tuples and 8 index-tuples
> per bucket.
> It will be unnecessary overhead to call non-inlineable qsort in this cases
>
> So, I think, shell sort could be removed, but insertion sort have to remain.
>
> I'd prefer shell sort to remain also. It could be useful in other places
> also,
> because it is easily inlinable, and provides comparable to qsort performance
> up to several hundreds of elements.

I'd rather have an inlineable qsort.

And I'd recommend doing that when there is a need, and I don't think
this patch really needs it, since bucket sort handles most cases
anyway.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Юрий Соколов
Date:
Subject: Re: [HACKERS] Small improvement to compactify_tuples
Next
From: Sokolov Yura
Date:
Subject: Re: [HACKERS] Fix performance degradation of contended LWLock on NUMA