Bug report #13040

postgresql/postgis slow opening

Added by zimirrr leonid over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/PostGIS
Affected QGIS version:2.8.2 Regression?:No
Operating System:windows 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21115

Description

hello
i have done some testing-logging and there is some questions.
i have a qgis(2.8.2 WIN7) project with >50 tables/views in postgresql
it opens about 2-3 minutes
i saved all queries and the slowest were
"SELECT DISTINCT upper(geometrytype("geo")),st_srid("geo") FROM ..." - tables only
"SELECT st_extent("geo") FROM ..." - view only
"SELECT count(distinct "qgisid")=count("qgisid") FROM ..." - view only

What can i do to speed up?
Creating indexes helps but

Why qgis execute this queries? Can we optimize them?

History

#1 Updated by zimirrr leonid over 8 years ago

users gp5st and @jef, on irc channel, gave me advise to add some parameters in my qgs file
i added to all <datasource>'s new parameter estimatedmetadata=true
"<datasource>estimatedmetadata=true dbname=..."

and it became faster.

#2 Updated by Saber Razmjooei over 8 years ago

  • Category set to Data Provider/PostGIS

#3 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF