优化查询条件:移除coze_tag非空检查以避免索引失效,仅保留状态过滤

This commit is contained in:
2026-02-05 12:52:43 +08:00
parent 4805321722
commit 1b5b2d213c

View File

@@ -97,9 +97,7 @@ class ArticleImageMatcher:
a.coze_tag,
a.department
FROM ai_articles a
WHERE a.coze_tag IS NOT NULL
AND a.coze_tag != ''
AND NOT EXISTS (
WHERE NOT EXISTS (
SELECT 1 FROM ai_article_images ai
WHERE ai.article_id = a.id
)
@@ -748,6 +746,10 @@ class ArticleImageMatcher:
try:
# 解析文章标签
if not coze_tag:
logger.warning(f"文章 {article_id} 没有标签信息,跳过")
return False
article_tags = self.parse_article_tags(coze_tag)
if not article_tags:
logger.warning(f"文章 {article_id} 没有有效标签,跳过")