Re: [HACKERS] Decimal64 and Decimal128

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: [HACKERS] Decimal64 and Decimal128
Дата
Msg-id CAH2-Wzm4fD0M89Oy0_NsZQJcq3QppTEFLURnrL83SDhY2E_P5w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Decimal64 and Decimal128  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [HACKERS] Decimal64 and Decimal128  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, Jun 19, 2017 at 12:19 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> I don't have a specific use case in mind.  However, datumCopy() is
> sure to be a lot faster when typByVal is true, and see also the
> documentation changes in commit
> 8472bf7a73487b0535c95e299773b882f7523463.

Fair enough.

I ask because at one time I informally benchmarked Postgres (using
pgbench), where int4 (or maybe int8) primary keys were replaced with
equivalent numeric primary keys. This was a SELECT benchmark. Anyway,
the conclusion at the time was that it makes surprisingly little
difference (I think it was ~5%), because cache misses dominate anyway,
and the page layout doesn't really change (the fan-in didn't change
*at all* either, at least for this one case, because of alignment
considerations). I never published this result, because I didn't have
time to test rigorously, and wasn't sure that there was sufficient
interest.

This was intended to confirm my intuition that cache misses were by
far the main bottleneck (profiling also helped). I was thinking about
putting abbreviated keys within internal B-Tree pages at the time
(probably interleaved with the ItemIdData array). I've since realized
that prefix compression is more or less prerequisite (to get value
from a 1 or 2 byte abbreviated key), and that there are some painful
issues with collations + text. You probably need to encode each
internal page IndexTuple as a simple binary string that you always
just memcmp() in a type/tuple descriptor agnostic fashion, leaving
compression, truncation, and abbreviation as relatively trivial tasks.
This is all very difficult, of course, which is why it wasn't
seriously pursued.

-- 
Peter Geoghegan



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] Preliminary results for proposed new pgindentimplementation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Regression in join selectivity estimations when using foreign keys