X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 499BFD1E0FD for ; Wed, 31 Mar 2004 00:16:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 50033-08 for ; Tue, 30 Mar 2004 20:16:46 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 509D1D1DF1F for ; Tue, 30 Mar 2004 20:16:43 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i2V0GiAO026841; Tue, 30 Mar 2004 19:16:44 -0500 (EST) To: Palle Girgensohn Cc: pgsql-performance@postgresql.org Subject: Re: LIKE should use index when condition doesn't include wildcard In-reply-to: <145170000.1080688008@palle.girgensohn.se> References: <145170000.1080688008@palle.girgensohn.se> Comments: In-reply-to Palle Girgensohn message dated "Wed, 31 Mar 2004 01:06:48 +0200" Date: Tue, 30 Mar 2004 19:16:44 -0500 Message-ID: <26840.1080692204@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/431 X-Sequence-Number: 6287 Palle Girgensohn writes: > Shouldn't the optimizer use indices if the like condition does not have any > wildcards? I can't get excited about this; if you are depending on LIKE to be fast then you should have locale-insensitive indexes in place to support it. Switching the tests around so that this special case is supported even with an index that doesn't otherwise support LIKE would complicate the code unduly IMHO, to support a rather pointless corner case... regards, tom lane