> [!TwophaseFileRead] > <table><tr><td rowspan="4" width="25%"><img src="assets/wl_io_twophasefileread.png"></td><td><b>Wait Category</b></td><td>IO</td></tr><tr><td><b>Mechanism</b></td><td><code>pg_twophase</code></td></tr><tr><td><b>Operations</b></td><td><a href="Operations/Table/SeqScan">SeqScan</a></td></tr><tr><td><b>Resources</b></td><td><a href="Resources/disk IO">disk IO</a>, <a href="Resources/CPU">CPU</a></td></tr><tr><td colspan="3"><b>Distributed Transaction Recovery stall</b>. When a transaction is "prepared" (using <code>PREPARE TRANSACTION</code>), its entire state—locks, modified tuples, and internal metadata—is serialized to a file on disk so that it can survive a crash and be finalized later by a different session.</td></tr></table>