[Qgis-developer] Oracle provider slow for large datasets - fetches all features every time

Steve Pritchard steve.pritchard at bto.org
Tue Oct 6 09:02:19 PDT 2015


When I open a QGIS project that has a layer using the Oracle provider, the
provider queries for all of the features even though the display area only
contains a few features:

SELECT
"GEOM","LOC_ID","LOC_LABEL","NAME","GRIDREF","LATITUDE","LONGITUDE","COUNTRY_CODE","IN_USE","REGION","PROTOCOL_ID","GEOG_REGION","COASTAL","PRIORITY","EASTING","NORTHING","EXTANT","ONLINE_REGION","BOUNDARY","ZOOMLEV","SITE_TYPE","PRIMARY_INDEX_REG","CONTEXT_INDEX_REG","AREA_INTERTIDAL","AREA_SUBTIDAL","AREA_NONTIDAL","ANCESTOR_LOC_ID","ACTIVE","COMMENTS","GEOM_EDITED_DT"
FROM "BTOWATCH"."LOC_AUX_GEO_WEBS_VW" "featureRequest" WHERE
mod("featureRequest"."GEOM".sdo_gtype,100) IN (3,7) AND (protocol_id =
'WEBSC')

If I zoom in or out on QGIS, or pan the map, again the Oracle provide
queries for all of the features.

This is a problem for me as the layer contains a large number of features
and the database is remote, and thus redrawing the map each time is very
slow.

It looks as though QgsFeatureRequest provides filterRect() /* Get the
rectangle from which features will be taken */, however the Oracle provider
doesn't appear to use this.

Could filterRect() be used in conjunction with Oracle's SDO_FILTER(...)
operation to restrict the set of features requested?

Steve Pritchard
British Trust for Ornithology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151006/87b3c3e4/attachment.html>


More information about the Qgis-developer mailing list