Skip to content

Review #1939 for code improvements: EXISTS runs its whole subquery for every outer row #2678

Backlog

Description

@mathiasrw

This is not a bug report. It is an invitation to look at #1939 again: the fix (a boolean from EXISTS) is right, but the line it touched runs the whole subquery for every outer row. The goal is to understand the change and decide whether anything should be improved. The notes below come from a quick read of the diff and one count, not from a timed measurement.

The concern:

  • EXISTS runs its subquery in full, once per outer row. ExistsValue.toJS (src/41exists.js) calls this.existsfn[i](params, null, p).data.length in the WHERE function. With 200 outer and 200 inner rows, the inner WHERE ran 40,000 times, for an uncorrelated subquery as well as a correlated one (counted with a user function, not timed).
  • Two things could cut this, independent of each other:

Related: #1904, #2645.

Activity

  1. mathiasrw commented on Nov 26, 2026

    @mathiasrw
    MemberAuthor

    Will be covered by #3164.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions