Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request delivers major performance improvements to the admin dashboard and error group logs endpoints, as well as fixes a validation error in the detection category filter. The changes optimize database queries by using continuous aggregates, row estimate functions, and chunk pruning, resulting in significantly faster response times for endpoints that previously timed out on large datasets. The detection category filter is simplified, resolving a schema validation issue. Additionally, redundant queries are removed and validation schemas are aligned.
Performance Improvements
approximate_row_count,pg_class.reltuples) for statistics, replacing expensiveCOUNT(*)scans and running queries in parallel. This reduces response times from over 30 seconds to under a second. (packages/backend/src/modules/admin/service.ts, [1] [2] [3] [4]logs.timebounds for TimescaleDB chunk pruning, removes expensiveCOUNT(*)queries, and eliminates redundant group fetches by reusing already loaded data. (packages/backend/src/modules/exceptions/service.ts, [1] [2] [3];packages/backend/src/modules/exceptions/routes.ts, [4]Validation and Schema Fixes
/api/v1/siem/detectionsis fixed by replacing theoneOfschema (string | array) with a simpletype: array, allowing Fastify to auto-coerce single values to arrays. The Zod validation schema is updated to match. (packages/backend/src/modules/siem/routes.ts, [1] [2]Documentation
CHANGELOG.md, CHANGELOG.mdR8-R30)Testing
packages/backend/src/tests/modules/exceptions/service.test.ts, packages/backend/src/tests/modules/exceptions/service.test.tsL696-R704)Frontend Cleanup
packages/frontend/src/routes/dashboard/errors/+page.svelte, packages/frontend/src/routes/dashboard/errors/+page.svelteL12-L30)