Re: Shared detoast Datum proposal

From: Nikita Malakhov <hukutoc(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Andy Fan <zhihuifan1213(at)163(dot)com>, Michael Zhilin <m(dot)zhilin(at)postgrespro(dot)ru>, Peter Smith <smithpb2250(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Shared detoast Datum proposal
Date: 2024-03-15 08:21:41
Message-ID: CAN-LCVOSiWpZrG8F0zDFzE+q=Lp0GM=u5cL2hez=8czPD6Pk9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Here's a slightly improved version of patch Tomas provided above (v2),
with cache invalidations and slices caching added, still as PoC.

The main issue I've encountered during tests is that when the same query
retrieves both slices and full value - slices, like substring(t,...) the
order of
the values is not predictable, with text fields substrings are retrieved
before the full value and we cannot benefit from cache full value first
and use slices from cached value.

Yet the cache code is still very compact and affects only sources related
to detoasting.

Tomas, about HASH_ENTER - according to comments it could throw
an OOM error, so I've changed it to HASH_ENTER_NULL to avoid
new errors. In this case we would just have the value not cached
without an error.

--
Regards,
Nikita Malakhov
Postgres Professional
The Russian Postgres Company
https://postgrespro.ru/

Attachment Content-Type Size
0001-toast-cache-v3.patch application/octet-stream 19.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sutou Kouhei 2024-03-15 08:37:54 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message Alexander Cheshev 2024-03-15 08:01:03 [PATCH] TODO “Allow LISTEN on patterns”