Bug report #10116

Oracle Provider feature count grabs whole table data

Added by Médéric RIBREUX about 10 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Legend
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

Description

Hello,

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).

History

#1 Updated by Médéric RIBREUX about 10 years ago

Hello,

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.

#2 Updated by Jürgen Fischer about 10 years ago

  • Target version changed from Version 2.4 to Future Release - Nice to have
  • Category changed from Data Provider/Oracle to Map Composer/Printing
  • Assignee deleted (Jürgen Fischer)

#3 Updated by Jürgen Fischer about 10 years ago

  • Category changed from Map Composer/Printing to Map Legend

#4 Updated by Giovanni Manghi about 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#5 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF