Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 40E924758EC for ; Sat, 10 Aug 2002 02:10:49 -0400 (EDT) Received: from mail-relay.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 4BCFB47546E for ; Sat, 10 Aug 2002 02:10:45 -0400 (EDT) Received: (qmail 6744 invoked from network); 10 Aug 2002 05:58:38 -0000 Received: from system67.trade-india-local.com (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 10 Aug 2002 05:58:38 -0000 Content-Type: text/plain; charset="us-ascii" From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: pgsql-sql@postgresql.org Subject: getting ILIKE or ~* to use indexes.... Date: Sat, 10 Aug 2002 11:43:54 +0530 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200208101143.54041.mallah@trade-india.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/176 X-Sequence-Number: 9022 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 happen= ing unless is use '=3D' which does not server the purpose. eg tradein_clients=3D# explain SELECT co_name FROM unified_data where co_nam= e ilike '%rajesh%' ; NOTICE: QUERY PLAN: Seq Scan on unified_data (cost=3D0.00..19293.00 rows=3D1 width=3D25) EXPLAIN tradein_clients=3D# explain SELECT co_name FROM unified_data where co_nam= e =3D 'rajesh' ; NOTICE: QUERY PLAN: Index Scan using unified_data_co_name_key on unified_data (cost=3D0.00..6.= 26 rows=3D1 width=3D25) EXPLAIN tradein_clients=3D# Regards mallah. --=20 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.