Re: subselect instead of a view... - Mailing list pgsql-sql

From Tom Lane
Subject Re: subselect instead of a view...
Date
Msg-id 6003.1038288569@sss.pgh.pa.us
Whole thread Raw
In response to Re: subselect instead of a view...  ("Dan Langille" <dan@langille.org>)
Responses Re: subselect instead of a view...  ("Dan Langille" <dan@langille.org>)
List pgsql-sql
"Dan Langille" <dan@langille.org> 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


pgsql-sql by date:

Previous
From: "Martin Crundall"
Date:
Subject: celko nested set functions -- tree move
Next
From: "Ferruccio Zamuner"
Date:
Subject: PL/SQL trouble