7

I have just imported a Spatialite database into Postgresql/Postgis. The problem is: using QGIS to work with them is much slower in Postgis (spatial indexes created) than doing the same in Spatialite.

Is there any way to improve Postgis layers speed in QGIS?

EDIT:

Postgis is running on an external server while Spatialite database is on my local PC. Previously, I thought QGIS would cache all my loaded layers onto local disk, I just checked and found that I was wrong - every time I pan around in QGIS, network traffic on my Postgis database increase (right now I am the only one using this experimenting server).

Is there any way to make QGIS cache data locally to improve speed?

  • 1
    That has never been my experience. PostGIS has always felt faster then Spatialite to me. – Nathan W Jan 14 '13 at 5:36
  • @NathanW: thank you for your interest. I added information in the question above. Would you please give me some ideas on situation like this? – Cao Minh Tu Jan 14 '13 at 8:01
  • Have you adjusted your PostgreSQL server pga_hba.conf values to match your usage. Default memeory usage is quite small. – simplexio Jan 14 '13 at 8:07
  • 4
    QGIS has no caching every request is live. – Nathan W Jan 14 '13 at 9:25
  • 1
    In the connection options, I usually tick the box Use estimated table metadata which makes it quicker to choose the layers. I don't think this affects panning though. – djq Jan 15 '13 at 15:48
3

Make a local PostGIS database.

The primary issue that is slowing you down is network latency. If you want to continue using the data in PostGIS and you want greater connection speeds, you can install PostgreSQL and PostGIS on your local computer, then load the portion of the data you would like to work with locally.

ogr2ogr can be used to create a single command that transfers data to your local database. Examples of using ogr2ogr are here, and here

When you are done working with it, you can transfer the data back into your remote database.

  • 1
    +1 The OP's problem is network latency and not PostGIS configuration. – Alexandros Apr 4 '14 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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