Debugging Postgres Queries
In the previous lesson, we learned about schemas in Postgres databases and built a database description from scratch. Using internal tables, we were able to describe metadata associated with our Postgres database. The metadata included data types, table names, created schemas, and plenty of other useful information.
In this lesson, we will be using internal tables to describe Postgres operations. However, instead of tables and data types, we will be examining queries and their plans of execution. Using Postgres tooling, we will introduce basic techniques for debugging Postgres queries that will also be used in future lessons.
Throughout this lesson, you will learn about concepts such as the `EXPLAIN` query that can help in debugging Postgres queries. You will also add the `ANALYZE` option to force runtime statistics and have those returned to you, to further aid in debugging queries.
As you work through debugging Postgres queries, you’ll get to apply what you’ve learned from within your browser so that there’s no need to use your own machine to do the exercises. The Python environment inside of this course includes answer checking so you can ensure that you’ve fully mastered each concept before moving on to the next one.
- Learn how to debug Postgres queries.
- Learn how to measure estimated and actual execution times.
- The EXPLAIN Query
- The Path of a Query
- Additional Output Formats
- Describing EXPLAIN Output
- Adding the ANALYZE Option
- Test and Rollback
- ANALYZE a Join Statement
- Join on Sequence Sacans
- Next Steps