Searching a table in MySQL based on latitude and longitude columns.
——————————————————
📚 Learn more about PlanetScale
• Website: https://planetscale.com/
• Docs: https://docs.planetscale.com/
——————————————————
00:00 A point of interest
00:21 Haversine formula
01:00 ST_DISTANCE_SPHERE distance calculation
03:25 Filtering by ST_DISTANCE_SPHERE
04:28 It's too slow
05:11 Bounding boxes
06:55 Using a bounding box
08:10 Adding an index
10:20 Adding a compound index
11:34 A note about POINT columns
——————————————————
💬 Follow PlanetScale on social media
• Twitter: https://twitter.com/planetscaledata
• TikTok: https://www.tiktok.com/@planetscale
• Twitch: https://www.twitch.tv/planetscale
• LinkedIn: https://www.linkedin.com/company/planetscale/