|
13 | 13 | * |
14 | 14 | * |
15 | 15 | * IDENTIFICATION |
16 | | - * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.322 2006/02/1116:59:09 momjian Exp $ |
| 16 | + * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.323 2006/02/1117:14:09 momjian Exp $ |
17 | 17 | * |
18 | 18 | *------------------------------------------------------------------------- |
19 | 19 | */ |
@@ -719,8 +719,7 @@ vac_update_relstats(Oid relid, BlockNumber num_pages, double num_tuples, |
719 | 719 | /* overwrite the existing statistics in the tuple */ |
720 | 720 | pgcform= (Form_pg_class)GETSTRUCT(&rtup); |
721 | 721 | pgcform->relpages= (int32)num_pages; |
722 | | -if (num_tuples >=0 ) |
723 | | -pgcform->reltuples= (float4)num_tuples; |
| 722 | +pgcform->reltuples= (float4)num_tuples; |
724 | 723 | pgcform->relhasindex=hasindex; |
725 | 724 |
|
726 | 725 | /* |
@@ -2962,18 +2961,15 @@ scan_index(Relation indrel, double num_tuples) |
2962 | 2961 | if (!stats) |
2963 | 2962 | return; |
2964 | 2963 |
|
2965 | | -/* now update statistics in pg_class |
2966 | | - * we use the number of tuples from the table because we have not |
2967 | | - * actually scanned the index, so don't know the number of tuples in index |
2968 | | - */ |
| 2964 | +/* now update statistics in pg_class */ |
2969 | 2965 | vac_update_relstats(RelationGetRelid(indrel), |
2970 | | -stats->num_pages,num_tuples, |
| 2966 | +stats->num_pages,stats->num_index_tuples, |
2971 | 2967 | false); |
2972 | 2968 |
|
2973 | 2969 | ereport(elevel, |
2974 | 2970 | (errmsg("index \"%s\" now contains %.0f row versions in %u pages", |
2975 | 2971 | RelationGetRelationName(indrel), |
2976 | | -num_tuples, |
| 2972 | +stats->num_index_tuples, |
2977 | 2973 | stats->num_pages), |
2978 | 2974 | errdetail("%u index pages have been deleted, %u are currently reusable.\n" |
2979 | 2975 | "%s.", |
|