← Graph

Why table swap instead of deletion?

question 2 connections

Audience asked why Apply4 creates an empty copy of a table, inserts only the in-region rows, and renames, rather than just deleting the out-of-region rows in place to avoid the rename/constraints/integrations complexity. Answer: both approaches require ending up with two tables, and the team's tests showed that inserting into an empty clone is significantly faster than deleting rows — a tip 'from the bottom of our hearts' proven in practice.

answer_summary
Both approaches require the same end state, but in Apply4's tests inserting the correct rows into an empty clone was significantly faster than deleting unwanted rows.
question Why table swap instead of deletion?
about
Directly about the empty-copy + rename technique used by Apply4.
question Why table swap instead of deletion?
asked_at
Second Q&A question asking why Apply4 renames tables instead of deleting unwanted rows in place.

Provenance