Re: Memory-comparable Serialization of Data Types

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Memory-comparable Serialization of Data Types
Дата
Msg-id CAH2-Wzn75vSM4SDWOVaYssndZfM3YNyC9U-vp6sbsirXAmw19Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Memory-comparable Serialization of Data Types  (Shichao Jin <jsc0218@gmail.com>)
Ответы Re: Memory-comparable Serialization of Data Types
Список pgsql-hackers
On Tue, Feb 11, 2020 at 12:19 PM Shichao Jin <jsc0218@gmail.com> wrote:
> Yes, this is exactly what I mean.

PostgreSQL doesn't have this capability. It might make sense to have
it for some specific data structures, such as tuples on internal
B-Tree pages -- these merely guide index scans, so there some
information loss may be acceptable compared to the native/base
representation. However, that would only be faster because memcmp() is
generally faster than the underlying datatype's native comparator. Not
because comparisons have to take place in "the upper levels". There is
some indirection/overhead involved in using SQL-callable operators,
but not that much.

Note that such a representation has to lose information in at least
some cases. For example, case-insensitive collations would have to
lose information about the original case used (or store the original
alongside the conditioned binary string). Note also that a "one pass"
representation that we can just memcmp() will have to be significantly
larger in some cases, especially when collatable text is used. A
strxfrm() blob is typically about 3.3x larger than the original string
IIRC.

-- 
Peter Geoghegan



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Postgres 32 bits client compilation fail. Win32 bits client issupported?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Memory-comparable Serialization of Data Types