Re: SortSupport for UUID type

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SortSupport for UUID type
Date: 2015-10-06 20:15:29
Message-ID: CA+Tgmob_931ynYTSnes6x7teQH_NehmMqsWaLW9XM36D_SBYmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 4, 2015 at 2:21 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> Attached is SortSupport for UUID type patch. This accelerates all UUID
> related sort-intense operations, making them about twice as fast with
> millions of tuples. I know that Heroku has plenty of tables used by
> various applications with a UUID primary key, so it will be nice to
> have CREATE INDEX go so much faster in those cases. The SortSupport
> routine uses abbreviation, and relies on unsigned integer comparisons.
> It has a dependency on the new abbreviated key for text patch series
> [1].
>
> For full details, see commit message. It's a bit unfortunate that I
> have yet another sort patch here, without being much closer to getting
> every other such patch committed, but I happened to have written this
> patch a while ago. I wanted to shape-up the common API that this patch
> and the related text patch use, so it just made sense to submit the
> UUID patch now.

+ tmp = ((uint32) res ^ (uint32) ((uint64) res >> 32));

The outer set of parentheses here seems pretty worthless. Perhaps one
of the parentheses at the end of the statement should be moved to just
after "res". That seems like it would add considerably clarity.

> This patch is not all that exciting -- the techniques used here are
> very simple, and it's all familiar territory for us. I expect that
> this patch will not be at all contentious when someone eventually gets
> around to reviewing it.

There is no doubt that we need more reviewers.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-10-06 20:16:12 Re: More work on SortSupport for text - strcoll() and strxfrm() caching
Previous Message Peter Geoghegan 2015-10-06 20:09:42 Re: More work on SortSupport for text - strcoll() and strxfrm() caching