如果在newsID建索引时
当然是下面的快乐

解决方案 »

  1.   


    应该这样,由快到慢select count(newsID) from news

    select count(content) from news

    select count(*) from news
      

  2.   

    1、select count(*) from news

    2、select count(newsID) from news

    3、select count(content) from newsnewsID是主键,content是ntext类型
    ====================
    结果:
    2>1>3
      

  3.   

    应该这样,由快到慢select count(newsID) from news

    select count(content) from news

    select count(*) from news
    是这样吗?
      

  4.   

    以下内容引子一位网友的结论:某些资料上说:用*会统计所有列,显然要比一个世界的列名效率低。这种说法其实是没有根据的。我们来看:select count(*) from Tgongwen用时:1500毫秒select count(gid) from Tgongwen 用时:1483毫秒select count(fariqi) from Tgongwen用时:3140毫秒select count(title) from Tgongwen用时:52050毫秒从以上可以看出,如果用count(*)和用count(主键)的速度是相当的,而count(*)却比其他任何除主键以外的字段汇总速度要快,而且字段越长,汇总的速度就越慢。我想,如果用count(*), SQL SERVER可能会自动查找最小字段来汇总的。当然,如果您直接写count(主键)将会来的更直接些。
      

  5.   

    什么?还没看懂!
    是这样:
    select count(newsID) from news>select count(*) from news>select count(content) from news