Skip to content

Update cron job overview to opt to skip JOIN depending on query cost#1167

Closed
everettbu wants to merge 12 commits into
masterfrom
joshen/fe-2454-improve-cron-job-overview-when-cronjob_run_details-is-large
Closed

Update cron job overview to opt to skip JOIN depending on query cost#1167
everettbu wants to merge 12 commits into
masterfrom
joshen/fe-2454-improve-cron-job-overview-when-cronjob_run_details-is-large

Conversation

@everettbu

@everettbu everettbu commented Feb 5, 2026

Copy link
Copy Markdown

Mirror of supabase/supabase#42492
Original author: joshenlim


Context

The Integrations -> Cron overview page renders a list of cron jobs by doing a join on both cron.jobs and cron.job_run_details in order to pull the data for "Latest run" and "Status" ("Next run" is just derived from "Latest Run" and the job's schedule)

In the past, we've had users run into issues where this query would time out, likely due to the join on job_run_details especially if that table is really big (and the columns on that table aren't indexed), and our solution was to inform users to clear out that table + schedule a job to clean the job_run_details table on a certain cadence. This CTA however blocks the UI from rendering the cron jobs overview entirely

image

Changes involved

Am opting to use the new preflight check introduced here

  • Attempt to fetch the data for the cron jobs overview normally
  • If preflight check rejects (due to high cost), then opt to fetch the data while omitting the join
    • Show a banner instead to inform the user accordingly
    • So that way users can still view their cron jobs (the latest run column is a nice to have convenience really)
image
  • Clicking learn more will then open a dialog to explain what this is all about
    • The steps to clear the job_run_details table + schedule a clean up job still remains
image Screenshot 2026-02-05 at 12 56 39 Screenshot 2026-02-05 at 13 01 37
  • Non-UI related changes include
    • Automatically refresh cron jobs after scheduling a job, remove manual CTA to refresh the jobs after scheduling the clean up job

Summary by CodeRabbit

  • New Features

    • Previous Runs tab on cron job pages
    • Interactive "Learn more" cleanup dialog with guided delete and schedule steps
    • Close-confirmation modal when editing cron jobs
    • High-cost banner that enables a lightweight "minimal" list mode
  • Bug Fixes

    • Clearer placeholder (minus icon/message) when a job has no runs
  • Performance

    • Safer, more efficient fetching and pagination for large cron job lists; reduced retries on high-cost queries
  • Tests

    • Expanded end-to-end tests covering high-cost flows and the cleanup dialog

@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  98 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  105 tests across 16 suites
duration  8 minutes, 11 seconds
commit  43c62af

Flaky tests

Features › cron-jobs.spec.ts › High Query Cost Banner › shows banner and still displays cron jobs when query cost exceeds threshold
Features › table-editor.spec.ts › table editor › sidebar actions works as expected

Skipped tests

Features › assistant.spec.ts › AI Assistant › Can send a message to the assistant and receive a response
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@blacksmith-sh

This comment has been minimized.

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Feb 9, 2026
@everettbu everettbu deleted the joshen/fe-2454-improve-cron-job-overview-when-cronjob_run_details-is-large branch February 9, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants