Aha! šGreat! Thanks a lot! That worked!explain select * from a where x=3;
PostgreSQL is treating 3 as an int4 (integer) type, whereas x is an int2
(smallint) type. Try casting the constant as a smallint and it should use
the index:
explain select * from a where x=3::smallint;