Second pass at improving LIKE/regex estimation in non-C locales. It turns
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 9 Nov 2007 20:10:20 +0000 (20:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 9 Nov 2007 20:10:20 +0000 (20:10 +0000)
commitdc74396a81e0ef276de0ab1950a7910ebf427d74
treeedc12d9eb0a4912938758c8d1b59a64a29c3641b
parentc233d3b9294d185b9e469ddf5d2be0b7b5cd0ca4
Second pass at improving LIKE/regex estimation in non-C locales.  It turns
out that it's actually quite likely that a string that is an extension of
the given prefix will sort as larger than the "greater" string our previous
code created.  To provide some defense against that, do the comparisons
against a modified string instead of just the bare prefix.  We tack on
"Z", "z", "y", or "9", whichever is seen as largest in the current locale.
Testing suggests that this is sufficient at least for cases involving
ASCII data.
src/backend/utils/adt/selfuncs.c