[postgis-users] Indexes not being used

Pedro Doria Meunier pdoria at netmadeira.com
Sat Mar 31 11:57:54 PDT 2007


Hi all (with a special wink to Regina ;- )

 

This is the query not using indices:

 

SELECT parish,county,geometry FROM pt_madeira_toponymy as t WHERE
parish=upper('se') AND

  t.geometry && geomfromtext('POINT(-16.9213592631455
32.6437878212273)',4326) AND
intersects(geomfromtext('POINT(-16.9213592631455 32.6437878212273)',4326),
t.geometry);

 

As you can plainly see it checks if a point is inside some polygon.

 

EXPLAIN ANALYZE returns this:

"Seq Scan on pt_madeira_toponymy t  (cost=0.00..3.03 rows=1 width=96)
(actual time=1.086..1.278 rows=1 loops=1)"

"  Filter: ((parish = 'SE'::text) AND (geometry &&
'0101000020E61000009B135F33DEEB30C0FFDDAAA367524040'::geometry) AND
intersects('0101000020E61000009B135F33DEEB30C0FFDDAAA367524040'::geometry,
geometry))"

"Total runtime: 1.312 ms"

 

The toponymy has two indices: one for 4326 and another for 32628 using GiST.

 

Is the intersects function not using indices at all??

 

Already thankful for any ideas,

With best regards,

Pedro Doria Meunier.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070331/65e0da4c/attachment.html>


More information about the postgis-users mailing list