Subject | Re: [firebird-support] Execution speed with update query |
---|---|
Author | setysvar |
Post date | 2016-01-07T20:57:05Z |
Den 06.01.2016 14:42, skrev Sonya Blade sonyablade2010@...
[firebird-support]:
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
[firebird-support]:
> update elements E set E.END_I = (select n.node_num from nodes NThe above query cannot possibly use any index for the nodes table (well,
> 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 )
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