Actions
Bug #15041
closedThe computation of changes by rules, at start of web interface, is quite slow
Status:
Released
Priority:
N/A
Assignee:
Category:
Performance and scalability
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Reviewed
Fix check:
Checked
Regression:
Description
at the start of the application, we fetch all changes, in the last three days, with the following query
select ruleid, count(*) as number, ( extract('epoch' from executiontimestamp)::bigint - ${start})/21600 as interval from ruddersysevents where eventtype = 'result_repaired' and executionTimeStamp > '${new Timestamp(startTime.getMillis)}'::timestamp group by ruleid, interval;this is quite inefficient, as:
- postgres needs to to mathematical operation for every lines in ruddersysevents, to get an interval with an index
- postgres goes over 3 days worth of reports
we should split this in 12 queries (1 per 6 hours), without any mathematical operation, like
select ruleid, count(*) as member from ruddersysevents where eventtype = 'result_repaired' and executionTimeStamp > '2019-06-04 00:00:00.0'::timestamp and executionTimeStamp < '2019-06-04 06:00:00.0' group by ruleid
on super loaded instance, it goes from several hourshours to 12*2 minutes
Actions