On Aug 15, 2006, at 10:40 , Jim C. Nasby wrote:

Yeah, unless someone comes up with some kind of 'magic', I think trying
to handle every cross-column possibility is a non-starter. IIRC, that
argument is what's stalled cross-column stats every time in the past. It makes a lot more sense to allow defining what combinations of columns we
need stats for.

After that's done, it'd be easy to then write a script that will tell
the database to collect stats on all multi-column indexes, RI, etc. Down
the road, the planner could even be made to log (in a machine-readable
format) every time it needs cross-column stats, and that data could be
used to add stats that are needed.

I've always found it odd that database didn't determine which statistics are the most interesting from the queries themselves. At the very least, the database could make suggestions: "It looks like this prepared query which is used often could benefit from an index on x(a,b,c)." That would be better than me guessing.

-M

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to