Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-21 Thread Tomas Vondra
On Fri, Dec 20, 2019 at 05:57:55PM +, Simon Riggs wrote: On Fri, 20 Dec 2019 at 17:46, Tom Lane wrote: Simon Riggs writes: > On Fri, 20 Dec 2019 at 13:07, Robert Haas wrote: >> With regard to this point, I second Tomas's comments. > I also agree with Tomas' comments. I am explaining *wh

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-20 Thread Simon Riggs
On Fri, 20 Dec 2019 at 17:46, Tom Lane wrote: > Simon Riggs writes: > > On Fri, 20 Dec 2019 at 13:07, Robert Haas wrote: > >> With regard to this point, I second Tomas's comments. > > > I also agree with Tomas' comments. I am explaining *why* it will be an > > improvement, expanding on my earli

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-20 Thread Tom Lane
Simon Riggs writes: > On Fri, 20 Dec 2019 at 13:07, Robert Haas wrote: >> With regard to this point, I second Tomas's comments. > I also agree with Tomas' comments. I am explaining *why* it will be an > improvement, expanding on my earlier notes. > This function is called extremely frequently in

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-20 Thread Simon Riggs
On Fri, 20 Dec 2019 at 13:07, Robert Haas wrote: > > > Read only transactions should have a fast path thru this function since > they frequently read more data than write transactions. > > With regard to this point, I second Tomas's comments. > I also agree with Tomas' comments. I am explaining

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-20 Thread Robert Haas
On Fri, Dec 20, 2019 at 12:46 AM Simon Riggs wrote: > If the TopTransactionId is not assigned, we can leave the whole function more > quickly, not just avoid a test. Those things are not really any different from each other. You leave the function when you've done all the necessary tests >

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-19 Thread Simon Riggs
On Thu, 19 Dec 2019 at 19:27, Robert Haas wrote: > On Wed, Dec 18, 2019 at 5:07 AM Simon Riggs wrote: > > TransactionIdIsCurrentTransactionId() doesn't seem to be well optimized > for the case when an xid has not yet been assigned, so for read only > transactions. > > > > A patch for this is att

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-19 Thread Tomas Vondra
On Thu, Dec 19, 2019 at 02:27:01PM -0500, Robert Haas wrote: On Wed, Dec 18, 2019 at 5:07 AM Simon Riggs wrote: TransactionIdIsCurrentTransactionId() doesn't seem to be well optimized for the case when an xid has not yet been assigned, so for read only transactions. A patch for this is attach

Re: Optimizing TransactionIdIsCurrentTransactionId()

2019-12-19 Thread Robert Haas
On Wed, Dec 18, 2019 at 5:07 AM Simon Riggs wrote: > TransactionIdIsCurrentTransactionId() doesn't seem to be well optimized for > the case when an xid has not yet been assigned, so for read only transactions. > > A patch for this is attached. It might be an idea to first call TransactionIdIsNor

Optimizing TransactionIdIsCurrentTransactionId()

2019-12-18 Thread Simon Riggs
TransactionIdIsCurrentTransactionId() doesn't seem to be well optimized for the case when an xid has not yet been assigned, so for read only transactions. A patch for this is attached. -- Simon Riggshttp://www.2ndQuadrant.com/ PostgreSQL Solutions fo