*** pgsql/src/backend/commands/analyze.c 2009/06/11 14:48:55 1.139 --- pgsql/src/backend/commands/analyze.c 2009/08/02 22:14:52 1.140 *************** *** 8,14 **** * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.138 2009/06/06 22:13:51 tgl Exp $ * *------------------------------------------------------------------------- */ --- 8,14 ---- * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.139 2009/06/11 14:48:55 momjian Exp $ * *------------------------------------------------------------------------- */ *************** analyze_rel(Oid relid, VacuumStmt *vacst *** 425,430 **** --- 425,435 ---- std_fetch_func, numrows, totalrows); + + /* If attdistinct is set, override with that value */ + if (stats->attr->attdistinct != 0) + stats->stadistinct = stats->attr->attdistinct; + MemoryContextResetAndDeleteChildren(col_context); } *************** compute_index_stats(Relation onerel, dou *** 679,684 **** --- 684,692 ---- ind_fetch_func, numindexrows, totalindexrows); + /* If attdistinct is set, override with that value */ + if (stats->attr->attdistinct != 0) + stats->stadistinct = stats->attr->attdistinct; MemoryContextResetAndDeleteChildren(col_context); } }