Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0A05A475C22 for ; Tue, 26 Nov 2002 00:29:30 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 3CAF2475C45 for ; Tue, 26 Nov 2002 00:29:29 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id gAQ5TTsX006004; Tue, 26 Nov 2002 00:29:30 -0500 (EST) To: "Dan Langille" Cc: pgsql-sql@postgresql.org Subject: Re: subselect instead of a view... In-reply-to: <3DE2BB41.18930.D5AA1552@localhost> References: <3DE2BB41.18930.D5AA1552@localhost> Comments: In-reply-to "Dan Langille" message dated "Tue, 26 Nov 2002 00:07:29 -0500" Date: Tue, 26 Nov 2002 00:29:29 -0500 Message-ID: <6003.1038288569@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/360 X-Sequence-Number: 10502 "Dan Langille" writes: > SELECT E.name, EP.pathname, E.id, EP2.pathname, CL.id > ... > and EP2.pathname like EP.pathname || '/%' > I am still suspicous of that like. It seems to be the performance > killer here. There is an index which can be used: It won't be, though. The LIKE-to-indexscan transformation happens at plan time, and that means it can only happen if the pattern is a constant. Which it surely will not be in your example. regards, tom lane