Improving Planner Prediction Accuracy with Custom Selectivity Functions

Talk Type: 
45 Minute Talk
Technical Level: 
Intermediate
License: 
Creative Commons - Attribution Only

Postgres relies heavily on statistics collected from data tables to execute queries in the most efficient way possible. Despite the relative simplicity of these statistics, the actual process by which they are collected and used to generate plans is very complex. In this talk, I will give a quick overview of the assumptions that the planner makes about data access patterns and the heuristics that generate and make use of the collected statistics. Then, I will show how custom selectivity functions can dramatically improve the planner accuracy for two very different, but common, data distributions.