How to improve the performance of counting all rows

Viewed 1457

I use the SQL like this :

TableA have 2 million records, search the count speed 25.1secs.

select count(*) from TableA;

TableA have 2 million records, TableB also have 2 million records, get the count of TableA and TableB speed 3mins.

How to Increase the search efficiency?

2 Answers
Related