Jamal Hansen has a primer on explain plans for Python developers:
We talked early in this series about SQL being a declarative language. You tell the database what you want, and it figures out how to get it. But we’ve also seen that SQL gives you the freedom to do things in many ways, and some of those ways are more efficient than others.
Sometimes, a slow query means you didn’t choose the most efficient approach. Other times, your data has simply outgrown the default way the database finds records, and you need to give it a little help.
And in a judo move, if you already understand how explain plans work, you can figure out how to perform code profiling in Python.
Leave a Comment