Great Circle Calculations Are Not Your Friend
Making your computer do math like this, even with a good spatial index, can make things very slow. Stupid me!
I couldn’t figure out for the longest time why the PostGIS database I was using was so slow, after inserting a proper GIST index on it. But then when I saw the projection was EPSG: 4326, I said, that’s why. All that trigonometry even with a math-coprocessor and spatial index is going to be slow as a dog!