Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Profiling Queries with SQL Explain Analyze

    postgresPostgreSQL

    Using the query planner within SQL is the equivalent of using the debugger tools in browsers. By using explain with options for formatting and actually executing with analyze, we can see how our query performs.

    Maybe we need to implement our query differently. Which includes possibly adding an index, using a sub-query instead of another table, or dozens of other options.

    In the end, we need to first know how to profile our query and we do that with explain.

    Video notes: https://explain.depesz.com