Turn on statement logging in PostgreSQL and extract the SQL that mapserver is sending to the database.
Run that yourself in psql, using EXPLAIN ANALYZE to see what query plan is being generated, and how much time the database itself is taking. Consider increasing the amount of memory you are devoting to PostgreSQL shared_buffers, since 50,000 is a very small table and shouldn't be slow for anything. Know that if you're drawing 50000 things on your map, it'll be slow no matter what your data source is. P. On Fri, Oct 3, 2008 at 6:45 AM, Fabio D'Ovidio <[EMAIL PROTECTED]> wrote: > Hello... > I developed a WebGIS application trought cartoweb (www.cartoweb.org). My aim > is to display a large numerber of points for each couple of (USER, ROLE) > that login into the system... > > The problem is they are more than 50.000 points and even if I set MINSCALE, > MAXSCALE to display them, the time for queries is to much and the whole > application is slow. > Is there a way to speed the interaction beetween Mapserver and PostGIS? > Cosider that I created spatial and no-spatial indexes on points talbe in > PostgreSQL and I make queries from php\mapscript as following: > > $layer1 = new LayerOverlay(); > $layer1->name = "my_layer"; > $layer1->data = "the_geom from my_table as foo using unique gid > using SRID=-1" ; > $layer1->filter = "field1 = 'Y' and field2 = '$myValue' " ; > > gid is PK... > > Thanks for your help ! > > > -- > Fabio D'Ovidio > Geospatial solutions > INOVA s.r.l. > Web : http://www.inovaos.it > Tel.: 081 197 57 600 > mail: [EMAIL PROTECTED] > > _______________________________________________ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > _______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users