Re: Regarding Sequential Scans count increase each time we press refresh . - Mailing list pgsql-performance

From Tom Lane
Subject Re: Regarding Sequential Scans count increase each time we press refresh .
Date
Msg-id 7885.1254079033@sss.pgh.pa.us
Whole thread Raw
In response to Re: Regarding Sequential Scans count increase each time we press refresh .  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Sep 24, 2009 at 8:25 PM, Josh Berkus <josh@agliodbs.com> wrote:
>> You can't "turn off" sequential scans. �You can only make the planner
>> less likely to choose them. �But if there's no way to get the data you
>> need other than a seqscan, it's still going to do one.

> And that's not a bad thing.  For a very small table, it's often the
> fastest method.

Probably more to the point: if the query involves fetching the whole
table, it's *always* the fastest method.  (Except maybe if you want
the results sorted, and often it's the fastest way even so.)  Indexes
are not a panacea.

            regards, tom lane

pgsql-performance by date:

Previous
From: Robert Haas
Date:
Subject: Re: Slow query after upgrade to 8.4
Next
From: Kouber Saparev
Date:
Subject: LIMIT confuses the planner (again)