X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 241159FA5B5 for ; Mon, 5 Jun 2006 16:29:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 69247-01 for ; Mon, 5 Jun 2006 16:29:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 515569FA30C for ; Mon, 5 Jun 2006 16:29:26 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 23E7C313E3; Mon, 5 Jun 2006 21:29:25 +0200 (MET DST) From: "Andrus" X-Newsgroups: pgsql.performance Subject: How to force Postgres to use index on ILIKE Date: Mon, 5 Jun 2006 22:29:11 +0300 Organization: Hub.Org Networking Services Lines: 17 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/39 X-Sequence-Number: 19396 I have UTF-8 Postgres 8.1 database on W2K3 Query SELECT toode, nimetus FROM toode WHERE toode ILIKE 'x10%' ESCAPE '!' ORDER BY UPPER(toode ),nimetus LIMIT 100 runs 1 minute in first time for small table size. Toode field type is CHAR(20) How to create index on toode field so that query can use it ?