I'm working on a Postgresql database with a lot of data.
I created R Shiny application which is linked to this database, but the number of records is too large for this app - it works slowly.
I would like to create new table which will aggregate data from many tables into 2 or 3 aggregated so called "data marts". I prepared 'SELECT query' which aggregate data, and I know how to run it manually by 'INSERT query' into new one - but that is not the point and a solution.
Is it possible to set it once and it will be updating by itself?