what I don't understand is how in this example it knows that there are a total of 10,000 entries.
it begins to generate the data, but as soon as it gets to 25 rows, it starts passing that to the user's browser (in DataTables).
even while the DB is still crunching out the remainder of the data set
We run a query on the DB that will generate 100,000 rows of data
The problem with not waiting for your DB table to be ready is that it is going to be working with incomplete information - i.e. a filter or a sort might not provide the expected results.
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.