[Mapserver-users] mappostgis query

Markus Schnider sp_ml at sourcepole.com
Mon Jul 5 10:03:23 EDT 2004


Thanks

I would try the 'FETCH FORWARD X FROM cursor' because the function needs the 
rest of the where clause (called by querybyattributes, and querybyattributes 
is defined as a query on the CURRENT extents).

Kind regards

Markus Schnider

On Monday 05 July 2004 15:12, Mark Cave-Ayland wrote:
> > -----Original Message-----
> > From: mapserver-users-admin at lists.gis.umn.edu
> > [mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of
> > Markus Schnider
> > Sent: 05 July 2004 12:53
> > To: mapserver-users at lists.gis.umn.edu
> > Subject: [Mapserver-users] mappostgis query
> >
> >
> > Hi all
[...]
> >
>
> Hi Markus,
>
> I can think of two reasons why your query may be failing.
>
> Firstly, it may be that you are running into a memory/resource limit
> when executing your query. A good place to start would be to change the
> "FETCH ALL FROM cursor" command into a "FETCH FORWARD X FROM cursor"
> (where X ~ 10,000 perhaps?) to reduce the memory requirements and copy
> the data into the appropriate mapserver structure in batches - otherwise
> the PostgreSQL libraries will attempt to load the entire 2 million rows
> into memory before it does anything :) Do you get any messages in the
> mapserver error log at all?
>
> Another possibility may be that if the second query works quicker than
> the first, perhaps the default statement_timeout parameter in your
> postgresql.conf is too low and hence the query is aborted as it takes
> too long to execute? I imagine that the second version of your code
> should be much faster because the WHERE clause (which calls two other
> functions) must be executed *once per row* and hence with 2 million rows
> the time taken would definitely add up. Again, if the statement times
> out, there may be an indication of this in the mapserver error log.
>
>
> Kind regards,
>
> Mark.
>
> ---
>
> Mark Cave-Ayland
> Webbased Ltd.
> Tamar Science Park
> Derriford
> Plymouth
> PL6 8BX
> England
>
> Tel: +44 (0)1752 764445
> Fax: +44 (0)1752 764446
>
>
> 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 person.
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list