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

Re: bad execution plan for subselects containing windowing-function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: bad execution plan for subselects containing windowing-function
Date: 2010-01-14 17:15:36
Message-ID: 25448.1263489336@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
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.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Andreas KretschmerDate: 2010-01-14 17:30:25
Subject: Re: bad execution plan for subselects containingwindowing-function
Previous:From: Andreas KretschmerDate: 2010-01-14 17:03:18
Subject: bad execution plan for subselects containing windowing-function

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