Re: heapgettup refactoring
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Melanie Plageman <melanieplageman@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Andres Freund <andres@anarazel.de>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2023-02-07T04:40:13Z
Lists: pgsql-hackers
Attachments
- remove_HeapScanDescData_rs_inited_field.patch (text/plain) patch
On Fri, 3 Feb 2023 at 15:26, David Rowley <dgrowleyml@gmail.com> wrote: > I've pushed all but the final 2 patches now. I just pushed the final patch in the series. I held back on moving the setting of rs_inited back into the heapgettup_initial_block() helper function as I wondered if we should even keep that field. It seems that rs_cblock == InvalidBlockNumber in all cases where rs_inited == false, so maybe it's better just to use that as a condition to check if the scan has started or not. I've attached a patch which does that. I ended up adjusting HeapScanDescData more than what is minimally required to remove rs_inited. I wondered if rs_cindex should be closer to rs_cblock in the struct so that we're more likely to be adjusting the same cache line than if that field were closer to the end of the struct. We don't need rs_coffset and rs_cindex at the same time, so I made it a union. I see that the struct is still 712 bytes before and after this change. I've not yet tested to see if there are any performance gains to this change. David
Commits
-
Remove stray duplicated comment in heapam.h
- 9ed50ab3496f 16.0 landed
-
More refactoring of heapgettup() and heapgettup_pagemode()
- cfcf56f92398 16.0 landed
-
Run pgindent on heapam.c
- 009dbdea02d7 16.0 landed
-
Push lpp variable closer to usage in heapgetpage()
- e351f8541831 16.0 landed
-
Variable renaming in preparation for refactoring
- 8e1db29cdbbd 16.0 landed
-
Turn HeapKeyTest macro into inline function
- 4eb3b1120001 16.0 landed
-
Remove unused include
- c0f1e51ac79e 16.0 landed
-
Remove redundant breaks in HeapTupleSatisfiesVisibility
- c3652cd84ac8 16.0 landed