3 ms·
Interesting! I’ve used materialized reviews for this in the past. I’m curious what the advantages to pg_later are over that.
by zekenie 3y ago
Interesting! I’ve used materialized reviews for this in the past. I’m curious what the advantages to pg_later are over that.
- chuckhend 3y agoI don't think you'd replace a materialized view with pg_later, but it might help you populate or update your materialized view if you are trying to do that asynchronously. pglater.exec() works with DDL too! I use it a lot for long running queries when doing data science and machine learning work, and a lot of times when executing queries from a jupyter notebook or CLI. That way if my jupyter kernel dies, my query execution continues even if the network or my environment has an issue. I've started using it a bit more with https://github.com/postgresml/postgresml https://github.com/postgresml/postgresml for model training tasks too, since those can be quite long running depending on the situation.
- magden 3y agoIt should be helpful for maintenance and DDL tasks. Such as I need to build a secondary index over a large table and do something once the index is ready. Start the index creation with pg_later, check the status later and do what you need to do next. Probably, they can support triggers so that once a task is completed I can be notified.
- samaysharma 3y agoWe are planning to add support for "Push notifications for completed and failed jobs". That's in our roadmap listed here: https://tembo.io/blog/introducing-pg-later/#up-next https://tembo.io/blog/introducing-pg-later/#up-next