Re: More work on SortSupport for text - strcoll() and strxfrm() caching

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: More work on SortSupport for text - strcoll() and strxfrm() caching
Date: 2015-10-09 00:20:00
Message-ID: CAM3SWZTaVFBwtHF87OpNGN2r2_he-wsmN53HmqyWYPM=K51rEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 8, 2015 at 11:37 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> I'm not convinced. Doesn't this exact same concept get used for
> over-the-wire communication between BE and LE machines? There, this
> operation is spelled htonl/ntohl. Some systems even have htonll, but
> I'm sure there are still a bunch that don't.

I continue to disagree with that. The spelling of the macro that you
propose suggests that this process occurs at a relatively high level
of abstraction, which is misleading. Datums that have abbreviated key
bytes packed into them are in general kind of special. All the same,
here is a revision of the patch series along those lines. I'll also
have to update the UUID patch to independently note the same issues.

I should point out that I did not call the macro DatumToBigEndian(),
because it's actually the other way around. I called it
DatumToLittleEndian(), since the unsigned integer comparator would
work correctly on big-endian systems without calling any new macro
(which is of course why the new macro does nothing on big-endian
systems). We start off with a big endian Datum/unsigned integer on all
platforms, and then we byteswap it to make it a little-endian unsigned
integer if and when that's required (i.e. only on little-endian
systems).

--
Peter Geoghegan

Attachment Content-Type Size
0002-Add-two-text-sort-caching-optimizations.patch text/x-patch 5.8 KB
0001-Use-unsigned-integer-abbreviated-keys-for-text.patch text/x-patch 4.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-10-09 00:27:48 Re: SortSupport for UUID type
Previous Message Haribabu Kommi 2015-10-09 00:02:32 Re: removing set_latch_on_sigusr1