1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00
unleash.unleash/src
Gastón Fournier e2ffbee468
chore: limit the amount of unannounced events we announce (#4845)
## About the changes
When the events table is large we might be doing a full table scan
searching for unannounced events. We spotted it due to a performance
alert and confirmed in AWS performance insights

![image](https://github.com/Unleash/unleash/assets/455064/8e815fa3-7a1b-4453-881a-98a148eae119)

The proposal is to limit this operation to 500 events (rule of thumb)
per round
f82ae354eb/src/lib/services/index.ts (L141-L147)
and also ignore the events older than a day (because it seems
reasonable)


## Discussion points
**Idea**: split the `events` table into `recent_events` and
`historical_events`. Recent can be anything from a day/week/month. This
would help with recurrent queries that rely on recent data from the
event's table such as optimal 304 calculation or event this scheduled
task that sends unannounced events.
2023-09-27 15:38:00 +02:00
..
lib chore: limit the amount of unannounced events we announce (#4845) 2023-09-27 15:38:00 +02:00
mailtemplates
migrations Feat/reset pnps (#4841) 2023-09-27 12:03:02 +02:00
test refactor: prefer eventService.storeEvent methods (#4830) 2023-09-27 14:23:05 +01:00
migrator.ts
server-dev.ts feat: UI stub for adding dependent features (#4814) 2023-09-22 11:26:45 +02:00
server.ts