pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: AI Rumman <rummandba@gmail.com>
To: pgsql-performance@postgresql.org
To: pgsql-general@postgresql.org
Subject: index is not using
Date: Tue, 9 Feb 2010 13:43:56 +0600
Message-ID: <2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com> (raw)

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.

view thread (9+ messages)  latest in thread

Message-ID: <2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com>
Permalink:  ../2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com/
Also on:    postgresql.org/message-id/2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: rummandba@gmail.com, pgsql-general@postgresql.org
  Subject: Re: index is not using
  In-Reply-To: <2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@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