Re: Emit namespace in post-copy output

From: Mike <miketheman(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Emit namespace in post-copy output
Date: 2021-06-25 15:10:47
Message-ID: CAMerE0rgBxn+KvmqQdO2Oju5rjE43=Afi90GcpNGZCd6HyVDNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Awesome, thanks! Are there any other steps I should take?

On Wed, Jun 23, 2021 at 5:46 PM Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
wrote:

> On Tue, Jun 22, 2021 at 6:08 PM Mike <miketheman(at)gmail(dot)com> wrote:
>
>> When running a VACUUM or CLUSTER command, the namespace name is not part
>> of the emitted message.
>>
>> Using `vacuumdb` CLI tool recently with multiple jobs, I found that
>> reading the output messages harder to match the relations with their
>> namespaces.
>>
>> Example:
>>
>> INFO: vacuuming "sendgrid.open"
>> INFO: vacuuming "mailgun.open"
>> ...
>> INFO: "open": found 0 removable, 31460776 nonremovable row versions in
>> 1358656 pages
>> DETAIL: 0 dead row versions cannot be removed yet.
>> CPU 31.35s/261.26u sec elapsed 1620.68 sec.
>> ...
>>
>> In this example. the user can't readily tell which `open` relation was
>> completed.
>>
>> Attached is a patch using existing functions to include the namespace in
>> the output string.
>>
>> Looking forward to feedback!
>> -Mike Fiedler
>>
>
> I've added this to the open commitfest:
> https://commitfest.postgresql.org/33/3200/
>
> The change is quite simple, just 3 lines, adding the schema name to two
> different lines of output.
>
> As such, there is no obvious documentation to change, though I can imagine
> that we have sample output from vacuum, vacuumdb or cluster somewhere that
> would need to be updated.
>
> I cobbled together a very simple test:
>
> ~/pgdata$ /usr/local/pgsql/bin/psql postgres
> psql (14beta2)
> Type "help" for help.
> postgres=# create database mike_test;
> CREATE DATABASE
> postgres=# \c mike_test
> You are now connected to database "mike_test" as user "corey".
> mike_test=# create schema foo;
> CREATE SCHEMA
> mike_test=# create table foo.bar(x integer);
> CREATE TABLE
> mike_test=# \q
> mike_test=# VACUUM FULL VERBOSE foo.bar;
> INFO: vacuuming "foo.bar"
> INFO: "foo.bar": found 0 removable, 0 nonremovable row versions in 0 pages
> DETAIL: 0 dead row versions cannot be removed yet.
> CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
> VACUUM
>
>
> And of course vacuumdb
>
> ~/pgdata$ /usr/local/pgsql/bin/vacuumdb --full --verbose mike_test
> --table=foo.bar
> vacuumdb: vacuuming database "mike_test"
> INFO: vacuuming "foo.bar"
> INFO: "foo.bar": found 0 removable, 0 nonremovable row versions in 0 pages
> DETAIL: 0 dead row versions cannot be removed yet.
> CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
>
>
> So far, so good.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-06-25 15:43:55 Re: Using indexUnchanged with nbtree
Previous Message Tom Lane 2021-06-25 14:46:57 Re: subscription/t/010_truncate.pl failure on desmoxytes in REL_13_STABLE