Re: BUG #2953: index scan, feature request

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "michael" <miblogic(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2953: index scan, feature request
Date: 2007-02-02 02:17:51
Message-ID: 13719.1170382671@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"michael" <miblogic(at)yahoo(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Toshi Harada 2007-02-02 05:29:48 BUG #2956: ECPG does not treat multibyte characters correctly.
Previous Message Sergiy Vyshnevetskiy 2007-02-01 21:51:32 Re: BUG #2948: default null values for not-null domains