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

2011-09-16 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: On Wed, 2011-06-08 at 17:29 -0500, Kevin Grittner wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: AFAICS, the check for page lock is actually unnecessary. Absolutely correct. Patch attached. I like the change, but the comment is

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 heikki.linnakan...@enterprisedb.com 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

[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

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,

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

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 d...@csail.mit.edu 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

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 expect

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

2011-06-08 Thread Kevin Grittner
Alvaro Herrera alvhe...@commandprompt.com 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

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

2011-06-08 Thread Kevin Grittner
Heikki Linnakangas heikki.linnakan...@enterprisedb.com 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