Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-09-16 Thread Tom Lane
Jeff Davis writes: > On Wed, 2011-06-08 at 17:29 -0500, Kevin Grittner wrote: >> Heikki Linnakangas wrote: >>> AFAICS, the check for page lock is actually unnecessary. >> Absolutely correct. Patch attached. > I like the change, but the comment is slightly confusing. I've committed this patch

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-07-31 Thread Jeff Davis
On Wed, 2011-06-08 at 17:29 -0500, Kevin Grittner wrote: > Heikki Linnakangas wrote: > > heap_insert() calls CheckForSerializableConflictIn(), which checks if > > there is a predicate lock on the whole relation, or on the page we're > > inserting to. It does not check for tuple-level locks, becaus

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Kevin Grittner
Heikki Linnakangas wrote: > heap_insert() calls CheckForSerializableConflictIn(), which checks if > there is a predicate lock on the whole relation, or on the page we're > inserting to. It does not check for tuple-level locks, because there > can't be any locks on a tuple that didn't exist befo

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Kevin Grittner
Alvaro Herrera wrote: > Excerpts from Heikki Linnakangas's message of mié jun 08 05:45:35 -0400 2011: >> On 08.06.2011 12:36, Dan Ports wrote: > >>> The only thing I'd be worried about is that at some future point >>> we might add heap page locks -- say, for sequential scans that >>> don't read t

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Alvaro Herrera
Excerpts from Heikki Linnakangas's message of mié jun 08 05:45:35 -0400 2011: > On 08.06.2011 12:36, Dan Ports wrote: > > The only thing I'd be worried about is that at some future point we > > might add heap page locks -- say, for sequential scans that don't read > > the entire relation -- and ex

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Robert Haas
On Wed, Jun 8, 2011 at 5:36 AM, Dan Ports wrote: > On Wed, Jun 08, 2011 at 11:23:48AM +0300, Heikki Linnakangas wrote: >> AFAICS, the check for page lock is actually unnecessary. A page-level >> lock on a heap only occurs when tuple-level locks are promoted. It is >> just a coarser-grain represent

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Heikki Linnakangas
On 08.06.2011 12:36, Dan Ports wrote: On Wed, Jun 08, 2011 at 11:23:48AM +0300, Heikki Linnakangas wrote: AFAICS, the check for page lock is actually unnecessary. A page-level lock on a heap only occurs when tuple-level locks are promoted. It is just a coarser-grain representation of holding loc

Re: [HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Dan Ports
On Wed, Jun 08, 2011 at 11:23:48AM +0300, Heikki Linnakangas wrote: > AFAICS, the check for page lock is actually unnecessary. A page-level > lock on a heap only occurs when tuple-level locks are promoted. It is > just a coarser-grain representation of holding locks on all tuples on > the page,

[HACKERS] SSI heap_insert and page-level predicate locks

2011-06-08 Thread Heikki Linnakangas
heap_insert() calls CheckForSerializableConflictIn(), which checks if there is a predicate lock on the whole relation, or on the page we're inserting to. It does not check for tuple-level locks, because there can't be any locks on a tuple that didn't exist before. AFAICS, the check for page lo