Re: BUG #2953: index scan, feature request - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2953: index scan, feature request
Date
Msg-id 13719.1170382671@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2953: index scan, feature request  ("michael" <miblogic@yahoo.com>)
Responses Re: BUG #2953: index scan, feature request  (Magnus Hagander <magnus@hagander.net>)
List pgsql-bugs
"michael" <miblogic@yahoo.com> writes:
> can these be executed with index seek like what MS SQL does?
> select * from account_category
> where account_category_full_description <> 'MICHAEL'

What for?  A query like that is generally going to fetch the majority of
the table, so an indexscan would be counterproductive.

It could potentially be a win if a very large fraction of the rows had
the exact value MICHAEL ... but the recommended way to deal with that is
to create a partial index with "full_description <> 'MICHAEL'" as the
WHERE clause.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "michael"
Date:
Subject: BUG #2953: index scan, feature request
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #2952: where is the user guide