[Mapserver-dev] Re: [Mapserver-users] Mapscript drawQuery() on big PostGIS layers doesn't work properly ?

Paul Ramsey pramsey at refractions.net
Wed Oct 15 12:25:58 EDT 2003

David Blasby wrote:

> Whats happening is that postgresql is using the spatial index (which 
> presumably returns the entire layer), then does a sequencial scan to 
> find the rows with the "filter" attributes.

Incidentally, it is worth pointing out that the currect behavior for 
query functionality is almost painfully unsuited to database backends. 
The shapefile heritage really shows through in the query workflow, which 
if I am not mistaken is "tell me the record numbers of all records of 
interest (that match the criteria)", "give me record 1", "give me record 
2", etc. To emulate this, we do exactly as asked. Give the list of 
record numbers (unique ids in our case) and then perform repeated 
queries -- the opposite of efficient, given the capabilities of the 
backend. Obviously it would be preferable to turn the query into a 
single resultset and then scroll through it, once.

      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632

More information about the mapserver-dev mailing list