Re: [BUGS] Slow views

2004-07-18 Thread David Newall
On Sat, 2004-07-17 at 14:30, Tom Lane wrote: > David Newall <[EMAIL PROTECTED]> writes: > > select * from a join b optimises differently to select * from a join > > (select * from b) as b > > The above claim is provably false. Now, if you throw in some more > tables and sprinkle in a LEFT JOIN in

Re: [BUGS] Slow views

2004-07-18 Thread David Newall
On Sat, 2004-07-17 at 13:34, Tom Lane wrote: > I suspect the real issue is that the implied join order is not the same. With respect, the real issue is that using the view takes 100 times longer than not using it. > The view-based query is really > > a LEFT JOIN (b LEFT JOIN c LEFT JOIN d

Re: [BUGS] Slow views

2004-07-16 Thread Stephan Szabo
On Sat, 17 Jul 2004, David Newall wrote: > On Sat, 2004-07-17 at 13:34, Tom Lane wrote: > > I suspect the real issue is that the implied join order is not the same. > > With respect, the real issue is that using the view takes 100 times > longer than not using it. > > > The view-based query is rea

Re: [BUGS] Slow views

2004-07-16 Thread Tom Lane
David Newall <[EMAIL PROTECTED]> writes: > It's clearly an optimisation issue: No, it's an outer-join-semantics issue. > select * from a join b optimises differently to select * from a join > (select * from b) as b The above claim is provably false. Now, if you throw in some more tables and spr

Re: [BUGS] Slow views

2004-07-16 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > You also did an optimization, removing the subquery which PostgreSQL > isn't. I suspect the real issue is that the implied join order is not the same. The view-based query is really a LEFT JOIN (b LEFT JOIN c LEFT JOIN d LEFT JOIN e) while the

Re: [BUGS] Slow views

2004-07-16 Thread Stephan Szabo
On Sat, 10 Jul 2004 [EMAIL PROTECTED] wrote: > I know this has been discussed many times before but I'm not entirely > satisfied with the answer, which I understand is "views are essentially > macros". Despite that Postgres is producing the correct output, I hope > you'll all agree that the perf