Bug report #21303
Postgis: very noticeable slowdown when opening the attributes table if the table has a large number of columns
|Affected QGIS version:||3.5(master)||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29121|
I'm observing the following (on 3.4.4 and master, Linux and Windows):
if the table of attributes has a large number of columns (63 in my case), then operations like opening the table and pasting features is MUCH slower if compared to the same data loaded in QGIS 2.18.
My test scenario is a PostGIS layer (both client and server are on very fast connections) which has only a hand full (~4000) of small polygons (none larger than 80ha with no more than 600 vertexes, but much less on average).
Postgis: cache information about enum fields
This is called several times and can slow down substantially
the opening of the attribute table.
Partially fixes #21303 (down from ~30 to ~6 seconds on a remote
The remaining ~4 seconds (compared to ~2 seconds in 2.18) are due
to the check for enums and provider-side constraints, that were
not implemented in 2.18.
See: QgsEnumerationWidgetFactory::fieldScore and the call to
enumValues for details, fieldScore is called several times
because QgsAttributeTableModel::loadAttributes is also
called multiple times and it queries for widget configuration
all the times.
#11 Updated by Alessandro Pasotti about 2 years ago
- Status changed from Open to In Progress
- Pull Request or Patch supplied changed from No to Yes
- Resolution set to fixed/implemented
from 30 secs to 6 secs: https://github.com/qgis/QGIS/pull/9219
There is no room for substancial further speed improvements because of the new checks for enums that need to happen at least once.