Database Topic Archive

Slow Queries Articles

Query plans, EXPLAIN ANALYZE, planner regressions, pagination, joins, and statistics.

Window Function Edge Cases: MySQL 8 vs PostgreSQL Frames, FILTER, and Percentiles
7 min read

A p90 latency report drifted 40ms after a rewrite for MySQL compatibility, because PostgreSQL's percentile_cont interpolates and the hand-rolled MySQL replacement picked the nearest row. Window functions look portable across the two engines; the frame, aggregate, and ordered-set corners are…