Re: how to investigate GIN fast updates and cleanup cycles? - Mailing list pgsql-general

From Tom Lane
Subject Re: how to investigate GIN fast updates and cleanup cycles?
Date
Msg-id 26259.1440783963@sss.pgh.pa.us
Whole thread Raw
In response to Re: how to investigate GIN fast updates and cleanup cycles?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: how to investigate GIN fast updates and cleanup cycles?
Next
From: Tom Lane
Date:
Subject: Re: how to investigate GIN fast updates and cleanup cycles?