ANALYZE dupindexcols;
EXPLAIN (COSTS OFF)
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
- QUERY PLAN
----------------------------------------------------------------------------------------
+ WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------------
Aggregate
-> Bitmap Heap Scan on dupindexcols
- Recheck Cond: ((f1 > 'WA'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
+ Recheck Cond: ((f1 >= 'WA'::text) AND (f1 <= 'ZZZ'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
-> Bitmap Index Scan on dupindexcols_i
- Index Cond: ((f1 > 'WA'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
+ Index Cond: ((f1 >= 'WA'::text) AND (f1 <= 'ZZZ'::text) AND (id < 1000) AND (f1 ~<~ 'YX'::text))
(5 rows)
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
count
-------
97
EXPLAIN (COSTS OFF)
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
SELECT count(*) FROM dupindexcols
- WHERE f1 > 'WA' and id < 1000 and f1 ~<~ 'YX';
+ WHERE f1 BETWEEN 'WA' AND 'ZZZ' and id < 1000 and f1 ~<~ 'YX';
--
-- Check ordering of =ANY indexqual results (bug in 9.2.0)