Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-17 Thread Robert Haas
On Tue, Jul 12, 2011 at 3:24 PM, Jeff Davis wrote: > On Tue, 2011-07-12 at 13:32 -0500, Robert Haas wrote: >> On Jul 12, 2011, at 12:02 PM, Jeff Davis wrote: >> > Yeah, I think you're right here. It's probably not much of a practical >> > concern. >> > >> > I was slightly bothered because it seem

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-12 Thread Jeff Davis
On Tue, 2011-07-12 at 13:32 -0500, Robert Haas wrote: > On Jul 12, 2011, at 12:02 PM, Jeff Davis wrote: > > Yeah, I think you're right here. It's probably not much of a practical > > concern. > > > > I was slightly bothered because it seemed a little unpredictable. But it > > seems very minor, an

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-12 Thread Robert Haas
On Jul 12, 2011, at 12:02 PM, Jeff Davis wrote: > Yeah, I think you're right here. It's probably not much of a practical > concern. > > I was slightly bothered because it seemed a little unpredictable. But it > seems very minor, and if we wanted to fix it later I think we could. Yes, I agree. I

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-12 Thread Jeff Davis
On Tue, 2011-07-12 at 07:55 -0500, Robert Haas wrote: > I haven't been that worried about overflow of the fast path table. If > you are locking more than 16 relations at once, you probably have at > least 5 tables in the query, maybe more - it depends in how many > indexes you have, of course. My

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-12 Thread Robert Haas
On Jul 11, 2011, at 11:45 AM, Jeff Davis wrote: > * ... It's also possible that > * we're acquiring a second or third lock type on a relation we have > * already locked using the fast-path, but for now we don't worry about > * that case either. > */ > > How common is that case? There are only 16

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-11 Thread Jeff Davis
* ... It's also possible that * we're acquiring a second or third lock type on a relation we have * already locked using the fast-path, but for now we don't worry about * that case either. */ How common is that case? There are only 16 entries in the fast path lock table, so it seems like it w

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-11 Thread Florian Weimer
* Jeff Davis: > Does this happen to be based on some academic research? I don't > necessarily expect it to be; just thought I'd ask. Paul E. McKenney's thesis contains a few references. It's called "asymmetrical reader-writer locking" there, and Ingo Molnar implemented this as "brlock" in Linux

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-10 Thread Robert Haas
On Jul 10, 2011, at 4:15 PM, Jeff Davis wrote: > On Mon, 2011-06-27 at 10:13 -0400, Robert Haas wrote: >> I didn't get a lot of comments on my the previous version of my patch >> to accelerate table locks. >> >> http://archives.postgresql.org/pgsql-hackers/2011-06/msg00953.php >> >> Here's a new

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-10 Thread Jeff Davis
A few very minor things that I noticed: 1. You use pre-increment in "for" loops (e.g. FastPathGrantLock). The rest of the code seems to use post-increment in "for" loops, so you might as well stick to the convention in cases where the two have identical meaning. 2. Typo in the README: "acquire th

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-10 Thread Jeff Davis
On Mon, 2011-06-27 at 10:13 -0400, Robert Haas wrote: > I didn't get a lot of comments on my the previous version of my patch > to accelerate table locks. > > http://archives.postgresql.org/pgsql-hackers/2011-06/msg00953.php > > Here's a new version anyway. In this version, I have: I am trying

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-06 Thread Robert Haas
On Wed, Jul 6, 2011 at 2:02 PM, Jeff Davis wrote: > On Thu, 2011-06-30 at 19:25 -0400, Robert Haas wrote: >> I'm really hurting >> for is some code review. > > I'm trying to get my head into this patch. I have a couple questions: > > Does this happen to be based on some academic research? I don't

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-07-06 Thread Jeff Davis
On Thu, 2011-06-30 at 19:25 -0400, Robert Haas wrote: > I'm really hurting > for is some code review. I'm trying to get my head into this patch. I have a couple questions: Does this happen to be based on some academic research? I don't necessarily expect it to be; just thought I'd ask. Here is m

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-06-30 Thread Robert Haas
On Thu, Jun 30, 2011 at 6:28 PM, Thom Brown wrote: > On 27 June 2011 15:13, Robert Haas wrote: >> I didn't get a lot of comments on my the previous version of my patch >> to accelerate table locks. >> >> http://archives.postgresql.org/pgsql-hackers/2011-06/msg00953.php >> >> Here's a new version

Re: [HACKERS] reducing the overhead of frequent table locks, v4

2011-06-30 Thread Thom Brown
On 27 June 2011 15:13, Robert Haas wrote: > I didn't get a lot of comments on my the previous version of my patch > to accelerate table locks. > > http://archives.postgresql.org/pgsql-hackers/2011-06/msg00953.php > > Here's a new version anyway.  In this version, I have: > > 1. Made pg_locks show