You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Today, rendering the audit log on dev.coder.com takes over 1 minute for the first page.
When the audit log grows to a significant number of rows (currently 970714 entries at the time of writing for dev.coder.com), the pagination causes it to become slow.
The main culprit is the "total" count (COUNT(audit_logs.*) OVER () AS count) which converts the query from rendering N first results to reading the entire table as the count is based on applied filters.
Simply changing this out for (SELECT COUNT(*) FROM audit_logs) AS count makes the query instant, but of course, incorrect.
Solution: We must figure out a way to optimize the GetAuditLogsOffset query to show results faster.
The text was updated successfully, but these errors were encountered:
Problem: Today, rendering the audit log on dev.coder.com takes over 1 minute for the first page.
When the audit log grows to a significant number of rows (currently
970714
entries at the time of writing for dev.coder.com), the pagination causes it to become slow.The main culprit is the "total" count (
COUNT(audit_logs.*) OVER () AS count
) which converts the query from rendering N first results to reading the entire table as the count is based on applied filters.Simply changing this out for
(SELECT COUNT(*) FROM audit_logs) AS count
makes the query instant, but of course, incorrect.Solution: We must figure out a way to optimize the
GetAuditLogsOffset
query to show results faster.The text was updated successfully, but these errors were encountered: