← 输入框|github.com|刷新
Skip to content

JS: Disable dynamic reordering for a few predicates - #22890

Draft
kaspersv wants to merge 1 commit into
mainfrom
kaspersv/disable-rtjo-for-select-preds-js
Draft

kaspersv wants to merge 1 commit into
mainfrom
kaspersv/disable-rtjo-for-select-preds-js

Conversation

@kaspersv

Copy link
Copy Markdown
Contributor

We are working on a new dynamic join orderer for CodeQL that join orders predicates at evaluation-time using run-time cardinality information instead of relying on a statically chosen join order decided at compilation-time. At the moment a couple of JS predicates are join ordered badly by the dynamic join orderer. This PR disables dynamic join ordering for the affected predicates.

Dynamic join ordering is still disabled by default during compilation and evaluation and the no_dynamic_join_order pragma has no effect on compilation when dynamic join ordering is not explicitly enabled during compilation.

@kaspersv
kaspersv requested a review from a team as a code owner October 26, 2026 11:15
Copilot AI max review requested due to automatic review settings October 26, 2026 11:15
@kaspersv kaspersv added the no-change-note-required This PR does not need a change note label Oct 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Compiler support for the query-level pragma in LabelInCase.ql needs confirmation because the documented select-clause grammar does not include annotations.

No open issues 🎉

What changed in this PR

Disables dynamic join ordering for selected JavaScript predicates and a query to avoid poor runtime join plans when the opt-in orderer is enabled.

Changes:

  • Adds no_dynamic_join_order to five library predicates and the LabelInCase query.
  • Leaves predicate bodies and query logic unchanged.
File Description
javascript/​ql/​src/​Statements/​LabelInCase.ql Adds a query-level ordering opt-out.
javascript/​ql/​lib/​semmle/​javascript/​Regexp.qll Disables dynamic ordering for regExpSource.
javascript/​ql/​lib/​semmle/​javascript/​RangeAnalysis.qll Disables dynamic ordering for hasNaNIndicator.
javascript/​ql/​lib/​semmle/​javascript/​dataflow/​Nodes.qll Disables dynamic ordering for regular-expression reference tracking.
javascript/​ql/​lib/​semmle/​javascript/​dataflow/​DataFlow.qll Disables dynamic ordering for localFieldStep.
javascript/​ql/​lib/​semmle/​javascript/​AST.qll Disables dynamic ordering for getFirstControlFlowNode.

Review effort: Max

@kaspersv
kaspersv marked this pull request as draft October 26, 2026 11:22
@github-actions github-actions Bot added the JS label Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JS no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants