Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree-sitter: Emit empty_location relation to avoid scan #16597

Merged
merged 2 commits into from
May 27, 2024

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented May 27, 2024

Makes a difference on really large DBs, where scanning the full locations_default relation can be expensive:

[2024-05-24 08:14:11] Evaluated non-recursive predicate locations_default_234501#join_rhs@25a852j3 in 1551288ms (size: 1803722310).
Evaluated relational algebra for predicate locations_default_234501#join_rhs@25a852j3 with tuple counts:
        1803722310  ~0%    {6} r1 = SCAN locations_default OUTPUT In.2, In.3, In.4, In.5, In.0, In.1
                           return r1

@hvitved hvitved force-pushed the tree-sitter/empty-location branch 3 times, most recently from 798c99e to f5c3604 Compare May 27, 2024 08:08
@hvitved hvitved force-pushed the tree-sitter/empty-location branch from f5c3604 to 686879a Compare May 27, 2024 08:39
@hvitved hvitved added the no-change-note-required This PR does not need a change note label May 27, 2024
@hvitved hvitved marked this pull request as ready for review May 27, 2024 09:30
@hvitved hvitved requested review from a team as code owners May 27, 2024 09:30
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Looks good to me, although it feels a little strange that this would be needed. Wasn't there a way to improve this at the QL level?

@hvitved
Copy link
Contributor Author

hvitved commented May 27, 2024

Wasn't there a way to improve this at the QL level?

I don't think there is, as any join on the empty file, needed to get to the empty location, would have to reorder the columns of locations_default.

@hvitved hvitved merged commit 69fb2bb into github:main May 27, 2024
52 checks passed
@hvitved hvitved deleted the tree-sitter/empty-location branch May 27, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note QL-for-QL Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants