... 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.

Did you know that
Noticing this a little late, but have a peak at these posts from Chris Hodgson about how the R-Tree