Re: seq scan instead of index scan - Mailing list pgsql-performance

From Tom Lane
Subject Re: seq scan instead of index scan
Date
Msg-id 29683.1261117631@sss.pgh.pa.us
Whole thread Raw
In response to Re: seq scan instead of index scan  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Automatic optimization of IN clauses via INNER JOIN
Next
From: Sigurgeir Gunnarsson
Date:
Subject: Re: Issues with \copy from file