[postgis-users] Slow retrieval of one polygon in a database

David Quinn daithiquinn at gmail.com
Wed Apr 4 07:43:29 PDT 2012


Hi List,

I'm curious why it takes me a long time to view a polygon that I inserted
into a table. The command runs without an error, but when I go to view the
polygon in QGIS the program takes a long time to load the data. (I'm able
to view other data in the same database that contain thousands of polygons
from a shapefile in less time).

This table contains one box so I wondered if I was loading the polygon
incorrectly. In my table 'polysearch' I have a column called 'geom' of type
'geometry'. I have tried three approaches to load in the data:

INSERT INTO polysearch(geom) values('POLYGON((-8239995.0
4974391.0,-8230242.0 4974391.0,-8230242.0 4979772.0,-8239995.0
4979772.0,-8239995.0 4974391.0))')

INSERT INTO polysearch(geom) values('SRID=900913;POLYGON((-8239995.0
4974391.0,-8230242.0 4974391.0,-8230242.0 4979772.0,-8239995.0
4979772.0,-8239995.0 4974391.0))')

INSERT INTO polysearch(geom) values('SRID=900913;POLYGON((-8239995.0
4974391.0,-8230242.0 4974391.0,-8230242.0 4979772.0,-8239995.0
4979772.0,-8239995.0 4974391.0))'::geometry)

Then I made a spatial index on the table.
CREATE INDEX idx_polysearch
  ON polysearch
  USING gist
  (geom );

I'm using PostGIS 2.0 64 bit on Windows 7.

-David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120404/a3a0ed08/attachment.html>


More information about the postgis-users mailing list