Report generation may involve expensive computation due to large amounts of data, connections to external systems, and data processing. In many situations, report data is gathered directly from the original source, typically an SQL database. This has two clear drawbacks. The first problem is that as the application runs, more and more data is added into the database, making reports run slower with time. The second problem is that report generation may heavily use the database at certain times, interfering with the usage of other parts of the application.
One step toward improving this situation is to progressively and continuously generate the data required for reporting. For example, consider the following query that calculates the average on a column:
SELECT AVG(column_name) FROM table_name
Instead of using this query, you can use the...