26
26
*
27
27
*
28
28
* IDENTIFICATION
29
- * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.252 2005/08/01 20:31:07 tgl Exp $
29
+ * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.253 2005/08/18 21:34:20 tgl Exp $
30
30
*
31
31
*-------------------------------------------------------------------------
32
32
*/
@@ -1371,7 +1371,6 @@ ExecInsert(TupleTableSlot *slot,
1371
1371
HeapTuple tuple ;
1372
1372
ResultRelInfo * resultRelInfo ;
1373
1373
Relation resultRelationDesc ;
1374
- int numIndices ;
1375
1374
Oid newId ;
1376
1375
1377
1376
/*
@@ -1418,6 +1417,9 @@ ExecInsert(TupleTableSlot *slot,
1418
1417
1419
1418
/*
1420
1419
* insert the tuple
1420
+ *
1421
+ * Note: heap_insert returns the tid (location) of the new tuple
1422
+ * in the t_self field.
1421
1423
*/
1422
1424
newId = heap_insert (resultRelationDesc , tuple ,
1423
1425
estate -> es_snapshot -> curcid ,
@@ -1429,14 +1431,9 @@ ExecInsert(TupleTableSlot *slot,
1429
1431
setLastTid (& (tuple -> t_self ));
1430
1432
1431
1433
/*
1432
- * process indices
1433
- *
1434
- * Note: heap_insert adds a new tuple to a relation. As a side effect,
1435
- * the tupleid of the new tuple is placed in the new tuple's t_ctid
1436
- * field.
1434
+ * insert index entries for tuple
1437
1435
*/
1438
- numIndices = resultRelInfo -> ri_NumIndices ;
1439
- if (numIndices > 0 )
1436
+ if (resultRelInfo -> ri_NumIndices > 0 )
1440
1437
ExecInsertIndexTuples (slot , & (tuple -> t_self ), estate , false);
1441
1438
1442
1439
/* AFTER ROW INSERT Triggers */
@@ -1563,7 +1560,6 @@ ExecUpdate(TupleTableSlot *slot,
1563
1560
Relation resultRelationDesc ;
1564
1561
ItemPointerData ctid ;
1565
1562
HTSU_Result result ;
1566
- int numIndices ;
1567
1563
1568
1564
/*
1569
1565
* abort the operation if not running transactions
@@ -1676,23 +1672,18 @@ lreplace:;
1676
1672
/*
1677
1673
* Note: instead of having to update the old index tuples associated
1678
1674
* with the heap tuple, all we do is form and insert new index tuples.
1679
- * This is because UPDATEs are actually DELETEs and INSERTs and index
1675
+ * This is because UPDATEs are actually DELETEs and INSERTs, and index
1680
1676
* tuple deletion is done automagically by the vacuum daemon. All we
1681
1677
* do is insert new index tuples. -cim 9/27/89
1682
1678
*/
1683
1679
1684
1680
/*
1685
- * process indices
1681
+ * insert index entries for tuple
1686
1682
*
1687
- * heap_update updates a tuple in the base relation by invalidating it
1688
- * and then inserting a new tuple to the relation. As a side effect,
1689
- * the tupleid of the new tuple is placed in the new tuple's t_ctid
1690
- * field. So we now insert index tuples using the new tupleid stored
1691
- * there.
1683
+ * Note: heap_update returns the tid (location) of the new tuple
1684
+ * in the t_self field.
1692
1685
*/
1693
-
1694
- numIndices = resultRelInfo -> ri_NumIndices ;
1695
- if (numIndices > 0 )
1686
+ if (resultRelInfo -> ri_NumIndices > 0 )
1696
1687
ExecInsertIndexTuples (slot , & (tuple -> t_self ), estate , false);
1697
1688
1698
1689
/* AFTER ROW UPDATE Triggers */
0 commit comments