I am querying across two tables, each of around 35000 records.
My sql is
select * from fieldcounts where prodnum in
(select prodnum from products where value < 150);
If I execute them individually, they return immediately. When I do an
explain, the fieldcounts is always accessed sequentially. It's accessed via
and Index Scan when I do...
select * from fieldcounts where prodnum in (65,66,45); for example
Why doesn't postgresql use an index scan when the subselect is a query?
Any ideas gratefully appreciated.