postgresql/contrib/btree_gist
Tom Lane f504baaf55 Make contrib/btree_gist's GiST penalty function a bit saner.
The previous coding supposed that the first differing bytes in two varlena
datums must have the same sign difference as their overall comparison
result.  This is obviously bogus for text strings in non-C locales, and
probably wrong for numeric, and even for bytea I think it was wrong on
machines where char is signed.  When the assumption failed, the function
could deliver a zero or negative penalty in situations where such a result
is quite ridiculous, leading the core GiST code to make very bad page-split
decisions.

To fix, take the absolute values of the byte-level differences.  Also,
switch the code to using unsigned char not just char, so that the behavior
will be consistent whether char is signed or not.

Per investigation of a trouble report from Tomas Vondra.  Back-patch to all
supported branches.
2013-02-07 19:14:17 -05:00
..
data
expected Add alternative expected output files for cs_CZ locale for btree_gist and 2009-05-08 14:48:06 +00:00
sql Fix a few contrib regression test scripts that hadn't gotten the word 2007-11-13 06:29:04 +00:00
.gitignore Some more gitignore cleanups: cover contrib and PL regression test outputs. 2010-09-22 17:22:53 -04:00
btree_bit.c Ooops, missed that a couple of contrib modules have calls to byteacmp. 2009-08-04 18:49:50 +00:00
btree_bytea.c Ooops, missed that a couple of contrib modules have calls to byteacmp. 2009-08-04 18:49:50 +00:00
btree_cash.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_date.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_float4.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_float8.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_gist.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_gist.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_gist.sql.in Mark contrib's GiST and GIN opclass support functions as STRICT, for safety. 2009-06-11 18:30:03 +00:00
btree_inet.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_int2.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_int4.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_int8.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_interval.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_macaddr.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_numeric.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_oid.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_text.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_time.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_ts.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
btree_utils_num.c 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_utils_num.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
btree_utils_var.c Make contrib/btree_gist's GiST penalty function a bit saner. 2013-02-07 19:14:17 -05:00
btree_utils_var.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
Makefile
uninstall_btree_gist.sql Push index operator lossiness determination down to GIST/GIN opclass 2008-04-14 17:05:34 +00:00