Re: how to investigate GIN fast updates and cleanup cycles?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Kehlet <steve(dot)kehlet(at)gmail(dot)com>
Cc: Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to investigate GIN fast updates and cleanup cycles?
Date: 2015-08-28 17:32:40
Message-ID: 25835.1440783160@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Kehlet <steve(dot)kehlet(at)gmail(dot)com> writes:
> On Fri, Aug 28, 2015 at 10:11 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Hm ... have you tried checking pg_locks to see if they're blocked on
>> something identifiable?

> Yes, I should have mentioned that, I have a cronjob going every minute
> dumping out [blocked/blocking queries](
> https://gist.github.com/skehlet/fbf5f52e18149e14e520) and nothing has shown
> up related to these queries (there were some other normal unrelated
> results, so I believe the job+query itself are working).

BTW, I think your query is probably missing some cases:

( blockingl.transactionid=blockedl.transactionid
OR
(blockingl.relation=blockedl.relation AND blockingl.locktype=blockedl.locktype)
)

This supposes that locks of different strengths don't block each other,
which is certainly wrong. I think you could probably just drop the check
on locktype. You might want to tighten the WHERE to "WHERE
blockingl.granted AND NOT blockedl.granted", as well.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2015-08-28 17:42:41 Re: how to investigate GIN fast updates and cleanup cycles?
Previous Message Tom Lane 2015-08-28 17:27:08 Re: how to investigate GIN fast updates and cleanup cycles?