Thread: vacuumdb and a long list of tables

vacuumdb and a long list of tables

From
Ron Johnson
Date:
PG 14, if it matters.

Is there any specific order by which "vacuumdb -t t1 -t t2 -t t3 ..." processes those tables?

I pass an alphabetical list of tables, but "vacuumdb --echo" doesn't process them alphabetically.  Nor does it process them in oid order or seemingly by table size.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

Re: vacuumdb and a long list of tables

From
Tom Lane
Date:
Ron Johnson <ronljohnsonjr@gmail.com> writes:
> Is there any specific order by which "vacuumdb -t t1 -t t2 -t t3 ..."
> processes those tables?

A quick look at the source code finds

    appendPQExpBufferStr(&catalog_query, " ORDER BY c.relpages DESC;");

so apparently it's trying to process them in descending size order,
although this doesn't account for indexes or toast tables.

            regards, tom lane



Re: vacuumdb and a long list of tables

From
Ron Johnson
Date:
On Sun, Feb 23, 2025 at 3:21 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ron Johnson <ronljohnsonjr@gmail.com> writes:
> Is there any specific order by which "vacuumdb -t t1 -t t2 -t t3 ..."
> processes those tables?

A quick look at the source code finds

        appendPQExpBufferStr(&catalog_query, " ORDER BY c.relpages DESC;");

so apparently it's trying to process them in descending size order,
although this doesn't account for indexes or toast tables.

Toast tables... when I wrote my email, I was wondering about that.  TOAST is what comprises the "bigness" of the 800 lb gorillas, but combining table plus toast would be pretty messy.

Thanks.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!