Greg Smith <greg@2ndquadrant.com> writes:
> Karl Larsson wrote:
>> When I make a subquery Postgres don't care about my indexes and makes
>> a seq scan instead of a index scan. Why?
> Data set is just too small for it to matter. Watch what happens if I
> continue from what you posted with much bigger tables:
> ...
> There's the index scan on both tables that you were expecting.
And if you go much past that, it's likely to switch *away* from
indexscans again (eg, to a hash join, which has no use for ordered
input). This is not wrong. Indexes have their place but they are not
the solution for every query.
regards, tom lane