Commit Graph

14 Commits

Author SHA1 Message Date
bishnubista
817e848d08 fix(audit-logs): route request audit log reads through logsDb
Route the read paths in queryRequestAuditLog.ts and
queryRequestAnalytics.ts through `logsDb` instead of
`primaryLogsDb`, matching the existing private audit log routes
(queryActionAuditLog, queryAccessAuditLog, queryConnectionAuditLog
all already use `logsDb`). In PostgreSQL deployments configured
with a read replica via `withReplicas` (see server/db/pg/logsDriver.ts),
this keeps high-volume audit log reads off the primary. No-op
in OSS-SQLite where `logsDb === primaryDb`.

Investigated rewriting `queryUniqueFilterAttributes` per the
in-line TODO ("SOMEONE PLEASE OPTIMIZE THIS!!!!!"). A candidate
rewrite using UNION ALL with six GROUP BY...LIMIT 500 arms
benchmarked 48-61% slower than the current SELECT DISTINCT
LIMIT 501 approach on SQLite (100k/300k/1M rows, 20 runs each):
each grouped arm materializes a temp B-tree before applying LIMIT,
while DISTINCT short-circuits via hash dedup with early exit.
A materialized facets table is likely the right long-term fix,
not a query-shape rewrite.
2026-05-25 10:37:47 -07:00
Owen
789b991c56 Logging and http working 2026-04-12 15:08:17 -07:00
miloschwartz
4cab693cfc openapi and swagger ui improvements and cleanup 2026-03-03 14:54:17 -08:00
Owen
b622aca221 Try to route logs requests to a different database 2026-02-20 17:20:01 -08:00
Owen
5c67a1cb12 Format 2025-12-22 16:28:41 -05:00
Owen
221ee6a1c2 Remove warning for limit 2025-12-22 14:07:49 -05:00
Owen
3e01bfef7d Move primaryDb into driver 2025-12-18 17:08:50 -05:00
Owen
6b609bb078 Force big queries onto primary db to prevent 40001 2025-12-18 16:03:15 -05:00
depado
16653dd524 fix(database): filter dates evaluated at module load time 2025-12-18 10:06:31 -05:00
miloschwartz
f81909489a add client telmetry and fix missing openapi on prefault 2025-12-11 10:38:48 -05:00
Fred KISSIE
9db2feff77 ♻️ set default time to 7 days ago in API too 2025-12-09 00:17:34 +01:00
miloschwartz
a746ef36a8 Merge branch 'dev' into clients-user 2025-12-04 11:38:05 -05:00
Fred KISSIE
dc237b8052 💬 update text message from the API 2025-11-20 03:19:43 +01:00
Fred KISSIE
af4b9e83f7 ✏️ fix typos 2025-11-20 02:55:03 +01:00