feat: add user_id index to profiles table for faster lookups

The profiles table previously lacked an index on the user_id column, causing full table scans during user lookups. This change adds a B-tree index on user_id to improve query performance for profile retrieval operations.
This commit is contained in:
2026-06-11 23:52:32 +00:00
parent 56da963440
commit f487fdb973
4 changed files with 55 additions and 16 deletions
+2
View File
@@ -155,6 +155,7 @@ def write_reports(
started: datetime,
finished: datetime,
cost: Optional[dict[str, Any]] = None,
incomplete: bool = False,
) -> dict[str, Any]:
REPORTS_DIR.mkdir(parents=True, exist_ok=True)
items = findings()
@@ -166,6 +167,7 @@ def write_reports(
"mode": mode,
"started_at": started.isoformat(),
"finished_at": finished.isoformat(),
"incomplete": incomplete,
"summary": summary,
"cost": cost or {},
"findings": items,