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

Slow query - tally_instance_view - 2.7 seconds

    XMLWordPrintable

Details

    • False
    • Hide

      None

      Show
      None
    • False

    Description

      When investigating slow calls to swatch-api I found trace 6bf6bbbf6b03c78a18ea17c655925524

      which showed a query of tally_instance_view that took more than 3 seconds. 

      The rest call was

      /api/rhsm-subscriptions/v1/instances/products/RHEL%20for%20x86?dir=desc&ending=2023-07-06T23:59:59.999Z&limit=100&offset=0&sort=last_seen&beginning=2023-06-06T00:00:00.000Z&uom=sockets

      The specific query was:

      select distinct tallyinsta0_.bucket_billing_account_id as bucket_b1_15_, tallyinsta0_.bucket_billing_provider as bucket_b2_15_, tallyinsta0_.instance_id as instance3_15_, tallyinsta0_.measurement_type as measurem4_15_, tallyinsta0_.product_id as product_5_15_, tallyinsta0_.sla as sla6_15_, tallyinsta0_.uom as uom7_15_, tallyinsta0_.usage as usage8_15_, tallyinsta0_.cores as cores9_15_, tallyinsta0_.display_name as display10_15_, tallyinsta0_.host_billing_account_id as host_bi11_15_, tallyinsta0_.host_billing_provider as host_bi12_15_, tallyinsta0_.id as id13_15_, tallyinsta0_.last_seen as last_se14_15_, tallyinsta0_.num_of_guests as num_of_15_15_, tallyinsta0_.org_id as org_id16_15_, tallyinsta0_.sockets as sockets17_15_, tallyinsta0_.subscription_manager_id as subscri18_15_, tallyinsta0_.value as value19_15_ from tally_instance_view tallyinsta0_ where tallyinsta0_.cores>=? and tallyinsta0_.sockets>=? and tallyinsta0_.org_id=? and tallyinsta0_.product_id=? and tallyinsta0_.sla=? and tallyinsta0_.usage=? and tallyinsta0_.bucket_billing_provider=? and tallyinsta0_.bucket_billing_account_id=? and (lower(tallyinsta0_.display_name) like ?) and tallyinsta0_.uom=? order by tallyinsta0_.last_seen desc, tallyinsta0_.id asc limit ? 

       

       

      Attachments

        Activity

          People

            kflahert@redhat.com Kevin Flaherty
            bcourt@redhat.com Barnaby Court
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: