Currently UPS gets the metrics about a given application with the following query:
{code:sql} select count(*), sum(total_receivers), sum(app_open_counter) from push_message_info where push_application_id = 'a333dafc-f74d-4d1b-83dc-a2fb973338f8'; {code}
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:
{code:sql} push_message_metrics(push_application_id VARCHAR(255) PRIMARY KEY, total_receivers BIGINT(20), total_app_open BIGINT(20) , total_messages_info BIGINT(20 ) ) ; {code}
And then keep it up to date with a trigger after insert on the push_application_id table. |
|