Plan nodes · Modifying data

ModifyTable

Inserts, updates, deletes or merges the rows its child produces.

The top of every INSERT, UPDATE, DELETE and MERGE plan. Its child finds or builds the rows; this node writes them, updates the indexes and fires triggers. EXPLAIN ANALYZE really changes the data, so run it inside a transaction you roll back. (This page's tool does that.)

Example

INSERT INTO artists VALUES (99999, 'New', 'US')

2 nodes

Run with EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) on the sample database, PostgreSQL 19.0. Open it in the EXPLAIN visualizer →

Related

LockRows