Den 06.01.2016 14:42, skrev Sonya Blade [email protected]
[firebird-support]:
> update elements E set E.END_I = (select n.node_num from nodes N
> where abs(E.X_I -N.XI)<0.001 and abs(E.Y_I - N.YI)<0.001 and
> abs(E.Z_I-N.ZI)<0.001 )
The above query cannot possibly use any index for the nodes table (well,
I'm a bit uncertain about indexes defined with COMPUTED BY, but I doubt
they can involve fields of several tables). Try changing to:
update elements E set E.END_I = (select n.node_num from nodes N
where N.XI between E.X_I - 0.001 and E.X_I +
0.001
and N.YI between E.Y_I - 0.001 and E.Y_I +
0.001
and N.ZI between E.Z_I - 0.001 and E.Z_I +
0.001 )
If you have indexes for N.XI, N.YI and/or N.ZI and the nodes table
contain a not too small number of records, you may observe a significant
performance improvement.
HTH,
Set
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/