Optimizing "exists"

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Optimizing "exists"
Date: 2007-09-18 16:35:30
Message-ID: 46EFFE52.8070008@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2007-09-18 16:36:26 tradeoffs for multi-schema or multi-db
Previous Message Erik Jones 2007-09-18 16:33:44 Re: ON INSERT => execute AWK/SH/EXE?