The originally-chosen test case gives different results in es_EC locale
because of unusual rule for sorting strings beginning with "LL". Adjust
the comparison value to avoid that, while hopefully not introducing new
locale dependencies elsewhere. Per report from Jaime Casanova.
VACUUM ANALYZE dupindexcols;
EXPLAIN (COSTS OFF)
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'LX' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 > 'MA' and id < 1000 and f1 ~<~ 'YX';
QUERY PLAN
---------------------------------------------------------------------------------
Aggregate
-> Index Only Scan using dupindexcols_i on dupindexcols
- Index Cond: ((f1 > 'LX'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
+ Index Cond: ((f1 > 'MA'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
(3 rows)
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'LX' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 > 'MA' and id < 1000 and f1 ~<~ 'YX';
count
-------
- 500
+ 497
(1 row)
EXPLAIN (COSTS OFF)
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'LX' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 > 'MA' and id < 1000 and f1 ~<~ 'YX';
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'LX' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 > 'MA' and id < 1000 and f1 ~<~ 'YX';