[Mapserver-users] Optimising PostGIS relates/subselects/views

Antti.Roppola at brs.gov.au Antti.Roppola at brs.gov.au
Mon Feb 3 16:08:25 PST 2003


Hello all,

If I have my attribute data and PostGIS geometries in the
same table, my map draws in around 4 seconds. Viz:

	DATA "the_geom from mylayer"	

	CLASSITEM "value"

If I use attributes from other tables, my map draws in 82 seconds. Viz:

	DATA "the_geom FROM
			(SELECT mylayer.oid AS oid,
				mylayer.the_geom AS the_geom,
				mytable.value AS value
			FROM mylayer, mytable
			WHERE mylayer.lut=mytable.lut)
			AS mylayer
			USING oid
			USING srid=-1"

	CLASSITEM "value"

Obviously something index related, but is it the question is what?
My table has around 2600 shapes in it, and pulling in the atrribute
data using psql is fast, so I think it's indexing of the subselect
rather than the relate that's the issue.

TIA,

Antti




More information about the MapServer-users mailing list