EXPLAIN: How the database sees your request
When you send an SQL query, the PostgreSQL scheduler makes a plan for retrieving data: whether to go through the entire table (Seq Scan) or use an index. The EXPLAIN command shows this plan without running a query; EXPLAIN ANALYZE actually runs the query and displays the actual time of the steps. Below is the same filter by age: first, you can visually see how rows are cut off, then we will analyze the “dry” output of the scheduler and compare the plan before and after creating the index.