agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Дмитрий <[email protected]>
To: Tom Lane <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Postgres 8.4 planner question - bad plan, good plan for almost same queries.
Date: Wed, 21 Mar 2012 17:42:22 +0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

> I think the reason the planner isn't too bright about this case is
> http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=cd1f0d04bf06938c0ee5728fc8...
> ie, it won't do IN/EXISTS pullup below a NOT EXISTS.
>
> HEAD is better, thanks to commit
> 0816fad6eebddb8f1f0e21635e46625815d690b9, but of course there is no
> chance at all of back-patching the planner changes that depends on.

I found that it works fine for [NOT] EXISTS if I just fold query inside 
into "select 1 from (...) vv". With my provided query, it uses seqscan 
for both EXISTS/NOT EXISTS without folding, and index scan with it.

Okay, it's easier for me to make automatic subquery folding.

Regards,
Dmitry



view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Postgres 8.4 planner question - bad plan, good plan for almost same queries.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox