XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • None
    • COST Sprint 50, COST Sprint 51, COST Sprint 52, COST Sprint 53

      We used OpenShift as the prototype for table partitioning. The linked PR (https://github.com/project-koku/koku/pull/2256) should serve as the template for other source types.

       

      The openshift daily summary tables as well as the aws and azure summary tables will now be partitioned by year and month.

      Testing

      New DB

      1. git checkout master && git pull
      2. make docker-reinitdb-with-sources
      3. psql postgresql://postgres@localhost:15432/postgres
      4. \dt acct10001.*
      5. \q

      You should see three daily tables listed as partitioned table followed by another table named <daily_table>_default.

      Existing DB With Data

      1. git checkout bbb3253aa3ff0d727ae13175afa6b5b311ba904b && git pull
      2. make docker-down && make docker-up && make docker-reinitdb-with-sources
      3. Create some data for ocp, azure, aws
      4. git checkout master && git pull
      5. make run-migrations
      6. psql postgresql://postgres@localhost:15432/postgres
      7. \dt acct10001.*
      8. \q

      You should see the partitioned tables as well as some similarly named tables ending with YYYY_MM to designate the partition. There should also be a default partition.
      None of the default partitions should have any data

       

              Unassigned Unassigned
              aberglun@redhat.com Andrew Berglund (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: