I have a master table of data in Supabase that has data inserted into it every minute. I’d like to be able to have a new table that holds data from the last 4 hours.
I’ve previously had a cron job running every minute that triggered a function that did this. The function queried the entire master database that holds 3+ million rows each time and therefore was exhausting my disk I/O.
Is it possible to achieve the “rolling window” idea without the compute overhead? So when new data is added to the master, the 4 hour table is automatically updated.