区分度高的放在前面
select count(distinct destinationmachine) cdd, count(distinct factoryname) cdf, count(distinct requesttype) cdr, count(distinct CASSETTETYPE) cdc, count(distinct state) cds from dsptransfercommand; |
CDD CDF CDR CDC CDS
---------- --------- ---------- ---------- ----------
259 4 4 2 8
Select count(*) from dsptransfercommand表计算总数
选择索引选择性好的列放在前面。