Re: Problem with functional indexes - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Problem with functional indexes
Date
Msg-id 20030221195736.GA2920@wolff.to
Whole thread Raw
In response to Problem with functional indexes  (Diogo de Oliveira Biazus <diogo@ikono.com.br>)
Responses Re: Problem with functional indexes  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
On Fri, Feb 21, 2003 at 16:04:52 -0300,
  Diogo de Oliveira Biazus <diogo@ikono.com.br> wrote:
> Hi everybody,
> I'm having a problem with functional indexes.
>
> When I compare the function index using the "=" operator, it uses the index;
> Otherwise, if I use the "<>" operator it uses SeqScan...even when i set
> enable_seqscan to off.
>
> Ex.:
>  SELECT * FROM MyTable WHERE myFunction(myField) = 'just testing';
>  -> Works just fine.
>  SELECT * FROM MyTable WHERE myFunction(myField) <> 'just testing';
>  -> All I get is SeqScan...

I don't believe <> functions are generally going to be able to use indexes.
However, you really don't want to. The figure I have seen on these lists
is that if you are going to hit over 10% of the records a sequencial
scan is probably going to be faster.

pgsql-general by date:

Previous
From: Oleg Samoylov
Date:
Subject: Re: system catalog
Next
From: Arguile
Date:
Subject: Re: Best PostgreSQL Tuning Reference