Re: [SQL] subselect instead of a view...

2002-11-26 Thread Dan Langille
On 26 Nov 2002 at 0:29, Tom Lane wrote: > "Dan Langille" <[EMAIL PROTECTED]> 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. The

Re: [SQL] subselect instead of a view...

2002-11-25 Thread Tom Lane
"Dan Langille" <[EMAIL PROTECTED]> 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

Re: [SQL] subselect instead of a view...

2002-11-25 Thread Dan Langille
On 25 Nov 2002 at 22:15, Dan Langille wrote: > I know this can be done better, I just can't figure out how. I keep > thinking of a subselect but I'm totally blocked. It must be bed time. It's odd what reading the paper, relaxing with a book, and then trying to sleep can generate. There I was,

[SQL] subselect instead of a view...

2002-11-25 Thread Dan Langille
Create view WLE_pathnames as SELECT E.name, EP.pathname FROM element E, element_pathnames EP, watch_list_element WLE WHERE WLE.watch_list_id = 3724 and WLE.element_id= E.id and E.id = EP.id; name | pathname -