Can I see this happen myself, without installing anything?
You will learn: how an UPDATE creates a new row version, how many pages a scan reads against an index, and why the column order in an index matters.
Each tutorial runs a real PostgreSQL inside this page, using PGlite. Nothing is sent to a server. Every step asks a question first. Make a guess, run the step, then read the answer. I learn more from a wrong guess than from a right one, and I expect you do too.
Watch the physical address of a row, its ctid, change when you update it. Each step asks you to guess first.
Not started.
Create a table with two rows.
CREATE TABLE accounts (id int PRIMARY KEY, balance int); INSERT INTO accounts VALUES (1, 100), (2, 100);
ctid is (page, slot). Guess first: where do the two rows sit?
SELECT ctid, xmin, * FROM accounts ORDER BY id;
Guess first: does row 1 keep its ctid after an UPDATE?
UPDATE accounts SET balance = 150 WHERE id = 1; SELECT ctid, xmin, * FROM accounts ORDER BY id;
Guess first: will VACUUM move row 1 back to slot 1?
VACUUM accounts; SELECT ctid, * FROM accounts ORDER BY id;
The same lookup twice. Read the Buffers line in each plan: it is the number of 8 KB pages the query touched.
Not started.
Create 100,000 users.
CREATE TABLE users AS SELECT g AS id, 'user' || g AS username FROM generate_series(1, 100000) g; ANALYZE users;
Guess first: how many pages does finding one username read, with no index?
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM users WHERE username = 'user50000';
Guess first: and with an index on username?
CREATE INDEX users_username ON users (username); EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM users WHERE username = 'user50000';
An index on (customer_id, day) is sorted by customer_id first. That order decides which queries it can help.
Not started.
Create 100,000 orders and one two-column index.
CREATE TABLE orders AS
SELECT g AS id, 1 + g % 1000 AS customer_id,
date '2025-01-01' + (g % 365) AS day
FROM generate_series(1, 100000) g;
CREATE INDEX orders_cust_day ON orders (customer_id, day);
ANALYZE orders;Guess first: does a filter on both columns use the index?
EXPLAIN SELECT * FROM orders WHERE customer_id = 42 AND day >= '2025-06-01';
Guess first: and a filter on day alone, the second column?
EXPLAIN SELECT * FROM orders WHERE day = '2025-06-01';
The same SQL runs in any psql session. For MySQL and MongoDB, the same experiments are on the Notebooks page, run on real servers.
Can I see it happen? Simulations, an index you build yourself, a real PostgreSQL in your browser, experiments run on real servers, and tools for your own database: a query coach, an EXPLAIN reader, a config checker and a health check.