If I now request that the database count exactly 10,000,000 rows, and this request takes 5 seconds to complete, the result is 10000000, 10000500 or some value between these two values?
If you run it in a transaction, the exact behavior depends on the isolation level you use, and what happened before in that transaction Things.
Suppose I have a table with exactly 10M rows. I need to know the exact number of rows. It takes 5 seconds for COUNT requests. Suppose I add to the table every second 100 rows.
If I now request that the database count exactly 10,000,000 rows, and the request takes 5 seconds to complete, the result is 10000000, 10000500 or some value between these two values?
If you are not running the statement in an explicit transaction, then the count it gives when the statement starts to execute will be correct, so 10000000 is not 10000500 .
If you run it in a transaction, the exact behavior depends on the isolation level you use and what happened before in that transaction.