Re: Change the bool member of the Query structure to bits

Поиск
Список
Период
Сортировка
От Quan Zongliang
Тема Re: Change the bool member of the Query structure to bits
Дата
Msg-id 954eace7-8fca-4a0e-b05c-2f907e2d081a@yeah.net
обсуждение исходный текст
Ответ на Re: Change the bool member of the Query structure to bits  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers

On 2024/2/20 19:18, Tomas Vondra wrote:
> On 2/20/24 11:11, Quan Zongliang wrote:
>>
>> Sorry. I forgot to save a file. This is the latest.
>>
>> On 2024/2/20 18:07, Quan Zongliang wrote:
>>>
>>> The Query structure has an increasing number of bool attributes. This
>>> is likely to increase in the future. And they have the same
>>> properties. Wouldn't it be better to store them in bits? Common
>>> statements don't use them, so they have little impact. This also saves
>>> memory space.
>>>
> 
> Hi,
> 
> Are we really adding bools to Query that often? A bit of git-blame says
> it's usually multiple years to add a single new flag, which is what I'd
> expect. I doubt that'll change.
> 
> As for the memory savings, can you quantify how much memory this would save?
> 
> I highly doubt that's actually true (or at least measurable). The Query
> struct has ~256B, the patch cuts that to ~232B. But we allocate stuff in
> power-of-2, so we'll allocate 256B chunk anyway. And we allocate very
> few of those objects anyway ...
> 
> regards
> 
That makes sense. Withdraw.




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

Предыдущее
От: Quan Zongliang
Дата:
Сообщение: Re: Change the bool member of the Query structure to bits
Следующее
От: David Rowley
Дата:
Сообщение: Re: Add bump memory context type and use it for tuplesorts