> On 5 Jul 2024, at 23:46, Paul Jungwirth <pj@illuminatedcomputing.com> wrote:
>
> this commit adds support for all combinations of int2/int4/int8 for all five btree operators (</<=/=/>=/>).
Looks like a nice feature to have.
Would it make sense to do something similar to float8? Or, perhaps, some other types from btree_gist?
Also, are we sure such tests will be stable?
+SET enable_seqscan=on;
+-- It should use the index with a different integer width:
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM int4tmp WHERE a = smallint '42';
+ QUERY PLAN
+------------------------------------------------
+ Aggregate
+ -> Bitmap Heap Scan on int4tmp
+ Recheck Cond: (a = '42'::smallint)
+ -> Bitmap Index Scan on int4idx
+ Index Cond: (a = '42'::smallint)
Best regards, Andrey Borodin.