From: | Andrey Borodin <x4mmm(at)yandex-team(dot)ru> |
---|---|
To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
Cc: | Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Костя Кузнецов <chapaev28(at)ya(dot)ru> |
Subject: | Re: GiST VACUUM |
Date: | 2018-08-06 18:12:00 |
Message-ID: | E8FDC7F0-0516-4A84-B754-4CC92801E5F5@yandex-team.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi!
PFA v16.
> 5 авг. 2018 г., в 21:45, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> написал(а):
>> 5 авг. 2018 г., в 16:18, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> написал(а):
>>
>> Hmm. A ListCell is 16 bytes, plus the AllocChunk header, 16 bytes. 32
>> bytes per internal page in total, while a bitmap consumes one bit per page, leaf or internal. If I'm doing
>> my math right, assuming the ratio of leaf pages vs internal pages is
>> 1:200, a List actually consumes more memory than a bitmap; 256 bits per
>> internal page, vs. 200 bits. An array, with 4 bytes per block number,
>> would be the winner here.
> We do not know size of this array beforehand. I can implement normal ArrayList though (with repallocing array) or linked list of chunks. Or anything from data structures zoo.
> Or just stick with bitmap (my preferred way).
Done.
>>
>>> But I have to note that default growth strategy of Bitmap is not good: we will be repallocing byte by byte.
>>
>> True, that repallocing seems bad. You could force it to be pre-allocated
>> by setting the last bit. Or add a function to explicitly enlarge the bitmap.
> OK, I'll think of proper resize function (ensure capacity, to be precise).
Done. Added function bms_make_empty(int size)
Best regards, Andrey Borodin.
Attachment | Content-Type | Size |
---|---|---|
0002-Delete-pages-during-GiST-VACUUM-v16.patch | application/octet-stream | 22.9 KB |
0001-Physical-GiST-scan-in-VACUUM-v16.patch | application/octet-stream | 16.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Nico Williams | 2018-08-06 18:26:55 | Re: [PATCH v18] GSSAPI encryption support |
Previous Message | Arseny Sher | 2018-08-06 18:06:13 | Re: [HACKERS] logical decoding of two-phase transactions |