Re: [HACKERS] Avoiding repeated snapshot computation

2012-08-20 Thread Robert Haas
On Thu, Aug 16, 2012 at 9:02 PM, Bruce Momjian br...@momjian.us wrote: Did we ever make a decision on this patch? I committed it as 1fc3d18faa8f4476944bc6854be0f7f6adf4aec8. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers

Re: [HACKERS] Avoiding repeated snapshot computation

2012-08-16 Thread Bruce Momjian
Did we ever make a decision on this patch? --- On Sat, Nov 26, 2011 at 09:22:50PM +0530, Pavan Deolasee wrote: On some recent benchmarks and profile data, I saw GetSnapshotData figures at the very top or near top. For

Re: [HACKERS] Avoiding repeated snapshot computation

2011-12-13 Thread Robert Haas
On Sat, Nov 26, 2011 at 5:49 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 11:39:23 PM Robert Haas wrote: On Sat, Nov 26, 2011 at 5:28 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: I'd just as soon keep the

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-29 Thread Bruce Momjian
Pavan Deolasee wrote: On Sun, Nov 27, 2011 at 12:26 AM, Tom Lane t...@sss.pgh.pa.us wrote: Pavan Deolasee pavan.deola...@gmail.com writes: On Sat, Nov 26, 2011 at 10:43 PM, Robert Haas robertmh...@gmail.com wrote: Furthermore, it's hard to understand how this could be a net improvement

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-29 Thread Andres Freund
On Tuesday, November 29, 2011 05:51:40 AM Pavan Deolasee wrote: On Tue, Nov 29, 2011 at 8:30 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Andres Freund wrote: I would like to see somebody running a benchmark on a machine with higher concurrency... Yeah, me too. I don't

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-29 Thread Andres Freund
Hi, On Monday, November 28, 2011 08:55:28 PM Gurjeet Singh wrote: This may not be necessary, but can you please share the modified config you used for the last run. I just copied the .conf I had for some independent development. max_connections = 100 listen_addresses = '' port=5432

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-29 Thread Ants Aasma
On Tue, Nov 29, 2011 at 7:12 AM, Pavan Deolasee pavan.deola...@gmail.com wrote: I think that a good idea. We need a representation that needs minimum processing to derive the snapshot. I was looking over the generated code for GetSnapshotData to see if there is any low hanging fruit for

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-28 Thread Gurjeet Singh
On Sat, Nov 26, 2011 at 6:51 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 11:39:23 PM Robert Haas wrote: On Sat, Nov 26, 2011 at 5:28 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: I'd just as soon

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-28 Thread Andres Freund
Hi Gurjeet, On Monday, November 28, 2011 08:55:28 PM Gurjeet Singh wrote: On Sat, Nov 26, 2011 at 6:51 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 11:39:23 PM Robert Haas wrote: On Sat, Nov 26, 2011 at 5:28 PM, Andres Freund and...@anarazel.de wrote:

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-28 Thread Kevin Grittner
Andres Freund wrote: I would like to see somebody running a benchmark on a machine with higher concurrency... Yeah, me too. I don't find it at all hard to believe that we will see significant performance benefit by changing the PGPROC structure so that all parts of it can be accessed

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-28 Thread Pavan Deolasee
On Tue, Nov 29, 2011 at 8:30 AM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Andres Freund  wrote: I would like to see somebody running a benchmark on a machine with higher concurrency... Yeah, me too.  I don't find it at all hard to believe that we will see significant performance

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-28 Thread Pavan Deolasee
On Sun, Nov 27, 2011 at 12:26 AM, Tom Lane t...@sss.pgh.pa.us wrote: Pavan Deolasee pavan.deola...@gmail.com writes: On Sat, Nov 26, 2011 at 10:43 PM, Robert Haas robertmh...@gmail.com wrote: Furthermore, it's hard to understand how this could be a net improvement in the general case, because

[HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Pavan Deolasee
On some recent benchmarks and profile data, I saw GetSnapshotData figures at the very top or near top. For lesser number of clients, it can account for 10-20% of time, but more number of clients I have seen it taking up as much as 40% of sample time. Unfortunately, the machine of which I was

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Robert Haas
On Sat, Nov 26, 2011 at 10:52 AM, Pavan Deolasee pavan.deola...@gmail.com wrote: What we can do is when a transaction comes to compute its snapshot, it checks if some other transaction is already computing a snapshot for itself. If so, it just sleeps on the lock. When the other process

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Pavan Deolasee
On Sat, Nov 26, 2011 at 10:43 PM, Robert Haas robertmh...@gmail.com wrote: On Sat, Nov 26, 2011 at 10:52 AM, Pavan Deolasee pavan.deola...@gmail.com wrote: What we can do is when a transaction comes to compute its snapshot, it checks if some other transaction is already computing a snapshot

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Tom Lane
Pavan Deolasee pavan.deola...@gmail.com writes: On Sat, Nov 26, 2011 at 10:43 PM, Robert Haas robertmh...@gmail.com wrote: Furthermore, it's hard to understand how this could be a net improvement in the general case, because now both B and F are copying everything twice (once to the shared

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Andres Freund
Hi, On Saturday, November 26, 2011 04:52:50 PM Pavan Deolasee wrote: I think now that we have reduced the run time of the function itself, we should now try to reduce the number of times the function is called. Robert proposed a way to reduce the number of calls per transaction. I think we

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Tom Lane
Andres Freund and...@anarazel.de writes: You could also try if it makes a difference reducing SnapshotData to one instead of two cachelines. The data itself fits into one without problems. Trivial patch attached. On what grounds do you argue that this patch gets SnapshotData into one

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Andres Freund
On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: Andres Freund and...@anarazel.de writes: You could also try if it makes a difference reducing SnapshotData to one instead of two cachelines. The data itself fits into one without problems. Trivial patch attached. On what grounds do

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Andres Freund
On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: I'd just as soon keep the fields in a logical order. Btw, I don't think the new order is necessarily worse than the old one. Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Robert Haas
On Sat, Nov 26, 2011 at 5:28 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: I'd just as soon keep the fields in a logical order. Btw, I don't think the new order is necessarily worse than the old one. You forget to attach the benchmark

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Andres Freund
On Saturday, November 26, 2011 11:39:23 PM Robert Haas wrote: On Sat, Nov 26, 2011 at 5:28 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: I'd just as soon keep the fields in a logical order. Btw, I don't think the new order is

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Andres Freund
On Saturday, November 26, 2011 11:39:23 PM Robert Haas wrote: On Sat, Nov 26, 2011 at 5:28 PM, Andres Freund and...@anarazel.de wrote: On Saturday, November 26, 2011 09:52:17 PM Tom Lane wrote: I'd just as soon keep the fields in a logical order. Btw, I don't think the new order is

Re: [HACKERS] Avoiding repeated snapshot computation

2011-11-26 Thread Kevin Grittner
Andres Freund wrote: All current x86 cpus use 64bytes. That matches what I found in recent research on the topic. -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers