What can happen, your data is “blocked for updating” during the update - it depends on how the data is recalculated.
A good way around this is to make a new calculation in a separate data area, and then move on to using the new data after all this. One way to implement this is to use the database view and version number, for example:
create table my_statistics ( id int not null primary key auto_increment, version int not null,
Put your new statistics in the table with the version number current_version + 1. After all the calculations are done. Then a simple update stats_version set current_version = current_version + 1 switch to using the new data. This last statement takes only a few milliseconds, so blocking expectations are tiny.
After switching, you can delete the old statistics to save space.
Using the “switch” approach makes updating and “atomic updating” - updating occurs “instantly and completely”, therefore users do not see a partially modified data set.
source share