After retro-fitting a missed Type 2 dimension version, which existing fact rows must be repointed?
answer
- only one window changed hands
- which key did those facts carry before?
- one set-based update, not a reload
- aggregates over that period are stale now
- someone already signed off on that month
basics
~10 sOnly facts whose event date falls inside the newly inserted version's window and that still carry the surrogate key of the version that was shortened. Repoint exactly those; facts outside the window are untouched.
solid answer
~40 sThe splice carves a window out of an existing version, so the blast radius is precisely defined: same business key, event date inside the carved window, currently pointing at the shortened version's surrogate key. Repoint those rows in one set-based update rather than reprocessing the fact table. Then handle what the update implies — anything derived from those facts for that period (aggregate tables, extracts already delivered, cached dashboards) is now stale and must be rebuilt or recalled. The harder half is not technical: numbers for a period someone has already signed off on are about to move. Restating silently is what destroys trust; the choice is between restating with an explicit notice and an audit record of what changed, or freezing closed periods and booking the correction forward as an adjustment.
code
sql · 5 lines-- Repoint only the facts inside the newly carved window
UPDATE fct_orders
SET customer_sk = 9611 -- the spliced-in version
WHERE customer_sk = 9041 -- the version that was shortened
AND order_date BETWEEN DATE '2024-02-10' AND DATE '2024-03-31';go deeper
Understand that a fact's dimension foreign key points at one specific version, so inserting a new version can leave older facts pointing at the wrong one.
Be able to state the three conditions that bound which facts move — same business key, event date inside the carved window, still on the shortened version's key — and write it as one set-based update.
Show that you think past the update: stale aggregates, already-delivered extracts, cached dashboards, and a verification query proving no fact sits outside its assigned version's window.
Own the restatement policy — whether closed periods are frozen or restated, what disclosure accompanies a change to published numbers, and how that rule stays consistent across subject areas.
## Bounding the blast radius When a missed Type 2 version is spliced into a chain, exactly one window changes hands. Version 9041 covered 1900-01-01 to 2024-03-31; after the splice it covers 1900-01-01 to 2024-02-09, and the new version 9611 covers 2024-02-10 to 2024-03-31. Fact rows are affected if and only if all three of these hold: - they belong to the same business key, - their event date falls in 2024-02-10 to 2024-03-31, - they currently carry surrogate key 9041. Everything else is untouched. This precision matters, because the tempting alternative — rerun the whole fact load, or reassign keys across the fact table — is orders of magnitude more expensive and puts rows at risk that had nothing to do with the change. ```sql UPDATE fct_orders SET customer_sk = 9611 WHERE customer_sk = 9041 AND order_date BETWEEN DATE '2024-02-10' AND DATE '2024-03-31'; ``` In practice you drive this from a set of retro-fitted versions rather than literals, joining the fact table to the newly inserted rows on business key and date range. Either way it is one set-based statement over a bounded slice, not a row-by-row repair. ## What goes stale downstream Repointing a foreign key changes how those facts group. Everything computed from them for the affected period is now wrong until rebuilt: - **Aggregate and summary tables** covering the window — they must be rebuilt for that period, not just going forward. - **Extracts and files already delivered** to another team or a regulator — those cannot be rebuilt, only reissued or annotated. - **Cached dashboards and BI extracts**, which will otherwise keep serving the pre-restatement numbers for as long as their refresh cycle lasts, producing the confusing state where two dashboards disagree. A restatement that fixes the base fact table and leaves its dependants alone is worse than doing nothing, because the mart is now internally inconsistent and there is no single wrong number to point at. ## The decision that is not technical The update is easy. The question an interviewer is really probing is what you do about a period the business has already closed. **Restate silently.** The numbers simply change between one run and the next. Technically the most accurate state, and the fastest way to lose the finance team's confidence permanently — a report that quietly disagrees with the copy someone printed last month is indistinguishable from a broken report. **Restate with disclosure.** Change the numbers, and record what changed: which business keys, which window, which run, how much the affected measures moved. Publish that record alongside the mart, and mark the restated period visibly. This is usually the right default for analytical marts. **Freeze and adjust forward.** For periods under formal close, do not touch history at all. Leave the fact rows on their original keys and book the correction as an explicit adjustment in the current open period. This is standard accounting discipline and it is often mandated rather than chosen; the warehouse's job is to reflect it rather than to out-argue it. The honest answer in an interview names all three and says the choice belongs to the data's owner, not to the pipeline — while insisting that whichever is chosen must be written down and applied consistently, because inconsistency between subject areas is what actually confuses consumers. ## Keep the restatement auditable Whatever the policy, capture the event. A restatement log — which dimension versions were retro-fitted, which fact windows were repointed, when, by which run, and how many rows moved — is what turns "the March number changed" from a mystery into a two-minute lookup. Snapshotting the affected measure totals before and after is cheap and makes the impact quantifiable rather than anecdotal. ## Guard the result The same structural test that catches a current-flag join catches a half-finished restatement: every fact's event date must fall inside the effective window of the dimension version it points at. Run it after the repoint. Any survivor means a fact was left on the shortened version despite falling in the carved window — usually because the update's date bounds and the splice's date bounds disagreed by a day, which is exactly the kind of off-by-one that inclusive-versus-exclusive end-date conventions produce. ## When not to bother If the retro-fitted attribute is not used by any consumer for that period — a descriptive field nobody groups by — the repoint is still correct but the urgency is low, and batching it with the next scheduled rebuild is a defensible call. Judgement about which attributes are load-bearing for which reports is part of the answer; treating every retro-fit as an emergency is as much a failure of proportion as ignoring them all.
- What else must be rebuilt after the fact keys are repointed?Everything derived from those facts for that period: aggregate and summary tables covering the window, extracts already delivered elsewhere, and cached BI datasets that will otherwise keep serving the old numbers until their next refresh. Fixing the base table and leaving the dependants makes the mart internally inconsistent, which is harder to explain than the original error.
- The affected period is already closed in finance. Do you still restate?Usually not. Under a formal close the standard discipline is to leave history frozen and book the correction as an adjustment in the current open period. The warehouse reflects that policy rather than overriding it. For analytical marts with no close, restating with a visible notice and an audit record is the better default.
- How do you confirm the restatement is complete?Run the structural check that every fact's event date falls inside the effective window of the version it points at, scoped to the affected business keys. Any survivor means a row was left on the shortened version — almost always an off-by-one where the update's date bounds and the splice's bounds disagreed about an inclusive versus exclusive end date.
saying these in an interview costs you the question
- Reload the whole fact table to be safe
- Repoint every fact for that business key regardless of date
- Fix the fact table and leave the aggregates alone
- Change signed-off numbers with no notice or audit record
- Assume the surrogate key change needs no downstream action