Martin Pfeifle wrote:

Hi,
I think the simplest solution would be to put a spatial index on top of the 
B-tree, that's what e.g. Oracle does in their Spatial Cartridge.
Basically you store the index data in relations and index these relations by 
B-trees.
In this case, you do not have to change the core code of SQLite. You can 
already do this now.
Nevertheless, it would be nice, if SQlite supports somehow the "extensible indexing 
interface".
So, you ask a spatial query and in the background the system uses the index 
data stored in relations.
We have done a lot of research on that topic. To get acquainted to the basic 
idea, you might have a look at
"The Paradigm of Relational Indexing: A Survey".

In my opinion, a direct integration of a spatial index is of course preferable, 
but who is going to do that?

Best Martin

Hello Martin, hello All,

Thank you for the above link, it is very useful.
I definitely want to go the spatial index map to btree index way.
I especially like the quad-tree select because I understand it and I already have most of the building blocks :
SELECT DISTINCT idx.id
FROM polygons_quadtree idx,
          TABLE(ZDecompose(BOX()) titles,
         Table(ZupperHull(tiles.zval)) uh
WHERE (idx.zval BETWEEN tiles.zval AND ZHi(tiles.zval))
        OR (idx.zval = uh.zval);
Well almost, I know how to make ZDecompose, I still not sure about ZHi, ZUpperHul, do you have any more pointers ?

I didn't konw the TABLE statement to return a pseudo table, unfortunately, it seems not available in sqlite, can it be emulated by a transient memory table ? Do you think that such a complex statement has any chance to be speedier than a simple bbox elimination ?


Thanks again,
Best regards


--
Noël Frankinet
Gistek Software SA
http://www.gistek.net

Reply via email to