You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Review #2514 for code improvements: row scope copied for every group #2668
This is not a bug report. It is an invitation to look at #2514 again, because the fix may be wider than the problem and adds work for every group. 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, not from a measured analysis.
The concerns:
A copy of the row scope for every group, always.compileGroup (src/423groupby.js) now adds this.groupSources.set(g, Object.assign({}, p)) when a new group starts, whether or not the select has a correlated subquery. That is a copy and a WeakMap write per group in the grouping loop. Not measured.
Every plain column of a grouped select now reads from that copy.compileSelectGroup1 (src/424select.js) compiles each yy.Column as (this.groupSources.get(g) || g)[...], not only those inside a subquery. That changes how all grouped selects read their columns to fix the correlated case.
Copying only when the select contains a correlated subquery, and handing that subquery only the values it uses, would keep the change where the problem is.
Activity