数据库查询语句 select distinct 的查询效率问题

在千万条数据的数据表中,

使用select count(distinct col_name,...) from table;使用的查询时间太大

应该使用 select count(*) from (select distinct col_name,...  from table) as temp; 这样的查询时间将大大的缩短。

详细分析

讨论分析

猜你喜欢

转载自blog.csdn.net/weixin_40597170/article/details/82990096