count(*),count(1),count(id),count(rowid)的效率

SQL> select count(*) from ysgl_compile_reqsub;


  COUNT(*)
----------
   5288265


已用时间:  00: 00: 07.51
SQL> select count(1) from ysgl_compile_reqsub;


  COUNT(1)
----------
   5288265


已用时间:  00: 00: 00.68
SQL> select count(id) from ysgl_compile_reqsub;


 COUNT(ID)
----------
   5288265


已用时间:  00: 00: 00.68
SQL> select count(rowid) from ysgl_compile_reqsub;


COUNT(ROWID)
------------
     5288265


已用时间:  00: 00: 01.01
SQL> select count(rowid) from ysgl_vdata_his;


COUNT(ROWID)
------------
     5299458


已用时间:  00: 00: 09.98
SQL> select count(*) from ysgl_vdata_his;


  COUNT(*)
----------
   5299458


已用时间:  00: 00: 00.93
SQL> select count(1) from ysgl_vdata_his;


  COUNT(1)
----------
   5299458


已用时间:  00: 00: 00.71
SQL> select count(1) from ysgl_excelbasic;


  COUNT(1)
----------
   3755052


已用时间:  00: 00: 04.60
SQL> select count(*) from ysgl_excelbasic;


  COUNT(*)
----------
   3755052


已用时间:  00: 00: 00.50
SQL>

你可能感兴趣的:(count(*),count(1),count(id),count(rowid)的效率)