Unix Technical Forum

Re: [WIP] shared row locks

This is a discussion on Re: [WIP] shared row locks within the Pgsql Patches forums, part of the PostgreSQL category; --> Alvaro Herrera <alvherre@dcc.uchile.cl> writes: > 1. To examine a tuple one must first call LockTuple, which grabs a pin ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:12 AM
Tom Lane
 
Posts: n/a
Default Re: [WIP] shared row locks

Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> 1. To examine a tuple one must first call LockTuple, which grabs a pin
> and lock in the buffer. The buffer lock is released right away, but the
> pin is kept.


Surely you don't mean that *every* access to a tuple now has to go
through the lock manager :-(. Have you done any performance testing?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:12 AM
Alvaro Herrera
 
Posts: n/a
Default Re: [WIP] shared row locks

On Mon, Mar 28, 2005 at 11:18:05PM -0500, Tom Lane wrote:
> Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> > 1. To examine a tuple one must first call LockTuple, which grabs a pin
> > and lock in the buffer. The buffer lock is released right away, but the
> > pin is kept.

>
> Surely you don't mean that *every* access to a tuple now has to go
> through the lock manager :-(.


Hmm. Only updates (delete/select for update) of the tuples, not a
vanilla select. Is that what you mean? I realize I left out the fact
that the old rule still applies when dealing with standard select.

Oh, that's a big hole in the reasoning. The buffer has to be locked
still in 3 because of this. Will fix.

> Have you done any performance testing?


Not really. Will do tomorrow.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"La principal característica humana es la tontería"
(Augusto Monterroso)

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:12 AM
Alvaro Herrera
 
Posts: n/a
Default Re: [WIP] shared row locks

On Mon, Mar 28, 2005 at 11:18:05PM -0500, Tom Lane wrote:
> Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> > 1. To examine a tuple one must first call LockTuple, which grabs a pin
> > and lock in the buffer. The buffer lock is released right away, but the
> > pin is kept.

>
> Surely you don't mean that *every* access to a tuple now has to go
> through the lock manager :-(. Have you done any performance testing?


Ok, I fixed the problem (basically, the old locking rules still apply:
would-be tuple modifiers need to hold locks on the buffer as well as on
the tuples). The changes to the patch are not considerable so I won't
post it again.

I played with pgbench a bit and was horrified at first because I was
taking a 25% perf. hit. Then I remembered that I had compiled
backend/access/heap with -O0 ... doh. So I recompiled and now I can't
measure any difference.

Right now I'm figuring out a way of making the lock queue go to disk.
I think I'll make a LRU list, and when we are short in space the LRU locks
will be replaced by a placeholder that will only keep the LOCKTAG and
info necessary to retrieve it from disk. The LOCK struct is 132 bytes
long on my platform, and the placeholder would be 20 bytes (LOCKTAG +
int), so by storing a couple of locks there's room for another one
(that's the simple theory that ignores memory fragmentation issues).
I'm just starting to figure this out so if there are comments I welcome
them.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Hay que recordar que la existencia en el cosmos, y particularmente la
elaboración de civilizaciones dentre de él no son, por desgracia,
nada idílicas" (Ijon Tichy)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:29 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com