Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f4f4a64

Browse files
committed
Message style improvements
1 parent fb2c502 commit f4f4a64

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

src/backend/access/heap/vacuumlazy.c

+19-17
Original file line numberDiff line numberDiff line change
@@ -807,21 +807,21 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
807807

808808
if (vacrel->do_index_vacuuming)
809809
{
810-
msgfmt = _(" %u pages from table (%.2f%% of total) had %lld dead item identifiers removed\n");
810+
msgfmt = _("%u pages from table (%.2f%% of total) had %lld dead item identifiers removed\n");
811811

812812
if (vacrel->nindexes == 0 || vacrel->num_index_scans == 0)
813-
appendStringInfoString(&buf, _("index scan not needed:"));
813+
appendStringInfoString(&buf, _("index scan not needed: "));
814814
else
815-
appendStringInfoString(&buf, _("index scan needed:"));
815+
appendStringInfoString(&buf, _("index scan needed: "));
816816
}
817817
else
818818
{
819-
msgfmt = _(" %u pages from table (%.2f%% of total) have %lld dead item identifiers\n");
819+
msgfmt = _("%u pages from table (%.2f%% of total) have %lld dead item identifiers\n");
820820

821821
if (!vacrel->failsafe_active)
822-
appendStringInfoString(&buf, _("index scan bypassed:"));
822+
appendStringInfoString(&buf, _("index scan bypassed: "));
823823
else
824-
appendStringInfoString(&buf, _("index scan bypassed by failsafe:"));
824+
appendStringInfoString(&buf, _("index scan bypassed by failsafe: "));
825825
}
826826
orig_rel_pages = vacrel->rel_pages + vacrel->pages_removed;
827827
appendStringInfo(&buf, msgfmt,
@@ -848,12 +848,14 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
848848
read_rate, write_rate);
849849
if (track_io_timing)
850850
{
851-
appendStringInfoString(&buf, _("I/O Timings:"));
851+
appendStringInfoString(&buf, _("I/O timings:"));
852852
if (pgStatBlockReadTime - startreadtime > 0)
853-
appendStringInfo(&buf, _(" read=%.3f"),
853+
appendStringInfo(&buf, _(" read: %.3f ms"),
854854
(double) (pgStatBlockReadTime - startreadtime) / 1000);
855+
if ((pgStatBlockReadTime - startreadtime > 0) && (pgStatBlockWriteTime - startwritetime > 0))
856+
appendStringInfoString(&buf, _(","));
855857
if (pgStatBlockWriteTime - startwritetime > 0)
856-
appendStringInfo(&buf, _(" write=%.3f"),
858+
appendStringInfo(&buf, _(" write: %.3f ms"),
857859
(double) (pgStatBlockWriteTime - startwritetime) / 1000);
858860
appendStringInfoChar(&buf, '\n');
859861
}
@@ -1650,7 +1652,7 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive)
16501652
*/
16511653
if (vacrel->nindexes == 0 && vacrel->lpdead_item_pages > 0)
16521654
ereport(elevel,
1653-
(errmsg("\"%s\": removed %lld dead item identifiers in %u pages",
1655+
(errmsg("table \"%s\": removed %lld dead item identifiers in %u pages",
16541656
vacrel->relname, (long long) vacrel->lpdead_items,
16551657
vacrel->lpdead_item_pages)));
16561658

@@ -1673,7 +1675,7 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive)
16731675
appendStringInfo(&buf, _("%s."), pg_rusage_show(&ru0));
16741676

16751677
ereport(elevel,
1676-
(errmsg("\"%s\": found %lld removable, %lld nonremovable row versions in %u out of %u pages",
1678+
(errmsg("table \"%s\": found %lld removable, %lld nonremovable row versions in %u out of %u pages",
16771679
vacrel->relname,
16781680
(long long) vacrel->tuples_deleted,
16791681
(long long) vacrel->num_tuples, vacrel->scanned_pages,
@@ -2177,7 +2179,7 @@ lazy_vacuum(LVRelState *vacrel)
21772179
*/
21782180
vacrel->do_index_vacuuming = false;
21792181
ereport(elevel,
2180-
(errmsg("\"%s\": index scan bypassed: %u pages from table (%.2f%% of total) have %lld dead item identifiers",
2182+
(errmsg("table \"%s\": index scan bypassed: %u pages from table (%.2f%% of total) have %lld dead item identifiers",
21812183
vacrel->relname, vacrel->lpdead_item_pages,
21822184
100.0 * vacrel->lpdead_item_pages / vacrel->rel_pages,
21832185
(long long) vacrel->lpdead_items)));
@@ -2388,8 +2390,8 @@ lazy_vacuum_heap_rel(LVRelState *vacrel)
23882390
vacuumed_pages == vacrel->lpdead_item_pages));
23892391

23902392
ereport(elevel,
2391-
(errmsg("\"%s\": removed %d dead item identifiers in %u pages",
2392-
vacrel->relname, tupindex, vacuumed_pages),
2393+
(errmsg("table \"%s\": removed %lld dead item identifiers in %u pages",
2394+
vacrel->relname, (long long ) tupindex, vacuumed_pages),
23932395
errdetail_internal("%s", pg_rusage_show(&ru0))));
23942396

23952397
/* Revert to the previous phase information for error traceback */
@@ -2625,7 +2627,7 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel)
26252627
vacrel->relnamespace,
26262628
vacrel->relname,
26272629
vacrel->num_index_scans),
2628-
errdetail("table's relfrozenxid or relminmxid is too far in the past"),
2630+
errdetail("The table's relfrozenxid or relminmxid is too far in the past."),
26292631
errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n"
26302632
"You might also need to consider other ways for VACUUM to keep up with the allocation of transaction IDs.")));
26312633

@@ -4265,7 +4267,7 @@ vacuum_error_callback(void *arg)
42654267
if (BlockNumberIsValid(errinfo->blkno))
42664268
{
42674269
if (OffsetNumberIsValid(errinfo->offnum))
4268-
errcontext("while scanning block %u and offset %u of relation \"%s.%s\"",
4270+
errcontext("while scanning block %u offset %u of relation \"%s.%s\"",
42694271
errinfo->blkno, errinfo->offnum, errinfo->relnamespace, errinfo->relname);
42704272
else
42714273
errcontext("while scanning block %u of relation \"%s.%s\"",
@@ -4280,7 +4282,7 @@ vacuum_error_callback(void *arg)
42804282
if (BlockNumberIsValid(errinfo->blkno))
42814283
{
42824284
if (OffsetNumberIsValid(errinfo->offnum))
4283-
errcontext("while vacuuming block %u and offset %u of relation \"%s.%s\"",
4285+
errcontext("while vacuuming block %u offset %u of relation \"%s.%s\"",
42844286
errinfo->blkno, errinfo->offnum, errinfo->relnamespace, errinfo->relname);
42854287
else
42864288
errcontext("while vacuuming block %u of relation \"%s.%s\"",

src/backend/commands/analyze.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
778778
* reads which are also picked up by track_io_timing, if enabled,
779779
* the 'average write rate' is actually talking about the rate of
780780
* pages being dirtied, not being written out, so it's typical to
781-
* have a non-zero 'avg write rate' while I/O Timings only reports
781+
* have a non-zero 'avg write rate' while I/O timings only reports
782782
* reads.
783783
*
784784
* It's not clear that an ANALYZE will ever result in
@@ -813,12 +813,14 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
813813
read_rate, write_rate);
814814
if (track_io_timing)
815815
{
816-
appendStringInfoString(&buf, _("I/O Timings:"));
816+
appendStringInfoString(&buf, _("I/O timings:"));
817817
if (pgStatBlockReadTime - startreadtime > 0)
818-
appendStringInfo(&buf, _(" read=%.3f"),
818+
appendStringInfo(&buf, _(" read: %.3f ms"),
819819
(double) (pgStatBlockReadTime - startreadtime) / 1000);
820+
if ((pgStatBlockReadTime - startreadtime > 0) && (pgStatBlockWriteTime - startwritetime > 0))
821+
appendStringInfoString(&buf, _(","));
820822
if (pgStatBlockWriteTime - startwritetime > 0)
821-
appendStringInfo(&buf, _(" write=%.3f"),
823+
appendStringInfo(&buf, _(" write: %.3f ms"),
822824
(double) (pgStatBlockWriteTime - startwritetime) / 1000);
823825
appendStringInfoChar(&buf, '\n');
824826
}

0 commit comments

Comments
 (0)