[mapserver-users] new query file format

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Thu Jan 14 15:44:55 PST 2010


Hi Stepan: The query performance improvements for the database drivers come from referring to features within a result set as we process query results. Previously, we referred to features globally and that is terribly inefficient in some cases, and that's why the old query files stored global feature indexes. Under the new querying scheme this simply won't work without the underlying query result set. The new scheme stores information necessary to redo a query and nothing more.

How you might recreate the old approach with MapScript 5.6.1 depends on your data store. With shapefiles, the index values stored in a result cache are suitable for use msQueryByIndex() as is. With a database source you need to work with a primary key and are probably best off working through msQueryByAttribute() instead. Perhaps Paul Ramsey can comment on whether or not the overall row number is somehow retrievable from a query result so that msQueryByIndex() could indeed be used, I don't think it is. In either case you'd need to serialize/unserialize your result list or hash yourself, msSaveQuery()/msLoadQuery() doesn't do it for you.

Does this help?

Steve

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of stepan.kafka at centrum.cz
Sent: Thursday, January 14, 2010 12:23 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] new query file format


Dear Steve and all,
  in version 5.6 the query file format has changed to remember last query rather than selected records list in previous versions. I used list approach to work with selections (add to existing selection XOR etc.), so msQueryByIndex was used frequently in mapscript. It seems that new approach doesn't work properly with combined and added queries. Is there any reason why it is changed now? How the results are stored when I add attribute query to queryByIndex etc. ?

Thank you

Stepan Kafka
Help Service Remote Sensing
e-mail: kafka at email.cz
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the MapServer-users mailing list