Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-5470

Clickhouse query optimized for Query Analytics to improve its speed and reduce the load on the backend

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Priority: High
    • Resolution: Done
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0
    • Component/s: QAN API
    • Labels:
    • Story Points:
      2
    • Sprint:
      Platform Sprint 10, Platform Sprint 11
    • Needs Review:
      Yes
    • Needs QA:
      Yes
    • Needs Packaging:
      No
    • Needs Doc:
      No

      Description

      Looks like we have some strange Query in QAN :

      SELECT service_name, database, schema, username, client_host, replication_set, cluster, service_type, service_id, environment,az,region,
      node_model,node_id,node_name,node_type,machine_id,container_name,container_id,agent_id,agent_type,labels.key AS lkey,
      labels.value AS lvalue FROM metrics LEFT ARRAY JOIN labels
      WHERE period_start >= toDateTime(1574642098) AND period_start <= toDateTime(1582418098)
      ORDER BY service_name, database, schema, username, client_host, replication_set, cluster, service_type, service_id,
      environment,az,region,node_model,node_id,node_name,node_type, machine_id,container_name,container_id,
      agent_id,agent_type,labels.key,labels.value

      It's returning ALL possible data and very slow
      In addition, it's overload backend

      TODO: optimize it

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              roma.novikov Roma Novikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 5 hours
                  5h