Hi, <br> I've the following table,and has created the index on uid and location;<br><div style="margin-left: 40px;">CREATE TABLE points<br>(<br>  location geometry, //assume it's a 2-dimension point<br>  uid integer<br>

)<br></div><br>Now, I've a point P with uid= 12345, and want to find the neighbors which are within 20, how to write the sql?Is this right?<br><div style="margin-left: 40px;">select st_astext(location)<br>from points a, points b<br>

where b.rid = 12345 and ST_DWithin(a.the_geom, b.the_geom, 20)<br><br>or use st_buffer? which one is more efficient ? <br><br></div>Thanks!