ITPub博客

首页 > 数据库 > Oracle > select count(*) from abc 和 select count(某字段) from abc 的区别

select count(*) from abc 和 select count(某字段) from abc 的区别

原创 Oracle 作者:onunix 时间:2008-07-28 15:49:51 0 删除 编辑


今天在ORACLE 10g上做了个测试:

select count(*) from abc

select count(某字段) from abc

如果选择的字段为索引字段时,速度几乎一样。

另外,select count(索引字段) from abc

比 select count(非索引字段) from abc

速度明显快,快3倍以上。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13926548/viewspace-1007971/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论
  • 博文量
    2
  • 访问量
    2864