pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Murthy Nunna <mnunna@fnal.gov>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Vacuumdb on a table
Date: Wed, 18 Oct 2023 22:38:36 -0600
Message-ID: <656F86ED-DB7D-4D9D-A94E-FC20C84B53EA@elevated-dev.com> (raw)
In-Reply-To: <CAHw75vvYL0tFnRdpGVgqmWM=h7n49mYSjBpXW56emtCJ26tzLA@mail.gmail.com>
References: <DM8PR09MB66773DD56212C1EEF997ECDBB8D5A@DM8PR09MB6677.namprd09.prod.outlook.com>
	<CAHw75vvYL0tFnRdpGVgqmWM=h7n49mYSjBpXW56emtCJ26tzLA@mail.gmail.com>

> On Oct 18, 2023, at 10:31 PM, Keith <keith@keithf4.com> wrote:
> 
> Check pg_stat_activity or pg_locks to see if there are any open transactions or locks on the table in question.

pg_stat_statements is good too

write a couple of queries to find:

- queries run most often
- queries that are slowest
- queries that are most executions x time

the first one is good for finding badly-behaved applications or scripts; the others can point out need for indexes






view thread (7+ messages)  latest in thread

Message-ID: <656F86ED-DB7D-4D9D-A94E-FC20C84B53EA@elevated-dev.com>
Permalink:  ../656F86ED-DB7D-4D9D-A94E-FC20C84B53EA@elevated-dev.com/
Also on:    postgresql.org/message-id/656F86ED-DB7D-4D9D-A94E-FC20C84B53EA@elevated-dev.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott_ribe@elevated-dev.com, mnunna@fnal.gov
  Subject: Re: Vacuumdb on a table
  In-Reply-To: <656F86ED-DB7D-4D9D-A94E-FC20C84B53EA@elevated-dev.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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