Indexes on papers.share_token and mistake_tags.attempt_id
Both are per-request lookups (shared-paper view, result tags, dashboard rollup) that full-scanned. Zero warnings, 25 tests green.
This commit is contained in:
parent
338aa2e8ef
commit
6efbb61afc
1 changed files with 3 additions and 1 deletions
|
|
@ -22,7 +22,9 @@ pub async fn init_db(pool: &SqlitePool) -> anyhow::Result<()> {
|
|||
CREATE INDEX IF NOT EXISTS idx_papers_user ON papers(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_attempts_paper ON attempts(paper_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_attempts_user ON attempts(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_answers_attempt ON answers(attempt_id);",
|
||||
CREATE INDEX IF NOT EXISTS idx_answers_attempt ON answers(attempt_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_papers_token ON papers(share_token);
|
||||
CREATE INDEX IF NOT EXISTS idx_mistakes_attempt ON mistake_tags(attempt_id);",
|
||||
)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue