Skip to content

Feature: Audit search box scans the whole table; add per-field filter inputs #697

Description

@a-bali

Problem

Typing a user path into the audit-log search box is slow as the table grows. The box sends search=<text>, which the backend turns into a leading-wildcard %…% ILIKE against 11 columns at once (including the JSON data->>'error_message'), forcing a full table scan that no index can serve. The endpoint already has an indexed user_path= filter (idx_audit_user_path), but the search box never uses it — and it can't, because the box is a single free-text field.

Proposal

Replace the single free-text search box with per-field filter inputs (or a field dropdown + value box) so a path query hits the user_path index instead of the blanket scan — e.g. dedicated inputs for user_path, request_id, model, session_id, error_type. Keep the generic search only as an explicit opt-in, not the default.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions