Skip to content

Fix jobs page performance and enable parent/child expand UI#859

Merged
chubes4 merged 1 commit intomainfrom
feature/jobs-page-parent-child-perf
Mar 18, 2026
Merged

Fix jobs page performance and enable parent/child expand UI#859
chubes4 merged 1 commit intomainfrom
feature/jobs-page-parent-child-perf

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 18, 2026

Summary

  • Fix slow JOIN performance — removes CAST(p.pipeline_id AS CHAR) from the jobs list query. MySQL now uses eq_ref on primary keys (best possible join type) instead of full table scans caused by the CAST preventing index usage.
  • Add child_count to job rows — correlated subquery on the indexed parent_job_id column, so the frontend knows which rows are expandable without needing engine_data.
  • Enable the parent/child expand UI — the hide_children filter, parent_job_id query parameter, expand/collapse React components, and CSS were already built in the workspace but never deployed. This commit completes the feature by fixing the SQL layer and updating hasChildren() to use child_count.

What changed

Backend (PHP)

  • JobsOperations::get_jobs_for_list_table() — fixed VARCHAR/BIGINT JOIN (no more CAST), added child_count subquery
  • Api/Jobs.php — already had parent_job_id and hide_children REST params (workspace only)
  • GetJobsAbility.php — already had parent_job_id and hide_children support (workspace only)

Frontend (React)

  • JobsTable.jsxhasChildren() now checks child_count first, falls back to engine_data.batch
  • api/jobs.js — already had fetchChildJobs() and hideChildren (workspace only)
  • queries/jobs.js — already had useChildJobs() hook (workspace only)
  • jobs-page.css — batch hierarchy styles (workspace only)

Performance improvement

Before: LEFT JOIN ... ON j.pipeline_id = CAST(p.pipeline_id AS CHAR)  → ALL scan
After:  LEFT JOIN ... ON j.pipeline_id = p.pipeline_id                → eq_ref on PK

Testing

  • 873/873 tests pass (29 pre-existing failures on main, unchanged)
  • Lint passes with no new findings
  • EXPLAIN confirms optimal query plan: eq_ref joins + index-only child_count scan

- Remove CAST(pipeline_id AS CHAR) from JOINs — MySQL now uses eq_ref
  on primary keys instead of full table scans
- Add child_count correlated subquery using indexed parent_job_id column
- Update hasChildren() to prefer child_count over engine_data batch flag
- The hide_children, parent_job_id filters and expand/collapse UI were
  already built in the workspace but never deployed — this commit
  completes the feature by fixing the SQL layer
@chubes4 chubes4 merged commit 1e5ef50 into main Mar 18, 2026
3 checks passed
@chubes4 chubes4 deleted the feature/jobs-page-parent-child-perf branch March 18, 2026 20:37
@github-actions
Copy link

github-actions bot commented Mar 18, 2026

Homeboy Results — data-machine

Lint

⚡ Scope: changed files only

lint (changed files only)

Test

⚡ Scope: changed files only

test (changed files only)

Audit

⚡ Scope: changed files only

audit (changed files only)

Tooling versions
  • Homeboy CLI: homeboy 0.81.1+7ef43bfa
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

Homeboy Action v1

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.

1 participant