pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
vacuumdb and a long list of tables
3+ messages / 2 participants
[nested] [flat]

* vacuumdb and a long list of tables
@ 2025-02-23 18:09  Ron Johnson <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ron Johnson @ 2025-02-23 18:09 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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!

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: vacuumdb and a long list of tables
@ 2025-02-23 20:21  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Ron Johnson <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2025-02-23 20:21 UTC (permalink / raw)
  To: Ron Johnson <ronljohnsonjr@gmail.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: vacuumdb and a long list of tables
@ 2025-02-23 20:44  Ron Johnson <ronljohnsonjr@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Ron Johnson @ 2025-02-23 20:44 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

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!

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-02-23 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-23 18:09 vacuumdb and a long list of tables Ron Johnson <ronljohnsonjr@gmail.com>
2025-02-23 20:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-02-23 20:44   ` Ron Johnson <ronljohnsonjr@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox