[mapserver-users] Class maxscaledenom performance

pe_lord pe_lord at yahoo.ca
Thu Jun 1 10:26:23 PDT 2017


I've verified if the issue was not linked to WMS. shp2img succeed to produce
the png. But it's quite long.

I have tried at 
*1:102 000 *
PGIS Query = 4 sec
Nb of recors = 2859 records
Mapserver render by WMS = 2.5 sec
Mapserver render by shp2img =  shp2img total time: 3.677s

select
"classitem_field",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex') as
geom,"ogc_fid" from ori_pee 
where the_geom && ST_GeomFromText('POLYGON((-8871026
6114309.70958512,-8871026 6140241.29041488,-8834701
6140241.29041488,-8834701 6114309.70958512,-8871026
6114309.70958512))',3857)


*1:1 002 000*
PGIS Query = 26 minutes
Nb of records = 242832 records
Mapserver render by WMS = "internal server error" = timout
Mapserver render by shp2img =  shp2img total time: 156.299s

select
"classitem_field",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex') as
geom,"ogc_fid" from ori_pee 
where the_geom && ST_GeomFromText('POLYGON((-9031284
5999904.71459227,-9031284 6254645.28540772,-8674443
6254645.28540772,-8674443 5999904.71459227,-9031284
5999904.71459227))',3857)

Here my validations
1-My layer have EXTENT
2-Mapserver do not reproject data
3-My layer has no label
4-Myconnection on postgis "DEFER"
5-My table have no OIDS
6-My table have GIST index on the_geom field
7-My table have a btree index on classitem field.
8-No warning in my GetCapabilities


I have tried loading a new table with OIDS set to TRUE (on table, not on
database)  and it's seem to be the same behavior? Do I really need to modify
postgresql.conf?



When I read the query called from mapserver, I think there is a way to
improve performance on maxscaledenom. Do you think there is a way for
mapserver to know which class to render at current scale (based on bbox )
and filter on them ... 

the query might look like this:
select
"classitem_field",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex') as
geom,"ogc_fid" from ori_pee 
where the_geom && ST_GeomFromText('POLYGON((-9031284
5999904.71459227,-9031284 6254645.28540772,-8674443
6254645.28540772,-8674443 5999904.71459227,-9031284
5999904.71459227))',3857) and classitem_field = 'BBOX'

I think I will work on union layers :) .





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Class-maxscaledenom-performance-tp5322521p5322693.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list