Lint Performance Index

Migration 0013_lint_index.sql adds a composite index on page_links(project_id, target_path).

Why

The wiki_lint orphan query joins page_links on (project_id, target_path). Without this index, the query performs a target_path scan then filters by project_id. With the composite index, it uses a direct index seek.

Existing indexes (before this migration)

IndexColumns
PK(project_id, source_path, target_path)
page_links_target_idx(target_path)
page_links_project_idx(project_id)

New index

page_links_project_target_idx ON page_links(project_id, target_path)

Trigger

Proactive. Becomes meaningful at 10k+ page_links rows per project. Does not require a schema change or downtime.

  • lint-cooldown — per-project cooldown to prevent lint abuse
  • lint-snapshot — REPEATABLE READ transaction wrapping lint queries