Skip to content

Archive

Statistics

3 articles
Database 14 Sep 2026 5 min read

PostgreSQL Extended Statistics Model Column Relations

PostgreSQL normally collects planner statistics for individual columns. That model works well when predicates can be estimated independently, but real schemas often contain related values. A country and region pair, a tenant identifier and status, or two derived date expressions can have distributions that single-column statistics cannot represent. Extended statistics add a second layer of information across multiple columns or expressions. They do not create an access path and they do not change stored table data. Their role is narrower: provide the planner with a better model for cardinality estimation when values are related.

Data Science 02 Sep 2026 5 min read

Robust Outlier Detection with Median Absolute Deviation

Outlier detection often begins with a rule such as “flag values more than three standard deviations from the mean.” That works reasonably well for approximately normal data without severe contamination, but the same extreme observations you want to detect can move both the mean and the standard deviation. Median absolute deviation, usually abbreviated MAD, provides a more robust alternative. Why mean and standard deviation can be fragile Consider response times in milliseconds:

Data Science 02 Sep 2026 5 min read

Bootstrap Confidence Intervals with Resampling

A point estimate hides uncertainty. Reporting that median latency is 180 ms or a conversion-rate difference is 1.4 percentage points does not show how much that estimate might move if another sample were collected. Bootstrap resampling is a practical way to estimate sampling uncertainty when deriving an analytic formula is difficult or when the statistic is not a simple mean. The bootstrap idea Given an observed sample of size n: