I am having an issue with a postgis database with the time it takes to query the geometry column. The query selects 8000 records. The time to retrieve the records when not returning the geometry column is about 100ms. However, the time for the same query when requesting the geometry column takes about 9 seconds. Any thoughts on how I can improve the performance reading the geometry column from a postgis database? I am using PostgreSQL 9.4 and Postgis 22.1.
Thanks, David
David Robison
Principal System Engineer
![]()
Q-Free Open Roads
103 Watson Road
Chesapeake VA 23320
![]()

This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed. If you are not the intended recipient, please delete this email immediately.
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users
So there is a total of over 560,000 points in the 8000 records returned. I would have assumed that it was simply returning the contents of the geometry column and that the number of points (albeit they take up space) would not affect the select time. Is PostGIS doing something with the geometries as it is fetching them from the DB other than just returning them? Thanks, David
What kind of network separates client and server? Conservatively assuming that each point is only two 64-bit binary floats, your 560000 points equals 9MB of additional payload.
If you did something like “ST_AsText(geom)”, the additional payload is much, MUCH larger.
I’d also be interested to know if there’s some kind of data manipulation/packing/compression going on between client and server.
Bryce
Actually the timing test was done on the same machine using PGAdmin-III. What is interesting is that if I return the geometry using something like ST_Simplify(the_geom, 0.1, false) then it returns in just a few hundred milliseconds.
David