# Tuple Operations ![[assets/arch_tuple_suitcase.png|256]] **Tuple Operations** represent the final actions taken on a single row of data. While Scans find the data, Tuple operations determine its ultimate fate within a transaction. ### The Architectural Role These operations are often the "Root" of a write query or the final step of a filtered read. They are responsible for: 1. **DML Execution**: Actually performing `INSERT`, `UPDATE`, or `DELETE` operations on the heap. 2. **Locking**: Acquiring row-level locks (e.g., `FOR UPDATE`) to ensure transaction isolation. 3. **Constraint Enforcement**: Validating that the row doesn't violate unique or foreign key constraints before finalizing the change. ### In the Explain Plan These nodes typically sit at the very top of the plan for write operations, or appear as "Locking" wrappers for specific rows. ```text Update on animals (cost=1.00..9.29 rows=1 width=18) -> Index Scan using animals_pkey on animals (...) ``` --- ![[Operations/Tuple/LockRows]] --- ![[Operations/Tuple/ModifyTable]] --- ![[Operations/Tuple/Result]] --- ![[Operations/Tuple/SampleScan]] --- ![[Operations/Tuple/TidScan]]