-- Two indexes the Sprint 9 load test asked for (docs/05).
--
-- `idx_attendance_tenant_lesson`: every attendance figure joins lessons to
-- attendance inside one tenant. Without the tenant column in front the planner
-- read all 57 500 rows of a thousand-student centre to reach the 1 160 it
-- wanted.
--
-- `idx_students_tenant_name`: the students list is the most opened screen and
-- sorts by name. The existing (tenant_id, status) index cannot serve that
-- ordering, so drawing page one sorted the whole tenant.
--
-- Both tables are small enough that the build takes well under a second. If a
-- centre ever grows to where that stops being true, build them with
-- CREATE INDEX CONCURRENTLY by hand before deploying — Prisma runs migrations
-- inside a transaction, and CONCURRENTLY cannot.

-- CreateIndex
CREATE INDEX "idx_attendance_tenant_lesson" ON "attendance"("tenant_id", "lesson_id");

-- CreateIndex
CREATE INDEX "idx_students_tenant_name" ON "students"("tenant_id", "full_name");
