Concepts to Grasp First

First let's cover how Postgres stores your data and builds a query plan in my half-hour Fundamentals of Select video:

In that video, as we're running query plans, we use the EXPLAIN option so Postgres will tell us how the query plan works.

Next, learn how to read the buffers numbers shown in EXPLAIN plans because we'll use that output a lot in Fundamentals of Index Tuning. Read that post. No, seriously - I put a lot of work into it, and it's not long, and it'll be crucial as we move forward!

Read these short tutorials:

Complete and Continue