s

    Sander

    4 months ago
    Hi, wrt keeping the database size and performance good, is there a way to set some sort of retention rate policy on the database that maintains the flows, flowruns, etc?
    I'm referring to a Postgres database for 2.0
    Anna Geller

    Anna Geller

    4 months ago
    you may use e.g. pg_cron or something like that to periodically run some DBA tasks such as purging old logs, but be careful about which data you delete, e.g. purging logs should be fine, but purging flow runs you need to be careful to not break other tables that reference that flow run ID btw I thought you are on Cloud 2.0? if so, you don't have to worry at all about DBA tasks and retention policies
    s

    Sander

    4 months ago
    I'm running my own Postgres and gui. There are no on delete cascade foreign keys?
    Actually. Let me check 😃
    Looks fine to me actually. Some depend rows are deleted and some are set to null. No doubt there are some bugs here and there, but generally structure looks ok. (Referring to bugs as at some point I ran into the issue where I couldn't reset the database due to foreign key constraints. ) 🙂
    Anna Geller

    Anna Geller

    4 months ago
    yup, FK constraints is exactly what I meant - if not doing it carefully you may cause issues
    s

    Sander

    4 months ago
    I guess it somewhere on the roadmap to provide some cleanup scripts to allow proper cleanup of the database?
    No need now but wondering
    Anna Geller

    Anna Geller

    4 months ago
    I can open an issue if you want
    @Marvin open "Consider adding DB cleanup scripts to save space in Postgres"
    Marvin

    Marvin

    4 months ago