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>
This commit is contained in:
2026-05-03 09:39:36 +08:00
parent 7b05a91988
commit fa14a5ca8c
12 changed files with 55 additions and 0 deletions
+1
View File
@@ -966,6 +966,7 @@ mod tests {
tags: None,
current_org_id: current_org_id.map(|value| value.to_string()),
current_org_role_keys: Some(vec!["TEACHER".to_string()]),
current_department_id: None,
};
jwt_encode_token(token).expect("encode test token")
}
+1
View File
@@ -337,6 +337,7 @@ mod tests {
tags: None,
current_org_id: current_org_id.map(|value| value.to_string()),
current_org_role_keys: Some(vec!["TEACHER".to_string()]),
current_department_id: None,
};
AuthorizationHeader(jwt_encode_token(token).expect("encode test token"))
}
+1
View File
@@ -33,6 +33,7 @@ fn build_test_token(with_org_context: bool) -> String {
None
},
current_org_role_keys: Some(vec!["TEACHER".to_string()]),
current_department_id: None,
};
jwt_encode_token(token).expect("encode test token")
}