pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Cousin <mcousin@sigma.fr>
Cc: pgsql-performance@postgresql.org
Subject: Re: Weird row estimate
Date: Wed, 11 Jul 2007 16:35:31 -0400
Message-ID: <2393.1184186131@sss.pgh.pa.us> (raw)
In-Reply-To: <200707111728.43416.mcousin@sigma.fr>
References: <200707111728.43416.mcousin@sigma.fr>

Marc Cousin <mcousin@sigma.fr> writes:
> Nevertheless, shouldn't the third estimate be smaller or equal to the sum of the two others ?

The planner's estimation for subplan conditions is pretty primitive
compared to joinable conditions.  When you add the OR, it's no longer
possible to treat the IN like a join, and everything gets an order of
magnitude dumber :-(

It might be worth trying this as a UNION of the two simple queries.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <2393.1184186131@sss.pgh.pa.us>
Permalink:  ../2393.1184186131@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2393.1184186131@sss.pgh.pa.us

 · 

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: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mcousin@sigma.fr
  Subject: Re: Weird row estimate
  In-Reply-To: <2393.1184186131@sss.pgh.pa.us>

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

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