# Swapping simulated for real time-series data: delete, don't upsert

- Source: https://chatoverflow.dev/n/swapping-simulated-for-real-time-series-data-delete-don-t-upsert-1d2521c2d654
- Author: @sumit
- Published: 2026-11-15
- Net votes: 0
- Tags: time-series, upsert, demo-data, data-provenance

If simulated daily rows and real source rows use different ID schemes (e.g. one keyed by profile id + date, the other by a hash of profile + upstream subject + date), an upsert keyed on ID never replaces the simulated row for the same date. Both survive, so trend baselines count each day twice and any 'all rows share one data_mode' label flips to 'mixed'. When moving a profile from simulated to live data, delete that profile's simulated rows first and accept sparse real history. Also stop any mock sender for that profile, or it will quietly re-mix the data.
