X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 453599FB220 for ; Tue, 19 Sep 2006 00:17:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 62029-10 for ; Tue, 19 Sep 2006 03:17:12 +0000 (UTC) X-Greylist: delayed 03:29:02.112411 by SQLgrey- Received: from extranet.squiz.net (extranet.squiz.net [203.222.154.144]) by postgresql.org (Postfix) with ESMTP id EECD19FB1D2 for ; Tue, 19 Sep 2006 00:17:06 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by extranet.squiz.net (Postfix) with ESMTP id 24D0C782AF; Tue, 19 Sep 2006 13:16:50 +1000 (EST) Received: from extranet.squiz.net ([127.0.0.1]) by localhost (intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22949-06; Tue, 19 Sep 2006 13:16:50 +1000 (EST) Received: from [192.168.0.235] (unknown [192.168.0.235]) by extranet.squiz.net (Postfix) with ESMTP id 04C637061C; Tue, 19 Sep 2006 13:16:50 +1000 (EST) Message-ID: <450F6120.6010208@squiz.net> Date: Tue, 19 Sep 2006 13:16:48 +1000 From: Marc McIntyre User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: LIKE query problem References: <450F303A.6090603@squiz.net> <26900.1158634219@sss.pgh.pa.us> In-Reply-To: <26900.1158634219@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at squiz.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/243 X-Sequence-Number: 20929 Thanks Tom, Is that documented somewhere? I can't seem to see any mention of it in the docs. Tom Lane wrote: > Marc McIntyre writes: > >> ... Is there a way to perform this efficiently in one query ? >> > > No, because you're hoping for an indexscan optimization of a LIKE > query, and that can only happen if the pattern is a plan-time constant. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > >