Open
Description
RSS, an Event Sourcery project, was having problems with the database CPU usage increasing over time:
We turned on Postgres logging to look for slow queries and found these two:
SELECT * FROM "events"
WHERE ("type" IN ('revenue_period_voided', 'revenue_period_ended'))
ORDER BY "id" DESC
LIMIT 1
and
SELECT * FROM "events"
WHERE ((id >= 3616762) AND ("type" IN ('revenue_period_voided', 'revenue_period_ended')))
ORDER BY "id"
LIMIT 1000
RSS stopped emitting events of type revenue_period_ended
and revenue_period_voided
some time ago but we had not turned off their projector.
The dip in the CPU graph is when we disabled the relevant projector.
The implication here is that any projector that deals with RARE events will run slow.
@envatopoho is investigating indexes that may resolve the issue.
Metadata
Metadata
Assignees
Labels
No labels