Hi,

You tables (what materialized views in fact are) are not big at all. There is 
something else wrong if your WFS is slow or fails totally. Looking at the 
tileindex is not the right thing to do.

QGIS is a rather poor WFS client, I would not use that for testing. If you 
still use, debug the http messages that it is sending, function key F12 opens 
the debugging tools. However, I would recommend to use hand written WFS 
requests instead so you can have full control on the queries. It does not take 
long to learn the basics.

  1.  Read the capabilities 
https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities
  2.  Read the schema of one feature type 
https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TypeName=continents
  3.  Read one feature from a feature type 
https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=continents&MAXFEATURES=1
  4.  Read the whole feature type by leaving out MAXFEATURES
  5.  Read data from a small area with bbox 
https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=continents&bbox=-60,46,-59,47



Observe if the response is fast. With your data a reasonable download time for 
the whole feature type is a few seconds, but it may be longer if your 
geometries are very big and you have lots of attributes.

If your service is fast but QGIS still gives errors I would check the data, 
especially if there happens to be topology errors in geometries.
If your service is slow turn on the logging of the SQL statements on the 
Postgresql side and execute the same SQL from PSQL prompt. If the database is 
slow it is useless to tune Mapserver. Tune the database instead. For example if 
spatial index is missing the bbox queries from big tables will be slow, even if 
the bbox is small.

General advice it to be systematic and change only one thing at a time when 
testing.

-Jukka Rahkonen-

Lähettäjä: mapserver-users <mapserver-users-boun...@lists.osgeo.org> Puolesta 
mathias cunault via mapserver-users
Lähetetty: maanantai 12. huhtikuuta 2021 15.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] Create a tileindex for WFS

Hello,
In a PostgreSQL 13 database, I have 3 materialized views with 2578, 22013 and 
62500 rows.
I am using MS4W 4.0.3 to generate a WFS based on these 3 views.
The aim is for users to display these WFS in QGIS.
I have other lightweight views in PostgreSQL that can be easily displayed, but 
these 3 materialized views seem to be too heavy to display because some 
messages say that Downloading the layer entities has failed or partially failed.
I wonder if using a tileindex was a good idea to speed up the display. Before 
going further in the developments, I would like your opinion about two things :

  *   I have to cut my views in "slices" before create a tileIndex for each one.
  *   The tileindex can be stored in postgis database.
Am I right?
If not is there a better solution ?
Thanks for your help
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to