explain select a.* from dede_taglist1 a where not exists (select 1 from dede_taglist b where a.tid=b.tid and a.aid=b.aid)1 PRIMARY a ALL 388199 Using where
2 DEPENDENT SUBQUERY b ref a a 8 caiji1.a.tid,caiji1.a.aid 1 Using index2个表的结构是一样的,都有40万条记录。查询出dede_taglist1中存在,但是在dede_taglist中不存在的某几条记录。
2 DEPENDENT SUBQUERY b ref a a 8 caiji1.a.tid,caiji1.a.aid 1 Using index2个表的结构是一样的,都有40万条记录。查询出dede_taglist1中存在,但是在dede_taglist中不存在的某几条记录。
建立了。但是还是这么慢
表1索引
dede_taglist 1 a 1 tid A 97047 BTREE
dede_taglist 1 a 2 aid A 388189 BTREE 表2索引
dede_taglist1 1 a 1 tid A 97049 BTREE
dede_taglist1 1 a 2 aid A 388199 BTREE
是符合索引啊。 (tid,aid)这2个字段上