Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-3503

Spike: clarify the tally_snapshots duplications

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • 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.

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: