... WHERE ST_Intersects(ST_Buffer(g1, r), g2)Stop. Take a cleansing breath. Do this:
... WHERE ST_DWithin(g1, g2, r)With the carbon emissions you save doing it the efficient way, you can afford to drive to the ice cream store for a well-deserved reward.

2 comments:
Sure - semantically nice and easy, but way slower on a large dataset. Comparative figures
st_intersects(st_buffer ... - 1.5sec
st_dwithin( ..., 0) - 4.5 secs
There's something very non-normal about your data or index set-up or something.
Post a Comment