Lesson 3.1

How indexes work

An index is a sorted structure the planner may choose to use. Column order in a composite index decides which queries it can serve.

Duration
5m
Level
Intermediate
Students
8.2k students

Overview

An index is a sorted structure the planner may choose to use. Column order in a composite index decides which queries it can serve.

In this lesson you will:

  • Understand B-tree indexes and column order
  • Add partial and expression indexes where they fit
  • Weigh the write cost of every index you add

Resources

PostgreSQL documentation

The official reference for the tools used in this lesson.