Re: Weird row estimate

From: Marc Cousin <mcousin(at)sigma(dot)fr>
To: pgsql-performance(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Weird row estimate
Date: 2007-07-12 08:55:07
Message-ID: 200707121055.08230.mcousin@sigma.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Le Wednesday 11 July 2007 22:35:31 Tom Lane, vous avez écrit :
> Marc Cousin <mcousin(at)sigma(dot)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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2007-07-12 09:08:38 Re: PostgreSQL publishes first real benchmark
Previous Message Heikki Linnakangas 2007-07-12 08:50:42 Re: one column from huge view