rubenfR
Windmill11mo ago
14 replies
rubenf

Can you connect to your postgresql

Can you connect to your postgresql database with psql and show me the result of:
\d v2_job;

Next, can you run:
EXPLAIN ANALYZE SELECT
            schedule.*, t.jobs FROM schedule,
            LATERAL(SELECT ARRAY(
                SELECT json_build_object('id', id, 'success', status = 'success', 'duration_ms', duration_ms)
                FROM v2_job_completed c JOIN v2_job j USING (id)
                WHERE trigger_kind = 'schedule'
                    AND trigger = schedule.path
                    AND c.workspace_id = 'admins'
                    AND j.workspace_id = 'admins'
                    AND parent_job IS NULL AND runnable_path = schedule.script_path
                    AND status <> 'skipped'
                ORDER BY created_at DESC
                LIMIT 20
            ) AS jobs) t
        WHERE workspace_id = 'admins'
        ORDER BY edited_at DESC;

Where you have replaced 3 times 'admins' with the name of your workspace in the query above.
Was this page helpful?