A performance review starts going wrong when a generated summary calls an estimated query cost a runtime measurement. PostgreSQL’s ordinary EXPLAIN output describes the plan the optimizer selected. That plan is useful for understanding the expected scan and join behavior, but it cannot tell you what elapsed time a real execution just took, because that execution did not happen.
Reference: PostgreSQL EXPLAIN documentation. EXPLAIN shows a query plan, and the ANALYZE option actually executes the statement.
Compare Plan vs Execution
Start by reading the plan’s node types, estimated rows and relative costs. The cost values use the planner’s own units, not milliseconds. On a safe fixture, run EXPLAIN (ANALYZE) on the same read-only SELECT if you want observed row counts and execution timings. Save the query, fixture and output together so a reader can see what was estimated, what actually ran, and what the numbers describe.
Verify Row Counts
Use a toy set of story records with an uneven distribution of categories. Ask for one category and compare estimated and actual rows at the relevant scan or filter node, taking its loop count into account. If the two figures diverge, investigate what the plan assumes about the data. The gap is a clue, not proof that statistics are stale; skew, correlated columns and other factors can also affect estimates.
Do not run ANALYZE on an unreviewed write merely to get a richer plan: the option really executes the statement. For this check, stick to a read-only fixture and do not use one instrumented run to promise production latency. If the article needs a performance claim, distinguish rows processed from the time a reader experiences, note the conditions, and repeat the measurement separately. A database execution time excludes the trip to a reader’s browser, which can involve many other services. Otherwise, say only what the plan supports: what PostgreSQL expected to do.



