My executed SQL query is as follow :

```
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
                  )

```

It takes about 24 secs to complete, I read about firebird troubleshooting [Why is my database query slow?](http://www.firebirdfaq.org/faq13/) It instructs to create indices for the related fields in table and I've added the decreasing/increasing indices for the XI, YI, ZI fields in both of the Nodes and Elements tables. But still the performance is very slow, there 6677 rows in database and I'm using the FlameRobin as SQL editor. 

Interesting thing is: As depicted in Firebird troubleshooting guide having 

> 
> If you see a NATURAL plan going against a big table, you've found the
>  problem
> 
> 
> 

this error is described as bad case and source of slow down, recommended solution is, create decreasing indices for related fields. But in my case even after defining the indices it seems that I'm still suffering from that PLAN (N NATURAL), PLAN (E NATURAL) which is reported in Flamerobin output as shown below. 

How am I supposed to eliminate that?

```
Preparing query: 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 )
Prepare time: 0.004s
PLAN (N NATURAL)
PLAN (E NATURAL)

Executing...
Done.
108818273 fetches, 79227 marks, 4050 reads, 9380 writes.
0 inserts, 6677 updates, 0 deletes, 0 index, 14549183 seq.
Delta memory: 212 bytes.
ELEMENTS: 6677 updates. 
6677 rows affected directly.
Total execution time: 24.038s
Script execution finished.

CREATE DESCENDING INDEX IDX_ELEMENTS1 ON ELEMENTS (Z_I);
CREATE DESCENDING INDEX IDX_XI ON ELEMENTS (X_I);
CREATE DESCENDING INDEX IDX_YI ON ELEMENTS (Y_I);
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
 ON ELEMENTS TO  SYSDBA WITH GRANT OPTION;

CREATE DESCENDING INDEX IDX_NODES1_XI ON NODES (XI);
CREATE DESCENDING INDEX IDX_NODES1_YI ON NODES (YI);
CREATE DESCENDING INDEX IDX_NODES1_ZI ON NODES (ZI);
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
 ON NODES TO  SYSDBA WITH GRANT OPTION;

```