Skip site navigation (1) Skip section navigation (2)

Re: AllocSetReset improvement

From: a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: AllocSetReset improvement
Date: 2005-05-16 12:58:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
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


Atsushi Ogawa

Attachment: aset.c.patch
Description: application/octet-stream (802 bytes)

In response to


pgsql-patches by date

Next:From: Neil ConwayDate: 2005-05-16 14:19:16
Subject: Re: updated GiST patch
Previous:From: Karel ZakDate: 2005-05-16 07:03:37
Subject: Re: AllocSetReset improvement

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group