Empties a table and refills it, inside one transaction.
The strategy that works everywhere. Every driver Drupal supports can truncate and insert, and a
transaction makes the whole replacement atomic from a reader's point of view - on SQLite, MySQL with
InnoDB and PostgreSQL alike.
What it costs. The table is empty to any reader inside the transaction's window, so this is a
maintenance-mode operation on a live site. That is stated rather than worked around, because the
alternative is a strategy that silently serves an empty table to real traffic.
TRUNCATE is deliberately not used. On MySQL it is DDL and commits implicitly, which would
break the transaction wrapping the refill and leave a truncated table if the insert then failed.
A DELETE with no condition is transactional on every driver, which matters more here than the
speed difference on a table Strata is restoring row by row anyway.
A multi-row insert is far faster than one per row, and an unbounded one exceeds placeholder
limits: MySQL allows 65,535 placeholders per statement, so a twenty-column table caps out
around 3,200 rows.