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

Re: The optimizer is too smart for me - How can I trick it?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Peter Vanderborght <peter(dot)vanderborght(at)taatu(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: The optimizer is too smart for me - How can I trick it?
Date: 2008-05-30 16:30:21
Message-ID: 20080530163021.GC18339@svana.org (view raw or flat)
Thread:
Lists: pgsql-general
On Fri, May 30, 2008 at 10:49:21AM +0200, Peter Vanderborght wrote:
> What can I do to tell the optimizer to keep its hands off my query or at
> least get it to not optimize?

The usual trick is you put an OFFSET 0 in the subquery, which prevents
the optimiser from pulling it up.

Have a nice day.
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

In response to

pgsql-general by date

Next:From: Scott MarloweDate: 2008-05-30 16:57:19
Subject: Re: Query planning configuration and solid state drives
Previous:From: PJDate: 2008-05-30 15:58:43
Subject: phpeclipse debugging & setup

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