测试结果为:count(*)和count(1)基本相等,count(非主键字段)最耗性能

-- 数据量 708254
select count(*) from tmp_test1;-- avg 0.224
0.229  
0.219
0.227
0.222
0.215
0.224
0.225
0.221
0.240
0.219

select count(1) from tmp_test1;-- avg 0.226
0.230
0.217
0.217
0.233
0.225
0.220
0.235
0.232
0.233
0.219

select count(id) from tmp_test1;-- avg 0.238
0.240
0.242
0.230
0.250
0.234
0.233
0.240
0.242
0.231
0.239

select count(iccid) from tmp_test1;-- avg 0.268
0.288
0.269
0.255
0.255
0.295
0.262
0.274
0.265
0.256
0.260

相关文章:

  • 2021-11-06
  • 2021-07-21
  • 2021-07-25
  • 2022-12-23
  • 2021-11-29
  • 2021-11-03
  • 2021-10-03
  • 2021-07-12
猜你喜欢
  • 2022-01-06
  • 2021-10-05
  • 2021-07-25
  • 2022-12-23
  • 2021-05-31
  • 2021-07-31
  • 2021-10-12
相关资源
相似解决方案