Re: Returning nbtree posting list TIDs in DESC order during backwards scans
В списке pgsql-hackers по дате отправления:
| От | Chao Li |
|---|---|
| Тема | Re: Returning nbtree posting list TIDs in DESC order during backwards scans |
| Дата | |
| Msg-id | 9EDF07A2-F7CC-417A-94ED-3DF6EAE3C106@gmail.com обсуждение |
| Ответ на | Re: Returning nbtree posting list TIDs in DESC order during backwards scans (Peter Geoghegan <pg@bowt.ie>) |
| Список | pgsql-hackers |
> On Dec 4, 2025, at 01:31, Peter Geoghegan <pg@bowt.ie> wrote:
>
>
> Note also that we'll use much less memory for killedItems by
> representing it as a Bitmapset. We'll use at most one bit per
> so->currPos.items[] item, whereas before we used 4 bytes per item.
>
That’s true, BitmapSet saves 7/8 of memory usage for killedItems. However, it also brings a little performance burden,
becausebms_next_member() does O(N) iteration. Say so->curPos.items[] = {0, 1000}, the old code directly gives 0 and
1000to the “for” loop, but the new code needs to iterate over 999 bits to get next member 1000. Maybe that’s
affordable.
Actually MaxTIDsPerBTreePage (max length of so->curPos.items[]) is a value around 1000, in the old code, killedItems
couldbe “short *” instead of “int *”, which may also save a half of memory usage.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера