Subject Re: Need to optimize this query for my benchmark tools against Firebird / Mysql / Sqlite3
Author chris.waldmann
--- In firebird-support@yahoogroups.com, Vander Clock Stephane <svanderclock@...> wrote:
> compare to SQLite3 (for example) that takes only 15 ms (thanks to his
> rtree index)
>

Hello Stephane

The implementation of R*Tree of SQLite3 is based on some additional tables and some functions to create, modify and query the tree.

I think it could be a nice exercise to implement R*Tree (for example for 3 dimensions) with stored procedures and triggers in Firebird.
The documentation if SQLite3 shows the way and mentions the papers the R*Tree is based on.

A query could look like this:
select RT.RESULTID from RTREE_INDEX_MYNAME( X1, X2, Y1, Y2, Z1, Z2 ) RT


If the performance is good, it would be great to have a script generator to choose the number of dimensions, the type of the "coordinates", and the name of the index.

Or maybe some one has already done this and can contribute to Firebird?

Christian