>_ IzzyLab

Topic breakdown

An index is a separate data structure (usually a B-tree) that speeds up lookups and joins on a column: the planner stops reading the whole table and jumps straight to the right rows. It's created with a separate DDL command, and the name can be set explicitly or left for Postgres to generate its own. Most often foreign keys get indexed — joins usually run on them. Having an index does not by itself guarantee the planner will use it: on small tables a full scan is sometimes cheaper, but what matters for the task is the very existence of an index with the right name.

What's checked

  1. index idx_orders_customer created

What it looks like