Fix jobs page performance and enable parent/child expand UI#859
Merged
Conversation
- 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
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CAST(p.pipeline_id AS CHAR)from the jobs list query. MySQL now useseq_refon primary keys (best possible join type) instead of full table scans caused by the CAST preventing index usage.child_countto job rows — correlated subquery on the indexedparent_job_idcolumn, so the frontend knows which rows are expandable without needingengine_data.hide_childrenfilter,parent_job_idquery 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 updatinghasChildren()to usechild_count.What changed
Backend (PHP)
JobsOperations::get_jobs_for_list_table()— fixed VARCHAR/BIGINT JOIN (no more CAST), addedchild_countsubqueryApi/Jobs.php— already hadparent_job_idandhide_childrenREST params (workspace only)GetJobsAbility.php— already hadparent_job_idandhide_childrensupport (workspace only)Frontend (React)
JobsTable.jsx—hasChildren()now checkschild_countfirst, falls back toengine_data.batchapi/jobs.js— already hadfetchChildJobs()andhideChildren(workspace only)queries/jobs.js— already haduseChildJobs()hook (workspace only)jobs-page.css— batch hierarchy styles (workspace only)Performance improvement
Testing
eq_refjoins + index-only child_count scan