[Gdal-dev] OGR spatial indexes in Oracle

GIRAUD Pierre bluecarto at free.fr
Fri Oct 15 08:21:05 EDT 2004


  Hello,

I'm having to use an Oracle Spatial data base containing many feature
within Mapserver. And I'm in front of performance issues while spatial
indexes don't seem to work.
Trying to identify the problem at its source, I wrote those following
queries :

----->in sqlplus :
SQL> SELECT count(*) FROM ref_batiment a WHERE sdo_filter(a.geometry,
mdsys.sdo_geometry(2003,NULL,NULL, mdsys.sdo_elem_info_array(1,1003,3),
mdsys.sdo_ordinate_array(58750573,13847995,58751000,13900000)),
'querytype=window') = 'TRUE';

  COUNT(*)
----------
         8

----> with ogrinfo :
aneto:~$ ogrinfo OCI:scott/tiger at aneto/orcl -sql "select a.geometry from
ref_batiment a" -spat 58750573 13847995 58751000 13900000
INFO: Open of `OCI:pierre/xbe9a51h at aneto.oco/orcl'
using driver `OCI' successful.

Layer name: select a.geometry, a.genre from ref_batiment a
Geometry: Unknown (any)
Feature Count: 97587

....

The time to get the info is obviously not the same.
What is the way I missed to get it working ?

Thx

Regards.

Pierre GIRAUD
camptocamp.com




More information about the Gdal-dev mailing list