Project

General

Profile

Actions

Bug #15041

closed

The computation of changes by rules, at start of web interface, is quite slow

Added by Nicolas CHARLES almost 5 years ago. Updated over 4 years ago.

Status:
Released
Priority:
N/A
Category:
Performance and scalability
Target version:
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


Related issues 1 (1 open0 closed)

Related to Rudder - Bug #15092: Queries to fetch changes are too bigNewActions
Actions

Also available in: Atom PDF