How a Bad Index Turned a Fast JOIN Into a 4-Second Query
Автор: Ahnaf Zamil
Загружено: 2025-12-22
Просмотров: 166
In this video, I show a real PostgreSQL performance trap where adding an index made a JOIN query dramatically slower instead of faster.
A query that should have been fast ended up taking 4.2 seconds because PostgreSQL chose a nested loop and ran a full disk scan on the inner table repeatedly due to a poorly designed index.
This PostgreSQL EXPLAIN ANALYZE breakdown explains:
• Why indexes can slow down JOIN queries
• How PostgreSQL chooses nested loop joins when LIMITS are present
• Why indexing only one side of a JOIN is risky
• How a missing inner-table index caused a 15× slowdown
After fixing the indexing strategy, the same query dropped to 0.3 milliseconds. Yes, milliseconds...
😀 SUBSCRIBE for more videos! / ahnafzamil
➤ My Website: https://ahnafzamil.com
➤ My Discord Server: / discord
➤ Support me on Patreon: / ahnafzamil
Hope you enjoy this video, I am open to feedback.
#PostgreSQL
#SQLPerformance
#DatabaseIndexing
#QueryOptimization
#BackendEngineering
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: