Bug report #11348
Add PostGIS layers is too slow on connecting to a database
|Affected QGIS version:||2.4.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19639|
Add PostGIS layers is too slow. The reason is that when connecting to the database, every table and view is read along with all the details. This is not necessary. Instead QGIS should first identify the Schemas that are present within the database, as this is the first screen displayed to the user. Tables and Views should only be read if the Schema is selected, but only the name of the table or view. When the table or view is selected, then the additional information should be read.
This is being reported as a bug rather than a feature request, as it is a usability issue.
#2 Updated by Harry Clarke about 8 years ago
I am not sure exactly which option you are referring to.
I did try ticking the option "Don't resolve type of unrestricted columns (GEOMOTERY)", which is a lot quicker, but that only shows half of the schemas, and not the schema I am interested in, so not very helpful.
#4 Updated by Harry Clarke about 8 years ago
Unfortunately DB Manager is unable to add the layer I am interested in, see issue #11317. Because the aggregated view doesn't have a primary key set. Hence it is only possible in the Add PstGIS layers command, where the primary key can be set to some column that happens to be unique.