我用插件查出来的,我的 wordpress 排名前几的搜索都很慢,求大佬支援。。。
SELECT ibz_posts.ID FROM ibz_posts LEFT JOIN ibz_term_relationships ON (ibz_posts.ID = ibz_term_relationships.object_id) WHERE 1=1 AND ( ibz_term_relationships.term_taxonomy_id IN (i) ) AND ((ibz_posts.post_type = s AND (ibz_posts.post_status = s))) AND ( NOT EXISTS (select * from ibz_term_relationships tr inner join ibz_term_taxonomy tt on tr.term_taxonomy_id = tt.term_taxonomy_id where tt.taxonomy = s and ibz_posts.ID = tr.object_id AND tr.term_taxonomy_id IN (i))) ORDER BY ibz_posts.post_date DESC, ibz_posts.ID DESC LIMIT 0, 12
UPDATE ibz_postmeta SET meta_value = s WHERE post_id = i AND meta_key = s
SELECT term_id, meta_key, meta_value FROM ibz_termmeta WHERE term_id IN (i, i) ORDER BY meta_id ASC
SELECT t., tt., tr.object_id FROM ibz_terms AS t INNER JOIN ibz_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN ibz_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (s, s, s, s, s) AND tr.object_id IN (ilonglist) ORDER BY t.name ASC
SELECT t., tt., tr.object_id FROM ibz_terms AS t INNER JOIN ibz_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN ibz_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (s, s, s, s, s) AND tr.object_id IN (ilist) ORDER BY t.name ASC
SELECT t., tt., tr.object_id FROM ibz_terms AS t INNER JOIN ibz_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN ibz_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (s, s, s, s, s) AND tr.object_id IN (i, i) ORDER BY t.name ASC
SELECT t., tt., tr.object_id FROM ibz_terms AS t INNER JOIN ibz_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN ibz_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (s, s, s, s, s) AND tr.object_id IN (i) ORDER BY t.name ASC
SELECT t., tt. FROM ibz_terms AS t INNER JOIN ibz_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN ibz_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN (s) AND tr.object_id IN (i) ORDER BY t.name ASC
1
hefish 2023-04-29 23:38:05 +08:00
照着 sql 把 where 部分的字段盲加一下,再不行把 ORDER by 字段盲加一下,再不行把 ON 字段的盲加一下。。。
|