[Qgis-user] Spatial Search Of Oracle Table by QGIS

Simon Greener simon at spatialdbadvisor.com
Sun Jan 29 21:47:40 PST 2017


Background.

I executed an "identify" in QGIS against a single mapped object that comes
from an Oracle table with sdo_geometry column.

I dumped the SQL that QGIS executes and I got the following (which I have
compared to the C++ source code):

SELECT "GEOM","ROWID","FID","FID_INT","FID_NUM9","FID_NUM8","FID_NUM7",
  "AN_ATTRIBUTE" 
FROM
 "QGIS"."FOO" "FEATUREREQUEST" 
WHERE sdo_filter("GEOM",
  mdsys.sdo_geometry(2003,2872,NULL,mdsys.sdo_elem_info_array(1,1003,3),
  mdsys.sdo_ordinate_array(5992381.68001308757811785,
  2112468.83721287222579122,5992389.06444318685680628,
  2112476.22164297243580222)))='TRUE' 
AND sdo_relate("GEOM",
  mdsys.sdo_geometry(2003,2872,NULL,mdsys.sdo_elem_info_array(1,1003,3),
  mdsys.sdo_ordinate_array(5992381.68001308757811785,
  2112468.83721287222579122,5992389.06444318685680628,
  2112476.22164297243580222)),'mask=ANYINTERACT')='TRUE'

My question is this. Why does QGIS execute a primary filter (SDO_FILTER)
followed by a secondary filter (SDO_RELATE)? The reason why I ask is that
the secondary filter SDO_RELATE firstly executes its own primary filter
before processing the candidates for the spatial relationship.

The SDO_FILTER is not needed. The Oracle Query Optimizer is still not smart
enough to realise that the sdo_filter is not needed.

regards
Simon



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Spatial-Search-Of-Oracle-Table-by-QGIS-tp5305258.html
Sent from the QGIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list