Re: Sort support for macaddr8

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Sort support for macaddr8
Date: 2019-06-03 22:05:55
Message-ID: CAH2-WzktQH_kyiyk7bYWPA3a2DqfYTiTZabQ3H7_o87gJvrTDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 3, 2019 at 2:59 PM Chapman Flack <chap(at)anastigmatix(dot)net> wrote:
> 1. (This one seems like a bug.) In the little-endian case, if
> SIZEOF_DATUM is smaller than the type, I'm not convinced by doing
> the DatumBigEndianToNative() after the memcpy(). Seems like that's
> too late to make sure the most-significant bytes got copied.

Uh, when else would you do it? Before the memcpy()?

> 2. (This one seems like an API opportunity.) If it becomes common to
> add abbreviation support for smallish types such that (as here,
> when SIZEOF_DATUM >= 8), an abbreviated "equality" result is in fact
> authoritative, would it be worthwhile to have some way for the sort
> support routine to announce that fact to the caller? That could
> spare the caller the effort of re-checking with the authoritative
> routine.

It's possible that that would make sense, but I don't think that this
patch needs to do that. There is at least one pre-existing cases that
does this -- macaddr.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-06-03 22:36:06 Re: Use of multi-column gin index
Previous Message Chapman Flack 2019-06-03 22:04:29 Re: Sort support for macaddr8