[postgis-users] Speed issues again

Zamil Murji Zamil.Murji at divestco.com
Thu May 6 14:59:42 PDT 2004


Hi list,
I have run into speed issues once again. Please help me debug the situation.
On my dev box:

explain analyze SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from main_well1 WHERE the_geom && setSRID('BOX3D(-110.482793528655 49.3082155698291,-110.480199364038 49.3099117546408)'::BOX3D, find_srid('','main_well1','the_geom') );
                                                             QUERY PLAN                                                   
------------------------------------------------------------------------------------------------------------------------------------
 Index Scan using main_well1_the_geom_idx on main_well1  (cost=0.00..11.86 rows=2 width=36) (actual time=0.19..0.42 rows=2 loops=1)
   Index Cond: (the_geom && 'SRID=-1;BOX3D(-110.482793528655 49.3082155698291 0,-110.480199364038 49.3099117546408 0)'::geometry)
 Total runtime: 0.73 msec
(3 rows)

On my prod box:
explain analyze SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from main_well2 WHERE the_geom && setSRID('BOX3D(-110.482793528655 49.3082155698291,-110.480199364038 49.3099117546408)'::BOX3D, find_srid('','main_well2','the_geom') );
                                                             QUERY PLAN                                                   
------------------------------------------------------------------------------------------------------------------------------------
 Index Scan using main_well2_the_geom_idx on main_well2  (cost=0.00..21.84 rows=5 width=36) (actual time=0.23..0.56 rows=2 loops=1)
   Index Cond: (the_geom && 'SRID=-1;BOX3D(-110.482793528655 49.3082155698291 0,-110.480199364038 49.3099117546408 0)'::geometry)
 Total runtime: 0.88 msec
(3 rows)

On my dev box:
http://207.34.103.10/cgi-bin/mapserv?mode=nquery&map=/mapfiles/idcdev_canada-query.map&imgext=74742.34494+3662569.68589+87814.60352+3671234.05290&mapsize=777+515&imgbox=363+222+373+232&layers=wells
** This query takes > 5 seconds

On my prod box:
http://207.34.103.10/cgi-bin/mapserv?mode=nquery&map=/mapfiles/idc_canada-query.map&imgext=74742.34494+3662569.68589+87814.60352+3671234.05290&mapsize=777+515&imgbox=363+222+373+232&layers=wells
** This query takes < 0.5 seconds

My dev and prod databases are both served from the same machine. The mapserv is on the same machine. So it cannot be due to different environment settings. Both tables have the same indexes created on them.
Please help me find the solution. I'm like a lost puppy longing for my owner...

Zamil



More information about the postgis-users mailing list