Background routine for data compilation is a good idea?

The Last company I worked for had some very peculiar rules, these are not as common(as far as I know) in other IT companies. Basically we were compiling all the data that would be used in the system graphics. In this compilation the data was grouped by day and by hour, and saved in two tables, one being compiled_day and the other compiled_hour. The idea of doing this was as follows, I have let's assume 1 million sales records in the sales table, instead of loading all 1 million records from the sales table, only the data from the compiled_daily table was loaded, so there was a substantial drop in the number of records that were loaded. As for the customer, it is only important how he will visualize the data, no matter how the monthly chart data was assembled.

Giving a clearer example, let's assume that we have 100 thousand records in the sales table this month. If I get it the raw table data, I will have to load 100 thousand records, if I take the data from the compiled data table, will be only 30 records, one for each day, alas in the compilation I have the sum of all records.

What do you think is a good idea? Or do you have a technical problem with it?

Author: Master_17921, 2020-06-04