Re: index is not using

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: AI Rumman <rummandba(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: index is not using
Date: 2010-02-09 09:43:58
Message-ID: dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

I just answered this less than an hour ago... And please don't cross
post to multiple mailing lists.

On Tue, Feb 9, 2010 at 12:43 AM, AI Rumman <rummandba(at)gmail(dot)com> wrote:
> I have created a index
> create index leadaddress_phone_idx on
> leadaddress(regexp_replace((phone)::text, '[^0-9]*'::text, ''::text,
> 'g'::text));
>
> But the index is not using.
>
> explain select * from leadaddress where
> regexp_replace(phone,'[^0-9]*','','g') like '%2159438606';
>                                                QUERY
> PLAN
> --------------------------------------------------------------------------------------------------------
>  Seq Scan on leadaddress  (cost=100000000.00..100009699.81 rows=1 width=97)
>    Filter: (regexp_replace((phone)::text, '[^0-9]*'::text, ''::text,
> 'g'::text) ~~ '%2159438606'::text)
>
> Could anyone please tell me why? I analyzed the table after index creation.
>

--
When fascism comes to America, it will be intolerance sold as diversity.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2010-02-09 09:51:51 string reverse fucntion?
Previous Message Guillaume Lelarge 2010-02-09 09:34:04 Re: index is not using

Browse pgsql-performance by date

  From Date Subject
Next Message Albe Laurenz 2010-02-09 15:22:50 Re: foreign key constraint lock behavour in postgresql
Previous Message Guillaume Lelarge 2010-02-09 09:34:04 Re: index is not using