On Wed, Feb 12, 2014 at 3:30 PM, Martijn van Oosterhout <klep...@svana.org> wrote: > (A bit late to the party). This idea has come up before and the most > annoying thing is that braindead strxfrm api. Namely, to strxfrm a > large strings you need to strxfrm it completely even if you only want > the first 8 bytes.
I think that in general strxfrm() must have that property. However, it does not obligate us to store the entire string, provided that we don't trust blob comparisons that indicate equality (since I believe that we cannot do so generally with a non-truncated blob, we might as well take advantage of this, particularly given we're doing this with already naturally dissimilar inner pages, where we'll mostly get away with truncation provided there is a reliable tie-breaker). Besides all this, I'm not particularly worried about the cost of calling strxfrm() if that only has to occur when a page split occurs, as we insert a downlink into the parent page. The big picture here is that we can exploit the properties of inner pages to do the smallest amount of work for the largest amount of benefit. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers