On Dec 12, 2025, at 18:29, Daniel Gustafsson <[email protected]> wrote:

On 12 Dec 2025, at 11:27, Heikki Linnakangas <[email protected]> wrote:


If we're going to bother changing this at all, let's consider reusing the
buffer. So instead of initStringInfo()+pfree on every tuple, allocate it
once and use resetStringInfo().


+1



It looks like there’s no disagreement on the index_close() fix, while the
StringInfo change has triggered some discussion.

So I’ve split the fix into two commits, which I probably should have done
from the beginning. 0001 contains the index_close() fix, and 0002 contains
the StringInfo fix.

As Heikki suggested, I switched to using resetStringInfo() in 0002. One
thing I’d like to highlight is that this function only uses the StringInfo
buffer under certain conditions. If we initialize the StringInfo
unconditionally, that feels wasteful; if we initialize it lazily, as in
0002, then we need some extra checks to manage its state.


Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment: v2-0002-pageinspect-clean-up-StringInfo-usage-in-gist_pag.patch
Description: Binary data

Attachment: v2-0001-pageinspect-use-index_close-for-GiST-index-relati.patch
Description: Binary data

Reply via email to