Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
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
    
@simplexio: Thanks. I am reading the web on how to tune PostGIS. Do you recommend any source? –  Cao Minh Tu Jan 15 '13 at 1:44

1 Answer 1

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.

share|improve this answer
1  
+1 The OP's problem is network latency and not PostGIS configuration. –  Alexandros Apr 4 at 3:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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