index is not using - Mailing list pgsql-general

From AI Rumman
Subject index is not using
Date
Msg-id 2a7905441002082343g1dd0c8ebg5a27f7d44ec9fdb1@mail.gmail.com
Whole thread Raw
Responses Re: index is not using  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: index is not using  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
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.

 

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Order by and strings
Next
From: Guillaume Lelarge
Date:
Subject: Re: index is not using