Re: Range search on primary key does not use index scan

2020-12-23 Thread Tom Lane
Shantanu Shekhar writes: > (2) Here I am searching for employee_id < 123. I was expecting the plan would > use the index on employees_pk to find all leaf nodes where employee_id < 123 > and then issue read of table blocks for each of the matching entries in the > index leaf. But looks like the

Range search on primary key does not use index scan

2020-12-23 Thread Shantanu Shekhar
I am trying to understand how Postgres uses index and ran into a surprising behavior if someone can help me with. I have a table like so: CREATE TABLE testschema.employees (        employee_id integer not null, first_name  varchar(1000) not null, last_name   varchar(1000) not null, date_of_birth