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:46:03
Message-ID: 26259.1440783963@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wrote:
> 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.

Oh, wait, scratch that: I was confusing locktype with mode. I'm still
suspicious about whether this is covering all cases though. It's
certainly not trying very hard to make sure the locks match up; though
that would tend to lead to too many reports not too few. Still, you could
be missing a lock conflict on some other kind of lock. I'd suggest
writing this part along the lines of

(blockingl.locktype,
blockingl.database,
blockingl.relation,
blockingl.page,
blockingl.tuple,
blockingl.virtualxid,
blockingl.transactionid,
blockingl.classid,
blockingl.objid,
blockingl.objsubid)
IS NOT DISTINCT FROM
(blockedl.locktype,
blockedl.database,
blockedl.relation,
blockedl.page,
blockedl.tuple,
blockedl.virtualxid,
blockedl.transactionid,
blockedl.classid,
blockedl.objid,
blockedl.objsubid)

which should reliably give the right answer.

regards, tom lane

In response to

Browse pgsql-general by date

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