PRIMARY KEY (`tvp_id`), INDEX `tvp_channel` (`tvp_channel`),INDEX `tvp_time` (`tvp_time`),ENGINE=MyISAM
我清除缓存并多次运行查询--结果是相同的--查询速度要快2倍。SELECT COUNT(*), tvp_type FROM programs WHERE (
select tsp.data_ip, tsp.IP, tvp.vm_d_ip, tvp.IP FROM cmdb.t_server tsp,cmdb.t_vm tvp,t_ip ip where tvp.SERIALNUMBER= 'AD123' or tsp.SERIALNUMBER= 'AD123' and (ip.ip=tsp.d_ip or ip.ip=tsp.IP or ip.ip=tvp.dip or ip.ip=tvp.IP);