Marc Cousin <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to