Wednesday, 26 October 2016

[firebird-support] Re: Optimizer request

 

On Wed, 19 Oct 2016 09:34:32 +0200 (CEST), ehmmm.firebird@seznam.cz [firebird-support] <firebird-support@yahoogroups.com> wrote:
>
> update orders o
> set o.something = 'something other'
> where o.delivery_date is null
>   and o.partid in (select p.partid from partners p where p.country='Spain')
>
> Would using EXISTS() help?
>

IIRC Firebird will optimize IN to EXISTS anyway, if possible.
Only way to really optimize this kind of update would be with
stored procedure or EXECUTE BLOCK. Like:

execute block as
declare variable partid integer;
begin
for select p.partid
from partners p
where p.country='Spain'
into :partid do
begin
update orders o set o.something = 'something other'
where o.delivery_date is null and o.partid = :partid;
end
end

--
Virgo Pärna
virgo.parna@mail.ee

__._,_.___

Posted by: Virgo =?UTF-8?Q?P=C3=A4rna?= <virgo.parna@mail.ee>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (27)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.

__,_._,___

No comments:

Post a Comment