[Mapserver-dev] Query efficiency

David Blasby dblasby at refractions.net
Wed Mar 3 14:42:45 EST 2004


I dont want to be too controversial, but I dont like the current query 
behaviour.  (This is from the PostGIS/database perspective; it looks 
good for shapefiles)

For example, if we have a database of Points (say apartments, golf 
courses, parks, and police stations).

You do a query for police stations.  The database will get a query 
something like this:

SELECT geom_point, id FROM mypoints WHERE type ='police station';

Lets say it gets 3 points back - id=56, id=98, id=127.

It then makes these type of requests from the database (they're actually 
more complex, but...):

SELECT geom_point, id, type FROM mypoints WHERE id =56;
SELECT geom_point, id, type FROM mypoints WHERE id =98;
SELECT geom_point, id, type FROM mypoints WHERE id =127;

 From the shapefile perspective, the first query reads through the DBF 
file, and the latter set of queries are very fast grabs (based on row 
id) from the .shp and .dbf files.

Perhaps someone could tell me why there's a difference between the 
normal (i.e. for drawing) requests and query requests.  It would make 
many of the datastores much simplier and maintainable.

I'm still a little fuzzy on the entire query system, so I could be wrong 
on the above,
dave



More information about the mapserver-dev mailing list