查询重复数据的MySQL优化方案
数据不区分案例和案例重复查询中经常使用MySQL,通常使用子查询,子查询和使用上的功能转换成资本等条件:复制代码代码如下所示:
SELECT * FROM staticcatalogue上(源)在(选择上(源),从T
The execution efficiency of this statement is very low, especially the Source field is not indexed.Especially the most taboo in the query using the function, which will greatly reduce the speed of query, if the query within 10 minutes but also within one hundred thousand data access to the data, if the query is hundreds of thousands of words, will directly to the server running dead, this can be through a temporary table, and index. 再检查一下,这样可以增加很多速度。
复制代码代码如下所示:
创建表staticcatalogue_tmp选择上(源)作为源于staticcatalogue组。
修改表staticcatalogue_tmp添加索引tx_1(来源);
选择美国的staticcatalogue在哪里上(s.source)在(选择圣来源);
以上是这个sql优化程序的全部内容,希望大家能喜欢它。