Home > database >  Mysql... Count (1) a fifty million - table data, need 50 s, how to solve?
Mysql... Count (1) a fifty million - table data, need 50 s, how to solve?

Time:09-16

Select count (1) the from sc_crm_ci_public_custinfo;

CodePudding user response:

You can refer to my blog:
https://blog.csdn.net/yenange/article/details/78973546

CodePudding user response:

50 million records, without any conditions, a statement of how you optimize, the Count function will not be too fast, because all the data need to be read from disk, loop computations 50 million times, bottlenecks in the disk, CPU, memory, in solid state disk would be much better,

CodePudding user response:

Hello great god, your method is not soon,

CodePudding user response:

reference 1/f, gypsy song response:
can refer to my blog:
https://blog.csdn.net/yenange/article/details/78973546
hello, your method and direct count (1) oh, almost

CodePudding user response:

reference 4 floor wangyonglin1123 response:
Quote: refer to 1st floor gypsy song response:
can refer to my blog:
https://blog.csdn.net/yenange/article/details/78973546
hello, your method and direct count (1) oh, almost

You post a screenshot of execution (including statements and result) to say again, seeing is believing,
  • Related