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

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: More work on SortSupport for text - strcoll() and strxfrm() caching
Дата
Msg-id CAM3SWZQ3hdqNUkdbwepmp-4ixoGEMUq=2-BxMFRz5LXOv4BzRw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: More work on SortSupport for text - strcoll() and strxfrm() caching  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: More work on SortSupport for text - strcoll() and strxfrm() caching  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Thu, Oct 8, 2015 at 10:13 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> It seems to me that (1) ABBREV_STRING_UINT isn't
> a great name for this and (2) the comment is awfully long for the
> thing to which it refers.  I suggest that we instead call it
> DatumToBigEndian(), put it pg_bswap.h, and change the comments to
> something like this:
>
> /*
>  * Rearrange the bytes of a Datum into big-endian order.
>  *
>  * One possible application of this macro is to make comparisons
> cheaper.  An integer
>  * comparison of the new Datums will return the same result as a memcmp() on the
>  * original Datums, but the integer comparison should be much cheaper.
>  */
>
> The specific way that this is used by various sortsupport routines can
> be adequately explained in the comments for those routines.

This is pretty clearly something specific to SortSupport. I'm not
opposed to changing the name and making the comments more terse along
those lines, but I think it should live in sortsupport.h. The macro
byteswaps datums on little-endian platforms only, which seems very
specific.

I think that we're going to have SortSupport with abbreviation for
UUIDs and bytea at some point, and maybe character(n). Centralizing
information about this to sortsupport.h makes sense to me.

-- 
Peter Geoghegan



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Freeze avoidance of very large table.
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: bugs and bug tracking