Loading topic
EXPLAIN and read a simple plan. It also assumes you know a B-tree index maps key values to row locations. The chapter covers the three ways PostgreSQL reads rows from an ordinary table. Index-only scans build on these three and get their own chapters.6 min readEXPLAIN plan and know that a B-tree index stores sorted key values with 6 min readEXPLAIN plan. It also assumes you have the one-million-row orders table from the earlier chapters, with the index orders_customer_total_idx on (customer_id) INCLUDE (total). The previous6 min readEXPLAIN output and know that PostgreSQL tables are stored as a heap of row versions (tuples) with MVCC. It also assumes you know what an index-only scan is and why it needs the visibility map. Here we look at the other half of the mechanism: how pages get th6 min readEXPLAIN and recognize node names like Seq Scan and Index Scan. It also assumes you know that the visibility map and VACUUM exist, as covered in the previous chapters. Here you learn to read the numbers in a plan and judge whether an index-only scan is saving you 5 min readEXPLAIN output. It also assumes you know that an index-only scan skips the heap only when the 6 min readEXPLAIN plan and know that a B-tree index stores sorted keys with pointers to heap rows. You should also know what an index-only scan is and why the visibility map matters. The examples use the one-million-row orders table from earlier chapters.5 min readEXPLAIN plan and know that a B-tree index keeps its entries sorted. It also assumes you know what an index-only scan is and why it needs the visibility map. The examples use the orders table from earlier in the tutorial.6 min readEXPLAIN (ANALYZE, BUFFERS) output. It also assumes you know what the visibility map is, what VACUUM does to it, and how INCLUDE adds payload columns to an index. Everything here uses the orders table from earlier chapters.5 min readCREATE INDEX and UNIQUE constraints work, and that you have met the INCLUDE clause in the previous chapters. You should also be comfortable with the idea that an index-only scan needs both the right columns in the index and mostly all-visible heap pages. Here 6 min readINCLUDE lets an index answer a query without visiting the heap. A WHERE clause on CREATE INDEX limits the index to the rows you actually query. Together they give you a small index that serves a hot query path with an index-onl6 min readHeap Fetches means in EXPLAIN (ANALYZE) output. It also assumes you have used INCLUDE. Those topics appear in earlier chapters. Here the question is narrower: which index types can feed an index-only scan, an6 min read