Files
huike-back/htykc_models/migrations/2026-05-03-013827_add_clazz_indexes/down.sql
T
weli fa14a5ca8c perf: add GIN indexes on clazz JSONB columns and date-range indexes
- GIN indexes on students/teachers (jsonb_path_ops) for fast user lookups
- Composite index on clazz (is_repeat, start_from, end_by) for date range queries
- Indexes on clazz_repeat (clazz_id, repeat_start, repeat_end) for joins

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 09:39:36 +08:00

6 lines
232 B
SQL

DROP INDEX IF EXISTS idx_clazz_students_gin;
DROP INDEX IF EXISTS idx_clazz_teachers_gin;
DROP INDEX IF EXISTS idx_clazz_date_active;
DROP INDEX IF EXISTS idx_clazz_repeat_clazz_id;
DROP INDEX IF EXISTS idx_clazz_repeat_date_range;