At my new company we rarely use UPI and instead generally use a PI on 1 column and use a "Natural Key". IE:
TABLE: acct_id, acct_typ, start_dt, end_dt, cur_in, rcv_in, metric1, metric2, metric3
With a primary index of acct_id
I would use a UPI on (acct_id, acct_typ, start_dt, end_dt) and my join would look something like:
JOIN ON a.acct_id = b.acct_id and a.actvy_dt between b.start_dt and b.end_dt
↧
Should a SCD table contain a UPI including date fields or use a natural key? - topic by dsldsl1980
↧