Re: Long running DDL statements blocking all queries

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Ashu Pachauri <ashu210890(at)gmail(dot)com>
Cc: f(dot)pardi(at)portavita(dot)eu, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Long running DDL statements blocking all queries
Date: 2018-06-03 13:49:02
Message-ID: CAMkU=1w5uUt0hAVHbvYg55vDHOYZsffAX9Ctnd8FMqsf2Va=RA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 31, 2018 at 9:19 AM, Ashu Pachauri <ashu210890(at)gmail(dot)com> wrote:

> There was too much noise in the pg_stat_activity output, so I did not post
> it. I'll collect the output again and post.
>
> But, when I checked in pg_stat_activity, PID 18317 is the session that's
> running the ALTER statement and it was showing up as "active". So, it's not
> blocked by anything, but the fact that the ALTER statement is long running
> and it's blocking the operations that are not even on the same table for
> the entire duration it's running is troubling.
>
>
I think what you really need to know here is what lock it was holding which
was blocking everyone. That information won't be found in the
pg_stat_activity. It will be found in pg_locks, but the specific query you
ran on that view did not display the columns with that information. You
need to include all the columns in the output which you used to join the
two pg_locks together. Yes, it will be voluminous, and most of them will
not be relevant, but you don't know which ones are relevant until after you
see the output.

Cheers,

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-06-03 18:29:59 Re: Code of Conduct plan
Previous Message Jeff Janes 2018-06-03 13:38:06 Re: LDAP authentication slow