aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeGroup.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-01-24 05:40:49 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-01-24 05:40:49 +0000
commitd03e98737c5aec12332bbbaf12abe2e2642048c4 (patch)
tree21f1014417e0ffa0fed7d560615a584e18ebffa9 /src/backend/executor/nodeGroup.c
parent77f54282441584f539186d1e9054544f89e0e9b4 (diff)
downloadpostgresql-d03e98737c5aec12332bbbaf12abe2e2642048c4.tar.gz
postgresql-d03e98737c5aec12332bbbaf12abe2e2642048c4.zip
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.
Diffstat (limited to 'src/backend/executor/nodeGroup.c')
-rw-r--r--src/backend/executor/nodeGroup.c14
1 files changed, 7 insertions, 7 deletions
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);
/*