Re: Strange query plan

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: "Dmitry Teslenko" <dteslenko(at)gmail(dot)com>
Subject: Re: Strange query plan
Date: 2008-08-14 11:30:37
Message-ID: 200808141430.37967.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Thursday, 14. August 2008 schrieb Dmitry Teslenko:
> SELECT SUM(...) FROM table1 WHERE field3 = 'ABC' AND field1 <> 1
> GROUP BY field2
>
> And planner picks up a sequential scan of a table. Why does he?

Presumably because it thinks it is the best plan, and I see no reason to doubt
that outright. You might get better performance with an index on field3.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2008-08-14 11:33:47 Re: Postgres 8.3 is not using indexes
Previous Message Peter Eisentraut 2008-08-14 11:27:21 Re: Postgres 8.3 is not using indexes