-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
False
-
-
False
-
-
Investigating SWATCH-3478, we found that we do have tally_snapshots records that are duplicated.
What is a duplicated tally_snapshot? A record that have the same values for the following columns:
- org_id,
- product_id
- granularity
- snapshot_date
- sla
- usage
- billing_provider
- billing_account_id
Query to find duplicate records:
SELECT org_id, product_id, granularity, snapshot_date, sla, usage, billing_provider, billing_account_id, COUNT(*) AS duplicate_count FROM tally_snapshots ts GROUP BY org_id, product_id, granularity, snapshot_date, sla, usage, billing_provider, billing_account_id HAVING COUNT(*) > 1;
Document: https://docs.google.com/document/d/1PTxe7YJzWRqvDusOCgqnFdOtJJDTuLKQFS5GNgQ8ZuE/edit?tab=t.0
Acceptance Criteria
- Identify all the cases when a tally_snapshot is duplicated
- Investigate if we can add an unique constraint in tally_snapshots (to be done in SWATCH-3478). If not, change the index tally_snapshot_unique_constraint to not be unique.
- blocks
-
SWATCH-3478 Correct tally_snapshot table constraints
-
- Backlog
-