select
*
from
a
where
exists(select 1 from b,c where b.pkid=c.bid and a.pkid=c.aid and b.keyword like '%中国%')
and
exists(select 1 from b,c where b.pkid=c.bid and a.pkid=c.aid and b.keyword like '%艺术%')
*
from
a
where
exists(select 1 from b,c where b.pkid=c.bid and a.pkid=c.aid and b.keyword like '%中国%')
and
exists(select 1 from b,c where b.pkid=c.bid and a.pkid=c.aid and b.keyword like '%艺术%')
机器配置2个xeon2.0G,1G内存,应该还可以,但就是速度慢,各种资源几乎满载。原来是单表查询,所有关键字放在一个字段内,算法:like '%xx%' and like '%xx%',很慢,
更改为现状,但是因为模糊查询,不能用到索引,效率还是很低。不知各位还有何高见,可以从更改表设计结构考虑。