In relevant log messages, indicate whether vacuums are aggressive.
Kyotaro Horiguchi, reviewed Masahiko Sawada, David G. Johnston, Álvaro Herrera, and me. Grammar correction to the final posted patch by me. Discussion: http://postgr.es/m/20170329.124649.193656100.horiguchi.kyotaro@lab.ntt.co.jp
This commit is contained in:
parent
0af98a95cf
commit
b55509332f
|
@ -355,6 +355,7 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
|
||||||
params->log_min_duration))
|
params->log_min_duration))
|
||||||
{
|
{
|
||||||
StringInfoData buf;
|
StringInfoData buf;
|
||||||
|
char *msgfmt;
|
||||||
|
|
||||||
TimestampDifference(starttime, endtime, &secs, &usecs);
|
TimestampDifference(starttime, endtime, &secs, &usecs);
|
||||||
|
|
||||||
|
@ -373,7 +374,11 @@ lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
|
||||||
* emitting individual parts of the message when not applicable.
|
* emitting individual parts of the message when not applicable.
|
||||||
*/
|
*/
|
||||||
initStringInfo(&buf);
|
initStringInfo(&buf);
|
||||||
appendStringInfo(&buf, _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n"),
|
if (aggressive)
|
||||||
|
msgfmt = _("automatic aggressive vacuum of table \"%s.%s.%s\": index scans: %d\n");
|
||||||
|
else
|
||||||
|
msgfmt = _("automatic vacuum of table \"%s.%s.%s\": index scans: %d\n");
|
||||||
|
appendStringInfo(&buf, msgfmt,
|
||||||
get_database_name(MyDatabaseId),
|
get_database_name(MyDatabaseId),
|
||||||
get_namespace_name(RelationGetNamespace(onerel)),
|
get_namespace_name(RelationGetNamespace(onerel)),
|
||||||
RelationGetRelationName(onerel),
|
RelationGetRelationName(onerel),
|
||||||
|
@ -486,10 +491,16 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats,
|
||||||
pg_rusage_init(&ru0);
|
pg_rusage_init(&ru0);
|
||||||
|
|
||||||
relname = RelationGetRelationName(onerel);
|
relname = RelationGetRelationName(onerel);
|
||||||
ereport(elevel,
|
if (aggressive)
|
||||||
(errmsg("vacuuming \"%s.%s\"",
|
ereport(elevel,
|
||||||
get_namespace_name(RelationGetNamespace(onerel)),
|
(errmsg("aggressively vacuuming \"%s.%s\"",
|
||||||
relname)));
|
get_namespace_name(RelationGetNamespace(onerel)),
|
||||||
|
relname)));
|
||||||
|
else
|
||||||
|
ereport(elevel,
|
||||||
|
(errmsg("vacuuming \"%s.%s\"",
|
||||||
|
get_namespace_name(RelationGetNamespace(onerel)),
|
||||||
|
relname)));
|
||||||
|
|
||||||
empty_pages = vacuumed_pages = 0;
|
empty_pages = vacuumed_pages = 0;
|
||||||
num_tuples = tups_vacuumed = nkeep = nunused = 0;
|
num_tuples = tups_vacuumed = nkeep = nunused = 0;
|
||||||
|
|
Loading…
Reference in New Issue