CK_DELETE = CMD_DELETE,
CK_TRUNCATE,
CK_FASTTRUNCATE,
- CK_CREATE
+ CK_CREATE,
+ CK_ANALYZE,
+ CK_VACUUM
} CmdKind;
rstat->tableid = relOid;
newTable = true;
}
+ else if (operation == CK_VACUUM)
+ {
+ /* force reread becouse vacuum could change n_tuples */
+ rstat->rereadStat = true;
+ return;
+ }
+ else if (operation == CK_ANALYZE)
+ {
+ /* only analyze */
+ rstat->changes_since_analyze = 0;
+ return;
+ }
Assert(rstat->tableid == relOid);
tblnames = list_copy(((TruncateStmt*)parsetree)->relations);
op = CK_TRUNCATE;
}
+ else if (IsA(parsetree, VacuumStmt))
+ {
+ VacuumStmt *vac = (VacuumStmt*)parsetree;
+
+ tblnames = list_make1(vac->relation);
+
+ if (vac->options & (VACOPT_VACUUM | VACOPT_FULL | VACOPT_FREEZE))
+ /* optionally with analyze */
+ op = CK_VACUUM;
+ else if (vac->options & VACOPT_ANALYZE)
+ op = CK_ANALYZE;
+ else
+ tblnames = NIL;
+ }
}
#if PG_VERSION_NUM >= 100000