1set enable_seqscan=off; 2CREATE TABLE test_int2 ( 3 i int2 4); 5INSERT INTO test_int2 VALUES (-2),(-1),(0),(1),(2),(3); 6CREATE INDEX idx_int2 ON test_int2 USING gin (i); 7SELECT * FROM test_int2 WHERE i<1::int2 ORDER BY i; 8 i 9---- 10 -2 11 -1 12 0 13(3 rows) 14 15SELECT * FROM test_int2 WHERE i<=1::int2 ORDER BY i; 16 i 17---- 18 -2 19 -1 20 0 21 1 22(4 rows) 23 24SELECT * FROM test_int2 WHERE i=1::int2 ORDER BY i; 25 i 26--- 27 1 28(1 row) 29 30SELECT * FROM test_int2 WHERE i>=1::int2 ORDER BY i; 31 i 32--- 33 1 34 2 35 3 36(3 rows) 37 38SELECT * FROM test_int2 WHERE i>1::int2 ORDER BY i; 39 i 40--- 41 2 42 3 43(2 rows) 44 45