[mapserver-users] Itemnquery slow in big TAB file; slow on Oracle as well

Jelmer Baas baas at speerit.nl
Mon Oct 3 04:46:30 EDT 2011


Hello List,

I have a query to retrieve geometry from a TAB file:
mapserv.exe?mode=itemquery&map= query.map&mapext=-70000+280000+500000+700000&layers=MYLAYER&qlayer= MYLAYER &qstring=('[IDCOLUMN]' IN '2550643')

This is my simplified Layer definition:

LAYER
		NAME MYLAYER
		TYPE LINE
    		CONNECTIONTYPE OGR
    		CONNECTION "c:\temp\MYLAYER.TAB"
		CLASS
			NAME "Test"
		END
    	METADATA
  		qstring_validation_pattern '^'
    	END 
END


To query this TAB file, MapServer needs about 20 seconds. MapInfo needs about 20ms, so MapServer is obviously not using the index on this column.

I tried changing this to Oracle Spatial, but then I bump into another problem: the query contains a spatial clause (which isn't needed):
SELECT IDCOLUMN FROM MYLAYER WHERE 'IDCOLUMN' IN '2550643' AND SDO_FILTER( GEOLOC, MDSYS.SDO_GEOMETRY(2003, 90112, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-70000,280000,500000,700000) ),'querytype=window') = 'TRUE'

This also takes about 10 seconds. Without the AND SDO_FILTER() part it takes a few milliseconds.

So two questions, I guess. Can I make MapServer use the index on the IDCOLUMN column, and, can I tell Mapserver to skip the SDO_FILTER part on Oracle?

Oh, I'm currently using MapServer 5.6 but tried 6.0 as well.

Thank you,
Regards,
Jelmer Baas


More information about the mapserver-users mailing list