Bounding box
A bounding box is a latitude and longitude rectangle around a centre that contains every point within a specified radius. It serves as a cheap, index-friendly prefilter before the exact distance check, reducing the number of candidate rows. Its longitude width grows by a factor of 1/cos(latitude) because longitude degrees represent shorter distances closer to the poles.
Minimal example
SELECT id, name
FROM restaurants
WHERE is_active = 1
AND lat BETWEEN ? AND ?
AND lng BETWEEN ? AND ?;