diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-10-04 17:19:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-10-04 17:19:55 +0000 |
commit | 3b8ba163d0511a238971c165ffeeb9abdeaceb7c (patch) | |
tree | a31dd62f5407aa470144c0466508cb80a1563646 /src/backend/executor | |
parent | 53c5edace83616d34e5025841c22b2106aa1aaf0 (diff) | |
download | postgresql-3b8ba163d0511a238971c165ffeeb9abdeaceb7c.tar.gz postgresql-3b8ba163d0511a238971c165ffeeb9abdeaceb7c.zip |
Tweak a few of the most heavily used function call points to zero out
just the significant fields of FunctionCallInfoData, rather than MemSet'ing
the whole struct to zero. Unused positions in the arg[] array will
thereby contain garbage rather than zeroes. This buys back some of the
performance hit from increasing FUNC_MAX_ARGS. Also tweak tuplesort.c
code for more speed by marking some routines 'inline'. All together
these changes speed up simple sorts, like count(distinct int4column),
by about 25% on a P4 running RH Linux 7.2.
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/nodeAgg.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 0ebf2f7151e..36ded53df0c 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -46,7 +46,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.88 2002/09/28 20:00:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.89 2002/10/04 17:19:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -275,8 +275,18 @@ advance_transition_function(AggStatePerAgg peraggstate, } } - /* OK to call the transition function */ - MemSet(&fcinfo, 0, sizeof(fcinfo)); + /* + * OK to call the transition function + * + * This is heavily-used code, so manually zero just the necessary fields + * instead of using MemSet(). Compare FunctionCall2(). + */ + + /* MemSet(&fcinfo, 0, sizeof(fcinfo)); */ + fcinfo.context = NULL; + fcinfo.resultinfo = NULL; + fcinfo.isnull = false; + fcinfo.flinfo = &peraggstate->transfn; fcinfo.nargs = 2; fcinfo.arg[0] = peraggstate->transValue; |