Skip to content

improve performance of the main-table path check during feature decoding#557

Open
cportele wants to merge 1 commit into
masterfrom
nesting-tracker-mainpaths-set
Open

improve performance of the main-table path check during feature decoding#557
cportele wants to merge 1 commit into
masterfrom
nesting-tracker-mainpaths-set

Conversation

@cportele

Copy link
Copy Markdown
Contributor

NestingTracker.isNotMain() is called for every value row while decoding and did a List<List<String>>.contains(path), i.e. a linear scan with element-wise list equality. Make the main-table paths a Set so the membership test is O(1), and build it as a Set at the source in FeatureDecoderSql (the only caller). The main table path repeats once per sub-query, so the Set also drops the many duplicates the List carried. Membership semantics are unchanged, so the decoded output is identical.

NestingTracker.isNotMain() is called for every value row while decoding and did
a List<List<String>>.contains(path), i.e. a linear scan with element-wise list
equality. Make the main-table paths a Set so the membership test is O(1), and
build it as a Set at the source in FeatureDecoderSql (the only caller). The main
table path repeats once per sub-query, so the Set also drops the many duplicates
the List carried. Membership semantics are unchanged, so the decoded output is
identical.
@cportele cportele requested a review from azahnen as a code owner June 29, 2026 11:11
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