草庐IT

contentmeta

全部标签

mysql - 使用大量 NOT IN 语句优化查询

我正在尝试查找仅在特定时间戳之前存在的源站点。这个查询对于这项工作来说似乎很糟糕。知道如何优化或可能改进的索引吗?selectdistinctsourcesitefromcontentmetawheretimestamp'2011-03-15');sourcesite上有索引和timestamp,但是查询还是需要很长时间mysql>EXPLAINselectdistinctsourcesitefromcontentmetawheretimestamp'2011-03-15');+----+--------------------+-------------+--------------