From d03e98737c5aec12332bbbaf12abe2e2642048c4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 24 Jan 1999 05:40:49 +0000 Subject: Replace typtoout() and gettypelem() with a single routine, so that fetching an attribute value needs only one SearchSysCacheTuple call instead of two redundant searches. This speeds up a large SELECT by about ten percent, and probably will help GROUP BY and SELECT DISTINCT too. --- src/backend/executor/nodeGroup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/backend/executor/nodeGroup.c') diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c index 54cf97ca3e1..0f86f73a2b1 100644 --- a/src/backend/executor/nodeGroup.c +++ b/src/backend/executor/nodeGroup.c @@ -13,7 +13,7 @@ * columns. (ie. tuples from the same group are consecutive) * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.23 1998/11/27 19:52:01 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.24 1999/01/24 05:40:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -364,12 +364,14 @@ sameGroup(HeapTuple oldtuple, *val2; int i; AttrNumber att; - Oid typoutput; + Oid typoutput, + typelem; for (i = 0; i < numCols; i++) { att = grpColIdx[i]; - typoutput = typtoout((Oid) tupdesc->attrs[att - 1]->atttypid); + getTypeOutAndElem((Oid) tupdesc->attrs[att - 1]->atttypid, + &typoutput, &typelem); attr1 = heap_getattr(oldtuple, att, @@ -386,11 +388,9 @@ sameGroup(HeapTuple oldtuple, if (isNull1) /* both are null, they are equal */ continue; - val1 = fmgr(typoutput, attr1, - gettypelem(tupdesc->attrs[att - 1]->atttypid), + val1 = fmgr(typoutput, attr1, typelem, tupdesc->attrs[att - 1]->atttypmod); - val2 = fmgr(typoutput, attr2, - gettypelem(tupdesc->attrs[att - 1]->atttypid), + val2 = fmgr(typoutput, attr2, typelem, tupdesc->attrs[att - 1]->atttypmod); /* -- cgit v1.2.3