Slow postGIS data query (was RE: [postgis-users] mapserverdbconnection)

Frances Collier fcollier at
Wed Oct 26 09:16:39 PDT 2005


The query I tested was "Select the_geom from europecountries". There are
only 50 rows in the table, however they are large width-wise. For the entire
table to be retrieved (an area of 33857499) it took 13 seconds versus 3
seconds for the shape file. These times decreased to my last run (an area of
15159) which took 2 seconds for the database but 0 seconds for the shape
file. Now, these are rough figures, but I thought good enough to enhance our
understanding of how Mapserver dealt with the two different ways of
obtaining data.

Thank you,


-----Original Message-----
From: postgis-users-bounces at
[mailto:postgis-users-bounces at] On Behalf Of Mark
Sent: Wednesday, October 26, 2005 2:17 AM
To: 'PostGIS Users Discussion'
Subject: RE: Slow postGIS data query (was RE: [postgis-users]

> -----Original Message-----
> From:	postgis-users-bounces at on behalf 
> of Frances
> Collier
> Sent:	Mon 10/24/2005 1:29 PM
> To:	postgis-users at
> Cc:	
> Subject:	[postgis-users] mapserver db connection
> Hello,
> I've been trying to find out what exactly Mapserver gets back 
> from Postgis when querying the tables. I haven't found this 
> to be documented anywhere. Does Postgis return a shape file, 
> layer, or simply data rows? The reason I'm asking is that I 
> noticed a huge time difference between connecting to Postgis 
> and simply calling the shape files - with the Postgis being 
> significantly slower. I know Postgis offers a lot more 
> functionality, but for simple comparisons I do not have any 
> type of filter applied.
> I'd appreciate any knowledge, advice, and/or direction.
> Thank you,
> Frances Collier

Hi Frances,

What do you mean by significantly slower? Can you quantify this in seconds,
for example a shapefile query is instant whereas a PostGIS query takes 5s?

Kind regards,


WebBased Ltd
17 Research Way

T: +44 (0)1752 797131
F: +44 (0)1752 791023  

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other

postgis-users mailing list
postgis-users at

More information about the postgis-users mailing list