How percentile approximation works (and why it’s more useful than averages)

What percentile approximations are, how percentiles work in PostgreSQL, and calculating them efficiently on time-series data.