RSSAmplifier

boringSQL | Supercharge your SQL & PostgreSQL powers · Mar 21, 2026

pg_regresql: truly portable PostgreSQL statistics

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

The previous article showed that PostgreSQL 18 makes optimizer statistics portable, but left one gap open: It's not worth trying to inject relpages as the planner checks the actual file size and scales it proportionally. The planner doesn't trust pg_class.relpages . It calls smgrnblocks() to read the actual number of 8KB pages from disk. Your table is 74 pages on disk but…

Read on boringsql.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.