The INSERT, DELETE, and UPDATE statement interface

The following figure shows the order in which the database server executes purpose functions to insert, delete, or update a row at a specific physical address. The physical address consists of fragment identifier and row identifier.
Figure 1: INSERT, DELETE, or UPDATE by row address

The flowchart shows am_open fragment pointing to a box, which contains an am_insert row, am_delete row, or am_update row and points to an am_close fragment.
The following figure shows the order in which the database server executes purpose functions if the insert, delete, or in-place update has an associated WHERE clause.
Figure 2: INSERT, DELETE, or UPDATE in a subquery

Flowchart shows am_scancost pointing to am_open, which points to am_beginscan, which points to am_getnext. If the am_getnext returns MI_ROWS, the scan executes am_delete or am_update, and then executes am_getnext again. If am_getnext returns MI_NO_MORE_RESULTS, the scan continues to am_endscan.
The following figure shows the more complicated case in which am_getnext returns multiple rows to the database server. In either case, the database server calls am_insert, am_delete, or am_update once per row.
Figure 3: Returning multiple rows that qualify for INSERT, DELETE, or UPDATE

This figure is described in the surrounding text.