Re: subselect instead of a view...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dan Langille" <dan(at)langille(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: subselect instead of a view...
Date: 2002-11-26 05:29:29
Message-ID: 6003.1038288569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Dan Langille" <dan(at)langille(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Padmanab Sridhar 2002-11-26 06:14:34 How to recover Data
Previous Message Martin Crundall 2002-11-26 05:13:04 celko nested set functions -- tree move