diff options
| author | Tom Lane | 1999-01-24 05:40:49 +0000 |
|---|---|---|
| committer | Tom Lane | 1999-01-24 05:40:49 +0000 |
| commit | d03e98737c5aec12332bbbaf12abe2e2642048c4 (patch) | |
| tree | 21f1014417e0ffa0fed7d560615a584e18ebffa9 /src/backend/libpq | |
| parent | 77f54282441584f539186d1e9054544f89e0e9b4 (diff) | |
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/libpq')
| -rw-r--r-- | src/backend/libpq/be-dumpdata.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/libpq/be-dumpdata.c b/src/backend/libpq/be-dumpdata.c index 116fb0c80bf..70d01e4dcf8 100644 --- a/src/backend/libpq/be-dumpdata.c +++ b/src/backend/libpq/be-dumpdata.c @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: be-dumpdata.c,v 1.19 1998/12/14 06:50:23 scrappy Exp $ + * $Id: be-dumpdata.c,v 1.20 1999/01/24 05:40:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -213,7 +213,8 @@ be_printtup(HeapTuple tuple, TupleDesc typeinfo) int i; Datum attr; bool isnull; - Oid typoutput; + Oid typoutput, + typelem; PortalEntry *entry = NULL; PortalBuffer *portal = NULL; @@ -298,7 +299,8 @@ be_printtup(HeapTuple tuple, TupleDesc typeinfo) for (i = 0; i < tuple->t_data->t_natts; i++) { attr = heap_getattr(tuple, i + 1, typeinfo, &isnull); - typoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid); + getTypeOutAndElem((Oid) typeinfo->attrs[i]->atttypid, + &typoutput, &typelem); lengths[i] = typeinfo->attrs[i]->attlen; @@ -311,11 +313,8 @@ be_printtup(HeapTuple tuple, TupleDesc typeinfo) } if (!isnull && OidIsValid(typoutput)) - { - values[i] = fmgr(typoutput, attr, - gettypelem(typeinfo->attrs[i]->atttypid), + values[i] = fmgr(typoutput, attr, typelem, typeinfo->attrs[i]->atttypmod); - } else values[i] = NULL; |
