aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/typecmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-06-04 20:35:21 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-06-04 20:35:21 +0000
commit8f2ea8b7b53a02078ba0393e6892ac5356a3631e (patch)
tree536f02e4a6eec0304d76688d65cffbcea9679c9b /src/backend/commands/typecmds.c
parentaf44cac6ef46e225ae963c5e1f9e2e91a0112e04 (diff)
downloadpostgresql-8f2ea8b7b53a02078ba0393e6892ac5356a3631e.tar.gz
postgresql-8f2ea8b7b53a02078ba0393e6892ac5356a3631e.zip
Resurrect heap_deformtuple(), this time implemented as a singly nested
loop over the fields instead of a loop around heap_getattr. This is considerably faster (O(N) instead of O(N^2)) when there are nulls or varlena fields, since those prevent use of attcacheoff. Replace loops over heap_getattr with heap_deformtuple in situations where all or most of the fields have to be fetched, such as printtup and tuptoaster. Profiling done more than a year ago shows that this should be a nice win for situations involving many-column tables.
Diffstat (limited to 'src/backend/commands/typecmds.c')
-rw-r--r--src/backend/commands/typecmds.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c
index d8a2a5b20f5..439ad91cc37 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.57 2004/05/26 04:41:12 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.58 2004/06/04 20:35:21 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -1329,12 +1329,8 @@ AlterDomainNotNull(List *names, bool notNull)
for (i = 0; i < rtc->natts; i++)
{
int attnum = rtc->atts[i];
- Datum d;
- bool isNull;
- d = heap_getattr(tuple, attnum, tupdesc, &isNull);
-
- if (isNull)
+ if (heap_attisnull(tuple, attnum))
ereport(ERROR,
(errcode(ERRCODE_NOT_NULL_VIOLATION),
errmsg("column \"%s\" of table \"%s\" contains null values",