pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Emiliano Saenz <saenz.emi.jos@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: The Curious Case of the Table-Locking UPDATE Query
Date: Tue, 6 Jul 2021 11:24:39 +0200
Message-ID: <20210706092439.GA6661@depesz.com> (raw)
In-Reply-To: <CAMdU7qsXphcRDKc33QuvVwmymH1HaahJTatgA32+2So_h7m4OA@mail.gmail.com>
References: <CAMdU7qsXphcRDKc33QuvVwmymH1HaahJTatgA32+2So_h7m4OA@mail.gmail.com>

On Mon, Jul 05, 2021 at 08:22:39PM -0300, Emiliano Saenz wrote:
> We have a huge POSTGRES 9.4 database in the production environment (several
> tables have more than 100.000.00 registers). Last two months we have had
> problems with CPU utilization. Debugging the locks (on pg_locks) we notice
> that sometimes simple UPDATE (by primary key) operation takes out
> ACCESS_EXCLUSIVE_LOCK mode over these huge tables so POSTGRES DB collapses
> and it generates excessive CPU consumption. My question is, How is it
> possible that UPDATE operation takes out ACCESS_EXCLUSIVE_LOCK mode?
> More information, this system never manifests this behavior before and we
> don't make software changes on last 2 years


To be able to help we will need pg_stat_activity data for the for
backend that has this lock, and pg_locks information for it too.

And, please, send text, and not screenshot.

Best regards,

depesz






view thread (8+ messages)  latest in thread

Message-ID: <20210706092439.GA6661@depesz.com>
Permalink:  ../20210706092439.GA6661@depesz.com/
Also on:    postgresql.org/message-id/20210706092439.GA6661@depesz.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, saenz.emi.jos@gmail.com
  Subject: Re: The Curious Case of the Table-Locking UPDATE Query
  In-Reply-To: <20210706092439.GA6661@depesz.com>
  References: <CAMdU7qsXphcRDKc33QuvVwmymH1HaahJTatgA32+2So_h7m4OA@mail.gmail.com> <20210706092439.GA6661@depesz.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