pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: AI Rumman <rummandba@gmail.com>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: index is not using
Date: Tue, 9 Feb 2010 02:43:58 -0700
Message-ID: <dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com> (raw)
In-Reply-To: <2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com>
References: <2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com>

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@gmail.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.



view thread (9+ messages)  latest in thread

Message-ID: <dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com>
Permalink:  ../dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: scott.marlowe@gmail.com, rummandba@gmail.com, pgsql-general@postgresql.org
  Subject: Re: index is not using
  In-Reply-To: <dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com>
  References: <2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com> <dcc563d11002090143s4b2d81eeie14a7fbf619a1d48@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox