[postgis-users] st_dwithin with 4 parameters does not use spatial index

Markus Innerebner markus.innerebner at inf.unibz.it
Sun Sep 25 08:25:38 PDT 2011


HI all

I migrated to postgis 1.5.3 in order to use the st_dwithin function with
4 parameters that supports meters as unit shown as Q1, while query Q2 is
the old function, that does not support meters for the projection format
4326.

The problem is, that query Q1 does not use the spatial index, while Q2
does it. Any idea what it could be??

Thanks for your answer

Markus

---------------------------
Q1: 
    SELECT NT.id
    FROM 
      it_nodes N,
      it_nodes NT
    WHERE
      N.ID='22' AND ST_DWITHIN(N.GEOMETRY,NT.GEOMETRY,500,true)=true
     
Q2:
    SELECT NT.id
    FROM 
      it_nodes N,
      it_nodes NT
    WHERE
      N.ID='22' AND ST_DWITHIN(N.GEOMETRY,NT.GEOMETRY,0.005)=true








More information about the postgis-users mailing list