getting ILIKE or ~* to use indexes....

From: "Rajesh Kumar Mallah(dot)" <mallah(at)trade-india(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: getting ILIKE or ~* to use indexes....
Date: 2002-08-10 06:13:54
Message-ID: 200208101143.54041.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-08-10 18:10:16 Re: getting ILIKE or ~* to use indexes....
Previous Message Oleg Bartunov 2002-08-09 23:37:52 Re: retrieving all rows from a "tree" in one select - how ?