Optimizing "exists" - Mailing list pgsql-general

From Steve Crawford
Subject Optimizing "exists"
Date
Msg-id 46EFFE52.8070008@pinpointresearch.com
Whole thread Raw
Responses Re: Optimizing "exists"
List pgsql-general
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 sub-select or does the query planner
automatically deduce that "limit 1" is the correct interpretation?

Cheers,
Steve


pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: ON INSERT => execute AWK/SH/EXE?
Next
From: Steve Atkins
Date:
Subject: Re: ON INSERT => execute AWK/SH/EXE?