Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karl Denninger <karl@xxxxxxxxxxxxx> wrote:
Kevin Grittner wrote:
 
>> I suspect that the above might do pretty well in 8.4.
 
> "Exists" can be quite slow.  So can "not exists"
> 
> See if you can re-write it using a sub-select - just replace the
> "exists ...." with "(select ...) is not null"
> 
> Surprisingly this often results in a MUCH better query plan under
> Postgresql.  Why the planner evaluates it "better" eludes me (it
> shouldn't) but the differences are often STRIKING - I've seen
> factor-of-10 differences in execution performance.
 
Have you seen such a difference under 8.4?  Can you provide a
self-contained example?
 
-Kevin

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux