Skip site navigation (1) Skip section navigation (2)

Re: bad execution plan for subselects containingwindowing-function

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: bad execution plan for subselects containingwindowing-function
Date: 2010-01-14 17:30:25
Message-ID: 20100114173025.GA8675@tux (view raw or flat)
Thread:
Lists: pgsql-performance
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Andreas Kretschmer <akretschmer(at)spamfence(dot)net> writes:
> > No question, this is a silly query, but the problem is the 2nd query: it
> > is obviously not possible for the planner to put the where-condition
> > into the subquery.
> 
> Well, yeah: it might change the results of the window functions.
> I see no bug here.  Your second query asks for a much more complicated
> computation, it's not surprising it takes longer.

Thank you for the fast answer.

But sorry, I disagree. It is the same query with the same result. I can't see
how the queries should return different results.

What have i overlooked?


tia, Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2010-01-14 17:42:05
Subject: Re: bad execution plan for subselects containing windowing-function
Previous:From: Tom LaneDate: 2010-01-14 17:15:36
Subject: Re: bad execution plan for subselects containing windowing-function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group