drop table if exists tb;
create table tb (a int, b text);
insert into tb select n, '1234567890' from generate_series(1, 100000) as n;
create index idx on tb(a);
ANALYZE tb;
explain select * from tb where a between 5000 and 5001;
QUERY PLAN
---------------------------------------------------------------
Index Scan using idx on tb (cost=0.29..8.33 rows=2 width=15)
Index Cond: ((a >= 5000) AND (a <= 5001))