Is the MySQL COUNT () function used?

I performed the following query in MyISAM table three times in a row:

mysql> SELECT COUNT(*) FROM tickets WHERE created_time BETWEEN UNIX_TIMESTAMP() - 86400 * 20 AND UNIX_TIMESTAMP() - 86400 * 19;

The ticket table only receives inserts in which the created_time column is set to UNIX_TIMESTAMP (), the rows are never deleted, and the created row time is never updated. Despite this, I received 154324, 154326 and 154325 (in that order). This leads me to believe that the COUNT () function does not return the exact number, but my brief search of the MySQL documentation and the rest of the Internet did not give any mention of this. Does anyone know what exactly COUNT () does?

+3
source share
3 answers

What happened to the results you get?

- , ( ).

COUNT - . WHERE , . , , , .

+5

. . , , UNIX_TIMESTAMP , where .

.

+3

count (*) myIsam-, MyIsam ( innodb, ) , ....

What version of mysql are you using?

-1
source

Source: https://habr.com/ru/post/1715280/


All Articles