perf(admin): 优化观看记录列表并统一时间格式
- 新增 watched_at 索引,默认倒序翻页走 Merge Append 而不是全表排序 - 装配只取展示所需列,会话查询不再拉 refresh_token_hash - 关键词预检索加 2000 条上限 - admin-api 的 LocalDateTime 统一输出 yyyy-MM-dd HH:mm:ss
This commit is contained in:
1 parent
8999ff395d
commit
a41ab18636
6 files changed
+93
-13
No files matched your search
@@ -0,0 +1,11 @@
|
||||
-- Author: fruit.com.cn
|
||||
-- K112 观看记录默认列表的排序索引。
|
||||
-- 后台按 watched_at DESC, id DESC 倒序翻页,原有索引都以 user_id/drama_id/device_id 开头,
|
||||
-- 不带筛选条件时只能全表扫描再排序;补一条时间索引让翻页直接走索引。
|
||||
-- watch_history 是分区表,在父表建索引会自动下发到各分区。
|
||||
BEGIN;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_watch_history_watched_at
|
||||
ON watch_history (watched_at DESC, id DESC);
|
||||
|
||||
COMMIT;
|
||||
Reference in new issue
Block a user