脚本如下:
DROP TABLE IF EXISTS urllog;CREATE TABLE urllog( ID int(11) NOT NULL auto_increment, url varchar(435) NOT NULL default '', create_time datetime NOT NULL, PRIMARY KEY (ID)) ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
我原来在sql server 上有40万数据,把32万数据导入到mysql中,查询结果:
select url,count(*) cnt from urllog group by url order by cnt limit 10
查询时间:9分钟
select top 10 url,count(*) cnt from urllog group by url order by cnt
查询时间:22秒