CREATE vs MERGE

CREATE always inserts. MERGE upserts. The wrong choice = silent duplicates.

0/3 done

The single most expensive mistake

CREATE vs MERGE

  • CREATE always inserts new nodes / relationships. Two runs = two copies.
  • MERGE runs MATCH-or-CREATE in a single atomic operation. Two runs = one copy.

MERGE supports two side blocks:

  • ON CREATE SET — only when this is the first time we see it.
  • ON MATCH SET — only when it already existed.

Rule of thumb: any seeding / loading / sync code should use MERGE. CREATE is for one-shot facts you know don't exist yet (e.g. an audit log entry).

Reading in progress · 0 of 3 activities done