getting ILIKE or ~* to use indexes.... - Mailing list pgsql-sql

From Rajesh Kumar Mallah.
Subject getting ILIKE or ~* to use indexes....
Date
Msg-id 200208101143.54041.mallah@trade-india.com
Whole thread Raw
Responses Re: getting ILIKE or ~* to use indexes....  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
Hi folks,

can anyone tell me or point me to the right thread.

I want my query to use indexes for company name searches but its not happening unless
is use '=' which does not server the purpose.

eg

tradein_clients=# explain SELECT co_name  FROM unified_data  where co_name  ilike '%rajesh%' ;
NOTICE:  QUERY PLAN:
Seq Scan on unified_data  (cost=0.00..19293.00 rows=1 width=25)
EXPLAIN
tradein_clients=# explain SELECT co_name  FROM unified_data  where co_name  = 'rajesh' ;
NOTICE:  QUERY PLAN:
Index Scan using unified_data_co_name_key on unified_data  (cost=0.00..6.26 rows=1 width=25)
EXPLAIN
tradein_clients=#


Regards
mallah.


--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.




pgsql-sql by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: retrieving all rows from a "tree" in one select - how ?
Next
From: "Josh Berkus"
Date:
Subject: Re: getting ILIKE or ~* to use indexes....