nbtsort.c performs unneeded (though harmless) truncation - Mailing list pgsql-hackers

From Peter Geoghegan
Subject nbtsort.c performs unneeded (though harmless) truncation
Date
Msg-id CAH2-WzkAS2M3ussHG-s_Av=Zo6dPjOxyu5fNRkYnxQV+YzGQ4w@mail.gmail.com
Whole thread Raw
Responses Re: nbtsort.c performs unneeded (though harmless) truncation  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
I noticed that we're calling _bt_nonkey_truncate() needlessly when a
minimum key is needed at the leftmost page on each level of the tree.
This was always a special case, and I think that it should remain as
one. Attached patch avoids unneeded truncations, while preserving the
generic BTreeTupleGetNAtts() assertions.

This isn't a correctness issue, and the extra overhead of unneeded
truncation should be negligible, but what we have now seems confusing
to me.

-- 
Peter Geoghegan

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Support Python 3 tests under MSVC
Next
From: Peter Eisentraut
Date:
Subject: Re: [RFC] Add an until-0 loop in psql