Bug report #10116
Oracle Provider feature count grabs whole table data
|Affected QGIS version:||2.2.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18581|
When I check the "Show Feature Count" checkbox, QGis 2.2 sends this query to do the count:
SELECT "FIELD1","FIELD2",...,"FIELDN" FROM "SCHEMA"."TABLE" "featureRequest"
When the table is huge with lots of fields, this count can be very long to do. I've seen in the code that there is a featureCount function that could/should be used to do this count. In this function there are good queries to fast determine the number of features of the layer (by querying metadata table for example).
I believe that those queries should be used when the checkbox "Show Feature Count" is checked instead of the one who grabs all of the attributes data (which I can't find in Oracle Provider code).
#1 Updated by Médéric RIBREUX almost 9 years ago
after using Debugview (under MS-Windows) and a little bit more Wireshark, I can see that featureCount method is launched when the box is checked. But after this method, the QgsOracleFeatureIterator::openQuery method is launched. This method execute the SQL query that grabs all of the data from the layer. I don't know what does this method and perhaps is it the internal way of Qgis to deals with count checkboxes ?
But if we could avoid to launch openQuery, it will saves a great amount of time when counting features... We could also try to lowerage the weight of the SQL query launched by openQuery.
#5 Updated by Giovanni Manghi almost 4 years ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR