Bug report #13005
QgsOracleFeatureIterator: returns all features if layer has no index
|Affected QGIS version:||2.8.2||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21082|
i'm using QGis to show a view with a computed geometry column (and hence, i don't have a spatial index).
When i try to use the identify tool on this view, QGIS crashes (it tries to select all features in the layer).
- the identify tool uses FilterRect
- in the FilterRect handling, there is a big if:
if ( !mSource->mGeometryColumn.isNull() && mSource->mHasSpatialIndex )
- if hasSpatialIndex is false, it won't enter the if and add no WHERE clause to the query at all, hence all features are selected.
- SDO_FILTER is only used when an index is available, but always together with SDO_RELATE (http://docs.oracle.com/cd/A97630_01/appdev.920/a96630/sdo_operat.htm)
- SDO_RELATE is used in any case (in case when an index is available, and also in case when an index is not available)
i don't fully understand how this might be related to solved bug #11358
oracle provider: fix ExactIntersect check if spatial extension is available and there is no spatial index (fixes #13005)
#2 Updated by Jürgen Fischer about 6 years ago
sdo_filter requires a spatial index.
sdo_relate is only available with the spatial extension (ie. not in oracle locator).
So in QGIS
sdo_filter is used to detect if there is a spatial index (if everything else fails) and to filter in a feature request with
FilterRect - but only if there is a spatial index. And if the feature request also has the
ExactIntersect flag set and the spatial extension it available it is combined with
So if there is no spatial index or no spatial extension all features have to be loaded and have to be individually checked against the
FilterRect. But tht was only done when there was no spatial extension regardless of the existence of a spatial index. dfc2cf0 should fix that.
#3 Updated by Frank Dekervel about 6 years ago
i tried nightly of today (61d81f0), and it doesn't seem to be solved: qgis still selects all the features when i try to identify one.
i can't find why it doesn't work (the commit looks correct)
i still see that zooming and panning the map goes reasonably quick, even selecting nodes using the selection tool works fine (strange ?).
#4 Updated by Frank Dekervel almost 6 years ago
- Status changed from Closed to Reopened
i think i found the cause why it isn't working yet. inside the "if" you changed in dfc2cf0, there is another check in "line 148":#dfc2cf0bbf7516886d6cbf7cb3211bbc023df19b#diff-3930f82a72360b839dd9bc0a39e4cd97L148 for hasSpatial that needs to be changed too