X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6B325D1B1FD for ; Thu, 22 Jul 2004 09:41:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02687-10 for ; Thu, 22 Jul 2004 12:41:23 +0000 (GMT) Received: from curie.credativ.org (credativ.com [217.160.209.18]) by svr1.postgresql.org (Postfix) with ESMTP id D91F1D1B343 for ; Thu, 22 Jul 2004 09:41:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by curie.credativ.org (Postfix) with ESMTP id 27F0A55EC0; Thu, 22 Jul 2004 14:41:20 +0200 (CEST) Received: from www.credativ.de (pD95012DF.dip0.t-ipconnect.de [217.80.18.223]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by curie.credativ.org (Postfix) with ESMTP id CDFFA55EAE; Thu, 22 Jul 2004 14:41:09 +0200 (CEST) Received: from bell.credativ.de (bell.credativ.de [172.26.14.16]) by www.credativ.de (Postfix) with ESMTP id E86291C0004; Thu, 22 Jul 2004 14:41:07 +0200 (CEST) From: Peter Eisentraut To: "Chris Cox" Subject: Re: LIKE on index not working Date: Thu, 22 Jul 2004 14:41:04 +0200 User-Agent: KMail/1.6.2 Cc: References: <030e01c46fbe$e8baeb90$5100000a@PHOENIX> In-Reply-To: <030e01c46fbe$e8baeb90$5100000a@PHOENIX> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407221441.05497.peter_e@gmx.net> X-Virus-Scanned: by AMaViS at credativ.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/175 X-Sequence-Number: 18427 Am Donnerstag, 22. Juli 2004 09:38 schrieb Chris Cox: > For some reason I just can't get this to use the index for the following > query. I'm using PostgreSQL 7.3.4. In 7.3, LIKE cannot use an index unless you set the locale to C. In 7.4, LIKE can use an index, but it has to be a different kind of index, as explained here: http://www.postgresql.org/docs/7.4/static/indexes-opclass.html -- Peter Eisentraut http://developer.postgresql.org/~petere/