Re: Shared detoast Datum proposal

From: Michael Zhilin <m(dot)zhilin(at)postgrespro(dot)ru>
To: Andy Fan <zhihuifan1213(at)163(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Nikita Malakhov <hukutoc(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Shared detoast Datum proposal
Date: 2024-01-23 08:59:00
Message-ID: 71321d83-391b-473b-aaf6-618c7f682b96@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Andy,

It looks like v5 is missing in your mail. Could you please check and
resend it?

Thanks,
 Michael.

On 1/23/24 08:44, Andy Fan wrote:
> Hi,
>
> Peter Smith<smithpb2250(at)gmail(dot)com> writes:
>
>> 2024-01 Commitfest.
>>
>> Hi, This patch has a CF status of "Needs Review" [1], but it seems
>> there were CFbot test failures last time it was run [2]. Please have a
>> look and post an updated version if necessary.
>>
>> ======
>> [1]https://commitfest.postgresql.org/46/4759/
>> [2]https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest/46/4759
> v5 attached, it should fix the above issue. This version also introduce
> a data struct called bitset, which has a similar APIs like bitmapset but
> have the ability to reset all bits without recycle its allocated memory,
> this is important for this feature.
>
> commit 44754fb03accb0dec9710a962a334ee73eba3c49 (HEAD -> shared_detoast_value_v2)
> Author: yizhi.fzh<yizhi(dot)fzh(at)alibaba-inc(dot)com>
> Date: Tue Jan 23 13:38:34 2024 +0800
>
> shared detoast feature.
>
> commit 14a6eafef9ff4926b8b877d694de476657deee8a
> Author: yizhi.fzh<yizhi(dot)fzh(at)alibaba-inc(dot)com>
> Date: Mon Jan 22 15:48:33 2024 +0800
>
> Introduce a Bitset data struct.
>
> While Bitmapset is designed for variable-length of bits, Bitset is
> designed for fixed-length of bits, the fixed length must be specified at
> the bitset_init stage and keep unchanged at the whole lifespan. Because
> of this, some operations on Bitset is simpler than Bitmapset.
>
> The bitset_clear unsets all the bits but kept the allocated memory, this
> capacity is impossible for bit Bitmapset for some solid reasons and this
> is the main reason to add this data struct.
>
> Also for performance aspect, the functions for Bitset removed some
> unlikely checks, instead with some Asserts.
>
> [1]https://postgr.es/m/CAApHDvpdp9LyAoMXvS7iCX-t3VonQM3fTWCmhconEvORrQ%2BZYA%40mail.gmail.com
> [2]https://postgr.es/m/875xzqxbv5.fsf%40163.com
>
>
> I didn't write a good commit message for commit 2, the people who is
> interested with this can see the first message in this thread for
> explaination.
>
> I think anyone whose customer uses lots of jsonb probably can get
> benefits from this. the precondition is the toast value should be
> accessed 1+ times, including the jsonb_out function. I think this would
> be not rare to happen.
>

--
Michael Zhilin
Postgres Professional
+7(925)3366270
https://www.postgrespro.ru

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-01-23 09:03:23 Re: Reordering DISTINCT keys to match input path's pathkeys
Previous Message Heikki Linnakangas 2024-01-23 08:57:16 Re: Network failure may prevent promotion