Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

How to Tune SQL with COUNT(*) statements ?

$
0
0
It is common that we used to count the number of records in a table. You may encounter unexpected performance degradation in certain situations.

Here is an example SQL that count number of records from EMPLOYEE table. There are number of indexes are built such as emp_id, emp_dept, emp_grade, emp_hire_date and etc....

SELECT COUNT(*)
FROM EMPLOYEE;
[​IMG]
You can see MySQL SQL Optimizer use a Full Index Scan of...

How to Tune SQL with COUNT(*) statements ?

Viewing all articles
Browse latest Browse all 1987