Hallo You should use ST_DWithin instead with gist index on your gometry/geography column:
select * from pozos p,suelos s where ST_DWithin(p.the_geom,s.the_geom,1000) HTH Nicklas On Wed, 2012-12-05 at 16:32 -0500, Francisco Salas wrote: > Hi, > > I have test in two database one with SRID 2085 an other 4326 use this > sql > > pozos : 2339 rows > > suelos:1526 rows > > for 2085 : > > select * from pozos p,suelos s where > st_distance(p.the_geom,s.the_geom) > > <=1000 > > time of result : 3 minutes aprox > > > > for 4326 : > > select * from pozos p,suelos s where > st_distance(p.the_geom,s.the_geom,true) > > <=1000 > > time of result : not determined > > Why happen this problem? > > How I can optimize this? > > I am using PostGis 1.5.2 > > > > Regards, > > > > Francisco Salas > > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
