Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-6165

Very slow metrics query impact the whole server performance

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • None
    • Push Issue Fixes 3.16.x, Push Improvements II 3.16.x, PUSH improvements (mini sprnt)
    • 8

      Currently UPS gets the metrics about a given application with the following query:

      select count(*), sum(total_receivers), sum(app_open_counter) from push_message_info where push_application_id = 'a333dafc-f74d-4d1b-83dc-a2fb973338f8';
      

      This happens to need about 2 minutes to execute when we have millions of rows for a single app.

      A solution to this could be to create another table:

      push_message_metrics(push_application_id VARCHAR(255) PRIMARY KEY, total_receivers BIGINT(20), total_app_open BIGINT(20), total_messages_info BIGINT(20));
      

      And then keep it up to date with a trigger after insert on the push_application_id table.

              Unassigned Unassigned
              mziccard Massimiliano Ziccardi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: