- All Courses
- PostgreSQL for Developers
- Query Performance
- Tuning a slow query
Tuning a slow query
Rewriting is often better than indexing. Remove the function on the indexed column, cut the rows early, and check the plan again.
- 8m
- Intermediate

Video by Dreams of Code · YouTube
Check your understanding
3 questions. Unlocks when you finish the video.
Overview
What this lesson covers
- Rewrite predicates so an index can be used
- Reduce the row count as early as possible
- Verify the improvement with a fresh plan
This lesson sits in Query Performance, part of PostgreSQL for Developers. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will:
- Rewrite predicates so an index can be used
- Reduce the row count as early as possible
- Verify the improvement with a fresh plan
Resources
Your notes will live here
Note taking is not available yet. Nothing you type would be saved, so the tab stays read-only for now.