Commit 766bdd2b authored by Bruce Momjian's avatar Bruce Momjian

Vacuum cleanups from Massimo.

parent b913dd1f
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.24 1997/03/09 07:12:36 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.25 1997/03/09 23:29:15 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -451,12 +451,6 @@ vc_vacone (Oid relid) ...@@ -451,12 +451,6 @@ vc_vacone (Oid relid)
stats->cmpgt = pgopform->oprcode; stats->cmpgt = pgopform->oprcode;
} }
else stats->cmpgt = InvalidOid; else stats->cmpgt = InvalidOid;
func_operator = oper(">",stats->attr->atttypid,stats->attr->atttypid,true);
if (func_operator != NULL) {
pgopform = (OperatorTupleForm) GETSTRUCT(func_operator);
stats->cmpgt = pgopform->oprcode;
}
else stats->cmpgt = InvalidOid;
pgttup = SearchSysCacheTuple(TYPOID, pgttup = SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(stats->attr->atttypid), ObjectIdGetDatum(stats->attr->atttypid),
0,0,0); 0,0,0);
...@@ -1572,18 +1566,20 @@ vc_attrstats(Relation onerel, VacAttrStats *vacattrstats, HeapTuple htup) ...@@ -1572,18 +1566,20 @@ vc_attrstats(Relation onerel, VacAttrStats *vacattrstats, HeapTuple htup)
} }
stats->initialized = true; stats->initialized = true;
} }
if (VacAttrStatsLtGtValid(stats) && fmgr(stats->cmplt,value,stats->min)) { if (VacAttrStatsLtGtValid(stats) {
if (fmgr(stats->cmplt,value,stats->min)) {
vc_bucketcpy(stats->attr, value, &stats->min, &stats->min_len); vc_bucketcpy(stats->attr, value, &stats->min, &stats->min_len);
stats->min_cnt = 0; stats->min_cnt = 0;
} }
if (VacAttrStatsLtGtValid(stats) && fmgr(stats->cmpgt,value,stats->max)) { if (fmgr(stats->cmpgt,value,stats->max)) {
vc_bucketcpy(stats->attr, value, &stats->max, &stats->max_len); vc_bucketcpy(stats->attr, value, &stats->max, &stats->max_len);
stats->max_cnt = 0; stats->max_cnt = 0;
} }
if (VacAttrStatsLtGtValid(stats) && fmgr(stats->cmpeq,value,stats->min)) if (fmgr(stats->cmpeq,value,stats->min))
stats->min_cnt++; stats->min_cnt++;
else if (VacAttrStatsLtGtValid(stats) && fmgr(stats->cmpeq,value,stats->max)) else if (fmgr(stats->cmpeq,value,stats->max))
stats-> max_cnt++; stats->max_cnt++;
}
if (fmgr(stats->cmpeq,value,stats->best)) if (fmgr(stats->cmpeq,value,stats->best))
stats-> best_cnt++; stats-> best_cnt++;
else if (fmgr(stats->cmpeq,value,stats->guess1)) { else if (fmgr(stats->cmpeq,value,stats->guess1)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment