I have a table where the primary key "id" is a serial key.
now i have a query to this table where in, i have to get information related to a set of ids.
This set contains around 130 ids.
I was thinking that i can form a select statement of the form
select * from table where id in(4,8,9,12, and so on....);
i was testing this query on the table with 3000 rows only...
and when i did
explain analyze select * from table where id in(4,8,9,12, and so on....);..
it said that it was doing a sequential scan.
why is it not searching the indexes(index scan)? and how can i make such a query much faster?