[GENERAL] Optimizing exists

2007-09-18 Thread Steve Crawford
Does the planner automatically add limit 1 to exists sub-selects? In other words, take an update like: update foo set itexists = exists (select 1 from bar where bar.something = foo.something); If the sub-select returns a large result set, will there be any benefit to adding limit 1 to the

Re: [GENERAL] Optimizing exists

2007-09-18 Thread Tom Lane
Steve Crawford [EMAIL PROTECTED] writes: If the sub-select returns a large result set, will there be any benefit to adding limit 1 to the sub-select or does the query planner automatically deduce that limit 1 is the correct interpretation? It does, although poking at it I notice a bit of a