Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In fact, I've tried using ST_DWithin but it's taking longer (although geog is indexed). ST_DWithin(geom::geography, ST_SetSRID(ST_MakePoint(-74.00072343, 40.7209235), 4326)::geography, 1000). Could it be because I'm "making point" for each iteration? Should this point be created once, and accessed after that?