- The document discusses histograms used for data statistics in MariaDB, MySQL, and PostgreSQL. Histograms provide compact summaries of column value distributions to help query optimizers estimate condition selectivities.
- MariaDB stores histograms in the mysql.column_stats table and collects them via full table scans. PostgreSQL collects histograms using random sampling and stores statistics in pg_stats including histograms and most common values lists.
- While both use height-balanced histograms, PostgreSQL additionally tracks most common values to improve selectivity estimates for frequent values.