1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Inline fastgetattr and others so data access does not use function

calls.
This commit is contained in:
Bruce Momjian
1998-01-31 04:39:26 +00:00
parent 2df6bba3ca
commit 726c3854cb
35 changed files with 350 additions and 215 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.9 1997/09/12 04:07:33 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.10 1998/01/31 04:38:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -315,7 +315,7 @@ ExecGetJunkAttribute(JunkFilter *junkfilter,
tuple = slot->val;
tupType = (TupleDesc) junkfilter->jf_tupType;
*value = heap_getattr(tuple, InvalidBuffer, resno, tupType, isNull);
*value = heap_getattr(tuple, resno, tupType, isNull);
return true;
}
@ -391,7 +391,7 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
for (i = 0; i < cleanLength; i++)
{
values[i] =
heap_getattr(tuple, InvalidBuffer, cleanMap[i], tupType, &isNull);
heap_getattr(tuple, cleanMap[i], tupType, &isNull);
if (isNull)
nulls[i] = 'n';

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.23 1998/01/15 19:44:24 pgsql Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.24 1998/01/31 04:38:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -301,7 +301,6 @@ ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
}
result = heap_getattr(heapTuple, /* tuple containing attribute */
buffer, /* buffer associated with tuple */
attnum, /* attribute number of desired attribute */
tuple_type,/* tuple descriptor of tuple */
isNull); /* return: is attribute null? */
@ -525,7 +524,6 @@ GetAttributeByNum(TupleTableSlot *slot,
}
retval = heap_getattr(slot->val,
slot->ttc_buffer,
attrno,
slot->ttc_tupleDescriptor,
isNull);
@ -587,7 +585,6 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
elog(ERROR, "GetAttributeByName: attribute %s not found", attname);
retval = heap_getattr(slot->val,
slot->ttc_buffer,
attrno,
tupdesc,
isNull);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.14 1997/12/11 17:36:16 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.15 1998/01/31 04:38:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -82,7 +82,7 @@ ProjectAttribute(TupleDesc TD,
AttrNumber attrno = attrVar->varattno;
val = heap_getattr(tup, InvalidBuffer, attrno, TD, isnullP);
val = heap_getattr(tup, attrno, TD, isnullP);
if (*isnullP)
return (Datum) NULL;

View File

@ -663,7 +663,6 @@ aggGetAttr(TupleTableSlot *slot,
result =
heap_getattr(heapTuple, /* tuple containing attribute */
buffer, /* buffer associated with tuple */
attnum, /* attribute number of desired attribute */
tuple_type,/* tuple descriptor of tuple */
isNull); /* return: is attribute null? */

View File

@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.13 1998/01/27 15:41:32 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.14 1998/01/31 04:38:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -402,13 +402,11 @@ sameGroup(TupleTableSlot *oldslot,
typoutput = typtoout((Oid) tupdesc->attrs[att - 1]->atttypid);
attr1 = heap_getattr(oldslot->val,
InvalidBuffer,
att,
tupdesc,
&isNull1);
attr2 = heap_getattr(newslot->val,
InvalidBuffer,
att,
tupdesc,
&isNull2);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.11 1997/09/12 04:07:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.12 1998/01/31 04:38:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -187,9 +187,9 @@ ExecUnique(Unique *node)
char *val1,
*val2;
attr1 = heap_getattr(slot->val, InvalidBuffer,
attr1 = heap_getattr(slot->val,
uniqueAttrNum, tupDesc, &isNull1);
attr2 = heap_getattr(resultTupleSlot->val, InvalidBuffer,
attr2 = heap_getattr(resultTupleSlot->val,
uniqueAttrNum, tupDesc, &isNull2);
if (isNull1 == isNull2)

View File

@ -341,7 +341,7 @@ SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, int *attnum,
/* fetch old values and nulls */
for (i = 0; i < numberOfAttributes; i++)
{
v[i] = heap_getattr(tuple, InvalidBuffer, i + 1, rel->rd_att, &isnull);
v[i] = heap_getattr(tuple, i + 1, rel->rd_att, &isnull);
n[i] = (isnull) ? 'n' : ' ';
}
@ -420,7 +420,7 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
return (NULL);
}
val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, &isnull);
val = heap_getattr(tuple, fnumber, tupdesc, &isnull);
if (isnull)
return (NULL);
foutoid = typtoout((Oid) tupdesc->attrs[fnumber - 1]->atttypid);
@ -446,7 +446,7 @@ SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
return ((Datum) NULL);
}
val = heap_getattr(tuple, InvalidBuffer, fnumber, tupdesc, isnull);
val = heap_getattr(tuple, fnumber, tupdesc, isnull);
return (val);
}