Fix ANALYZE's ancient deficiency of not trying to collect stats for expression
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 1 Aug 2010 22:38:11 +0000 (22:38 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 1 Aug 2010 22:38:11 +0000 (22:38 +0000)
commit67becf8d41a082eaaf6db6e0860d49409b79e32b
tree2a98eb719c55811c0a59778da754733ea82aa084
parent97532f7c29468010b87e40a04f8daa3eb097f654
Fix ANALYZE's ancient deficiency of not trying to collect stats for expression
indexes when the index column type (the opclass opckeytype) is different from
the expression's datatype.  When coded, this limitation wasn't worth worrying
about because we had no intelligence to speak of in stats collection for the
datatypes used by such opclasses.  However, now that there's non-toy
estimation capability for tsvector queries, it amounts to a bug that ANALYZE
fails to do this.

The fix changes struct VacAttrStats, and therefore constitutes an API break
for custom typanalyze functions.  Therefore we can't back-patch it into
released branches, but it was agreed that 9.0 isn't yet frozen hard enough
to make such a change unacceptable.  Ergo, back-patch to 9.0 but no further.
The API break had better be mentioned in 9.0 release notes.
src/backend/commands/analyze.c
src/include/commands/vacuum.h