[postgis-users] slowing down queries

Pedro Doria Meunier pdoria at netmadeira.com
Thu Mar 8 02:40:02 PST 2007


Hey Flavio,

You're missing the && operator... ;-)

Pedro.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Flavio
Perri
Sent: quinta-feira, 8 de Março de 2007 10:34
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] slowing down queries 


Hi all,
      i'm a new postGIS user and I got problems with queries: they are very
slow!
I created an index using GIST (i read it from documentation) on the
geometry column of each table, but EXPLAIN tells me this:
"EXPLAIN select a.name from aree_milano a, milano_gps gps  where
Within(gps.point_geom,a.the_geom) GROUP BY a.name;
                                     QUERY PLAN

----------------------------------------------------------------------------
--------

 HashAggregate  (cost=1718868.95..1718870.84 rows=189 width=14)
   ->  Nested Loop  (cost=7.08..1658252.88 rows=24246430 width=14)
         Join Filter: within("outer".point_geom, "inner".the_geom)
         ->  Seq Scan on milano_gps gps  (cost=0.00..21611.64 rows=384864
width=21)
         ->  Materialize  (cost=7.08..8.97 rows=189 width=5187)
               ->  Seq Scan on aree_milano a  (cost=0.00..6.89 rows=189
width=5187)
(6 rows)"

The query wants to select all areas that contain all the points in the
other table and i used the postGIS function Within(). I also tried with
Contains(), but nothing changed. Why aren't the index used on the queries
(that was an example, but i wish to create a table from a select like
that)?
bye

Flavio

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list