]> granicus.if.org Git - postgresql/commit
Avoid detoast in texteq/textne/byteaeq/byteane for unequal-length strings.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 18 Jan 2011 19:09:22 +0000 (14:09 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 18 Jan 2011 19:11:54 +0000 (14:11 -0500)
commit1b393f4e5db4fd6bbc86a4e88785b6945a1541d0
tree3351618fc9ed842cf1f3f2d301594ec261565836
parent6e1726d082b5a9c305ed44a69ff50bc3407d01a2
Avoid detoast in texteq/textne/byteaeq/byteane for unequal-length strings.

We can get the length of a compressed or out-of-line datum without actually
detoasting it.  If the lengths of two strings are unequal, we can then
conclude they are unequal without detoasting.  That saves considerable work
in an admittedly less-common case, without costing anything much when the
optimization doesn't apply.

Noah Misch
src/backend/utils/adt/varlena.c