<html><body><div>I have 1.5 million data points and I need to find all the data points within 300 meters of a specific location.  I have a GiST index set on my "location" (geom) column and it is Vacummed and Analyzed.</div>
<div> </div>
<div>I'm trying to make my query but I'm not sure how to set the bounding box.  I'd like the box to be no closer than 300 meters to my query point.  How do I set the BOX3D inputs?  I don't understand the "Units".</div>
<div> </div>
<div>SELECT <BR>    ec,<BR>    long,<BR>    lat,<BR>    distance_spheroid ( <BR>        location, <BR>        SetSRID(MakePoint(-87.983439, 42.042663),4326), <BR>        'SPHEROID["WGS_1984",6378137,298.257223563]'<BR>    ) as distance<BR>FROM <BR>    best_ec<BR>WHERE<BR>    location<BR>    && 'BOX3D(90900 190900, 100100 200100)'::box3d AND<BR>    distance_spheroid(<BR>        location, <BR>        SetSRID( MakePoint(-87.983439, 42.042663), 4326 ), <BR>        'SPHEROID["WGS_1984",6378137,298.257223563]'<BR>    ) < 300<BR>ORDER BY <BR>    distance_spheroid(<BR>        location, <BR>        SetSRID( MakePoint(-87.983439, 42.042663), 4326 ), <BR>        'SPHEROID["WGS_1984",6378137,298.257223563]'<BR>    )</div>
<div> </div>
<div> </div>
<div>Thanks,</div>
<div>Adam</div></body></html>