Remix.run Logo
jmalicki 3 days ago

Without storing the joint distribution of the values corresponding to the conditions that span multiple tables, it can be hard to know what's a win.

Seattle3503 3 days ago | parent [-]

Postgres by default computes univariate stats for each column and uses those. If this is producing bad query plans, you can extend the statistics to be multivariate for select groups of columns manually. But to avoid combinatorially growth of stats related storage and work, you have to pick the columns by hand.

jmalicki 2 days ago | parent [-]

That still isn't multivariate stats across a join.