From: Marc Cousin <mcousin@sigma.fr>
To: pgsql-performance@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: Weird row estimate
Date: Thu, 12 Jul 2007 10:55:07 +0200
Message-ID: <200707121055.08230.mcousin@sigma.fr> (raw)
In-Reply-To: <2393.1184186131@sss.pgh.pa.us>
References: <200707111728.43416.mcousin@sigma.fr>
<2393.1184186131@sss.pgh.pa.us>
Le Wednesday 11 July 2007 22:35:31 Tom Lane, vous avez écrit :
> 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.
Yes, it's much better on this query with a UNION.
The problem is that this is a small set of the query, and there are several
nested IN with an OR condition... But at least now I understand where it
comes from.
Thanks a lot.
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: mcousin@sigma.fr, tgl@sss.pgh.pa.us
Subject: Re: Weird row estimate
In-Reply-To: <200707121055.08230.mcousin@sigma.fr>
* 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