From 541c801a56ca556d050bc857ec89f9e12c60d928 Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 6 Jan 2025 16:23:05 +0800 Subject: [PATCH] web_images.type --- README.md | 2 +- api/image.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 45e5275..9b9f759 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ SET GLOBAL sort_buffer_size = 268435456; -- 设置为 256MB (268435456 字节) CREATE INDEX idx_id_desc ON web_images (id DESC); -- 复合筛选降序索引 article_category_top_id -CREATE INDEX idx_acti_id_desc ON web_images (article_category_top_id, id DESC); +CREATE INDEX idx_acti_type_id_desc ON web_images (article_category_top_id, type, id DESC); -- -- 为 web_images 表的 day_rank 行设置倒序索引用于排序 -- CREATE INDEX idx_day_rank_desc ON web_images (day_rank DESC); diff --git a/api/image.go b/api/image.go index 37d9be7..dfce08f 100644 --- a/api/image.go +++ b/api/image.go @@ -597,7 +597,7 @@ var ImageItems = &graphql.Field{ } // 取所有数据的前N条(筛取属于游戏的且非封面的图像) - sql, _, _ := query.Where(goqu.Ex{"article_category_top_id": 22}).Where(goqu.Ex{"type": 0}).ToSQL() + sql, _, _ := query.Where(goqu.Ex{"article_category_top_id": 22}).Where(goqu.Ex{"web_images.type": 0}).ToSQL() // 遊標截取篩選結果集的前N条 var cursor string