Re: AllocSetReset improvement

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "a_ogawa" <a_ogawa(at)hi-ho(dot)ne(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: AllocSetReset improvement
Date: 2005-06-04 20:14:57
Message-ID: 200506042014.j54KEvu27775@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Patch applied. Thanks. (The first if == NULL test was already in CVS).

---------------------------------------------------------------------------

a_ogawa wrote:
>
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> > a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp> writes:
> > > It is a reasonable idea. However, the majority part of MemSet was not
> > > able to be avoided by this idea. Because the per-tuple contexts are used
> > > at the early stage of executor.
> >
> > Drat. Well, what about changing that? We could introduce additional
> > contexts or change the startup behavior so that the ones that are
> > frequently reset don't have any data in them unless you are working
> > with pass-by-ref values inside the inner loop.
>
> That might be possible. However, I think that we should change only
> aset.c about this article.
> I thought further: We can check whether context was used from the last
> reset even when blocks list is not empty. Please see attached patch.
>
> The effect of the patch that I measured is as follows:
>
> o Execution time that executed the SQL ten times.
> (1)Linux(CPU: Pentium III, Compiler option: -O2)
> - original: 24.960s
> - patched : 23.114s
>
> (2)Linux(CPU: Pentium 4, Compiler option: -O2)
> - original: 8.730s
> - patched : 7.962s
>
> (3)Solaris(CPU: Ultra SPARC III, Compiler option: -O2)
> - original: 37.0s
> - patched : 33.7s
>
> regards,
>
> ---
> Atsushi Ogawa

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-06-04 20:33:19 Re: return_next for plperl (was Re: call for help)
Previous Message Magnus Hagander 2005-06-04 19:53:09 Re: Simplify Win32 Signaling code