Re: [HACKERS] MultiXact pessmization in 9.3

2013-11-27 Thread Tom Lane
Andres Freund writes: > On 2013-11-27 19:24:35 -0300, Alvaro Herrera wrote: >> The other idea is to just not backpatch this. > I think backpatching is a good idea, I have seen GetMultiXactIdMembers() > + slru code take up 80% cpu in strange workloads. But it possibly might > be a good idea to wai

Re: [HACKERS] MultiXact pessmization in 9.3

2013-11-27 Thread Andres Freund
On 2013-11-27 19:24:35 -0300, Alvaro Herrera wrote: > One other thought is that MultiXactIdIsRunning and GetMultiXactIdMembers > are public functions, so this patch would represent an API change in > 9.3. I doubt any external modules would be relying on these functions, > but there's so many care

Re: [HACKERS] MultiXact pessmization in 9.3

2013-11-27 Thread Alvaro Herrera
Alvaro Herrera wrote: > Correct. The only difficulty here is that we would need to pass down > the fact that we know for certain that this is only a locking Multixact. > There are some callers that go to it indirectly via MultiXactIdWait or > MultiXactIdExpand, but now that I look I think it's fi

Re: [HACKERS] MultiXact pessmization in 9.3

2013-11-22 Thread Alvaro Herrera
Andres Freund wrote: > On 2013-11-22 12:04:31 -0300, Alvaro Herrera wrote: > Yes, somewhat: <9.3 GetMultiXactIdMembers() didn't do any work if the > multixact was old enough: > if (MultiXactIdPrecedes(multi, OldestVisibleMXactId[MyBackendId])) > { > debug_elog2(DEBUG2, "G

Re: [HACKERS] MultiXact pessmization in 9.3

2013-11-22 Thread Andres Freund
On 2013-11-22 12:04:31 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > > While looking at the multixact truncation code (mail nearby), I've > > noticed that there's a significant difference in the way multixact > > members are accessed since fkey locks were introduced: > > > > <9.3 when h

Re: [HACKERS] MultiXact pessmization in 9.3

2013-11-22 Thread Alvaro Herrera
Andres Freund wrote: > While looking at the multixact truncation code (mail nearby), I've > noticed that there's a significant difference in the way multixact > members are accessed since fkey locks were introduced: > > <9.3 when heap_lock_tuple finds a XMAX_IS_MULTI tuple it executes > MultiXact

[HACKERS] MultiXact pessmization in 9.3

2013-11-21 Thread Andres Freund
Hi, While looking at the multixact truncation code (mail nearby), I've noticed that there's a significant difference in the way multixact members are accessed since fkey locks were introduced: <9.3 when heap_lock_tuple finds a XMAX_IS_MULTI tuple it executes MultiXactIdWait() which in turn uses G