Re: Returning nbtree posting list TIDs in DESC order during backwards scans
| От | Peter Geoghegan |
|---|---|
| Тема | Re: Returning nbtree posting list TIDs in DESC order during backwards scans |
| Дата | |
| Msg-id | CAH2-Wz=YYoxSpUrPT+cofJQSAd=xEtBTTQX6FCxBhQSvbF-OhA@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Returning nbtree posting list TIDs in DESC order during backwards scans (Andy Fan <zhihuifan1213@163.com>) |
| Ответы |
Re: Returning nbtree posting list TIDs in DESC order during backwards scans
Re: Returning nbtree posting list TIDs in DESC order during backwards scans Re: Returning nbtree posting list TIDs in DESC order during backwards scans |
| Список | pgsql-hackers |
On Sun, Jul 27, 2025 at 9:43 AM Andy Fan <zhihuifan1213@163.com> wrote: > At last, I can get the same test result as you. The buffer hits go back to > 23 in the test case, thank for working on this! > > > I think that this patch isn't too far off being committable. > > I think so. Coming back to this patch now, after several months of work on index prefetching. I decided that it wasn't such a great idea to reuse/steal an unused "itemDead" bit from the BTScanPosItem.itemOffset field after all. That forces _bt_killitems to iterate through every so->currPos.item[], not just those that are known to require LP_DEAD marking. Tomas Vondra suggested that I keep killedItems as a separate allocation (as it is on master), while using a Bitmapset to represent killedItems (unlike on master, where it is represented using a simple array). This has all of the same advantages as my previous approach, but doesn't have the aforementioned disadvantages within _bt_killitems (plus we no longer need to change BTScanPosItem in any way). Attached is v4, which does it that way. My plan is to commit this improved version in the next couple of days. -- Peter Geoghegan
Вложения
В списке pgsql-hackers по дате отправления: