Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3401A4767CE for ; Tue, 26 Nov 2002 10:17:35 -0500 (EST) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by postgresql.org (Postfix) with ESMTP id 702A14766AE for ; Tue, 26 Nov 2002 10:17:22 -0500 (EST) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id 8CFB83F4B; Tue, 26 Nov 2002 10:17:26 -0500 (EST) From: "Dan Langille" To: Tom Lane Date: Tue, 26 Nov 2002 10:17:26 -0500 MIME-Version: 1.0 Subject: Re: subselect instead of a view... Cc: pgsql-sql@postgresql.org Message-ID: <3DE34A36.29690.D7D88D0C@localhost> References: <3DE2BB41.18930.D5AA1552@localhost> In-reply-to: <6003.1038288569@sss.pgh.pa.us> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/390 X-Sequence-Number: 10532 On 26 Nov 2002 at 0:29, Tom Lane wrote: > "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. Thanks. I'll see if I can come up with something else to do this. -- Dan Langille : http://www.langille.org/