Re: Avoiding repeated snapshot computation

From: Andres Freund <andres(at)anarazel(dot)de>
To: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Subject: Re: Avoiding repeated snapshot computation
Date: 2011-11-29 01:41:32
Message-ID: 201111290241.32799.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 <andres(at)anarazel(dot)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 <andres(at)anarazel(dot)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 results.
> > >
> > > My impression is that cache lines on modern hardware are 64 or 128
> > > *bytes*, in which case this wouldn't matter a bit.
> > >
> > > But testing is even better than guessing.
> >
> > Being prodded like that I ran a very quick benchmark on my workstation.
> > Unfortunately that means I cannot work during the time which is why I
> > kept it
> > rather short...
> >
> > That machine has 2 E5520(at)2(dot)27GHz which means 2(sockets) * 4(cores) *
> > 2(threads) and 24GB of ram.
> >
> > Data was initialized with: pgbench -h /tmp/ --unlogged-tables -i -s 20
> > pgbench
> >
> >
> > pgbench -h /tmp/ pgbench -S -j 16 -c 16 -T 60
> > ...
> > Looks like a win to me. Even on this comparatively small machine.
> This may not be necessary, but can you please share the modified config you
> used for the last run.
Can't right now because I don't have access from here, but I will do so. I
don't think its particularly interesting though.

> I tabulated your last results to make it more readable, and added columns
> to show the improvement.
>
> origsnap reordersnap diff %age improvement
> ------------------------------------------------------------------
> 102234.66402 103444.877879 1210.213859 1.1837607827
> 102003.449741 103385.888808 1382.439067 1.3552865815
> 102119.509053 103302.318923 1182.80987 1.1582604352
> 101722.410387 103372.659486 1650.249099 1.6223063263
> 101973.651318 103330.157612 1356.506294 1.3302517626
> 102056.440561 103313.833821 1257.39326 1.2320567454
>
> That looks like a win to me too. We're getting a little over 1% improvement
> for free!
At least if we can convince Tom that such a change would be ok ;)

I would like to see somebody running a benchmark on a machine with higher
concurrency...

> Maybe submitting this patch to the commitfest might help get some serious
> consideration from a reviewer.
It wasn't actually ment as an actual patch but a comment, but well ;). Will
add it.

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-11-29 01:45:50 Re: CommitFest 2011-11 Post-Tryptophan Progress Report
Previous Message Tom Lane 2011-11-29 01:40:01 Re: strange nbtree corruption report