1

I run a project with about 30 layers. Some of them contains ~1.000.000 objects stored in a PostGIS/PostgreSQL database

Opening my project is fine. It takes only a few seconds

But when I save the project (without having changing anything but layer display/hide or the position) it takes about 10 minutes to save the project

Where can this come from?

10
  • Are you using OpenCL Acceleration? Settings - > Options -> Acceleration?
    – Andre Geo
    Commented Jan 30 at 16:48
  • No, no acceleration yet. Will try
    – plc
    Commented Jan 31 at 8:35
  • 2
    In the connections settings of the postgis connection, try ticking "Use estimated table metadata". It has helped me opening projects faster. Dont know about saving
    – Bera
    Commented Jan 31 at 10:09
  • 1
    Indeed, the table metadata is computed on every project open and save. Maybe it has changed, but with previous versions you had to update the project file by hand (see here)
    – JGH
    Commented Jan 31 at 13:07
  • 1
    Your the best. Adding estimatedmetadata=true solved my issue. Many many many many thanks !
    – plc
    Commented Jan 31 at 20:17

2 Answers 2

2

@JGH solved my issue. When saving the project, QGIS was recalculating all st_extent for all layers (around 100.000.000 lines each). By adding estimatedmetadata=true to <datasource>dbname= entries in the QGIS project file definitively solved my issue (saving takes less than 1 second now).

1

What is the project CRS? What is the CRS of each layer? If you have any layers with abnormal extents, that might cause QGIS to slow down while working with them. Check the extents by selecting all your layers and running this in the Python console:

for layer in iface.layerTreeView().selectedLayers():
    print(layer.extent())

If you spot any extents that are way outside the project CRS, that might be your problem...

1
  • HI All layers are in EPSG:4326 - WGS 84 All extents seems OK I have no issue opening the project (a few seconds), neither when hiding/unhiding layers or scrolling or getting information abour an object. My only issue is when sabing the project wich takes bout 7 to 10 minutes to complete
    – plc
    Commented Jan 31 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.