Re: Weird row estimate

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Patric de Waha 2007-07-11 20:48:51 Re: Two questions.. shared_buffers and long reader issue
Previous Message Francisco Reyes 2007-07-11 20:34:46 Re: WALL on controller without battery?