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

Speed up PhysicalTopN#containVirtualColumn #46809

Closed
tedyu opened this issue Sep 9, 2023 · 1 comment · Fixed by #46812
Closed

Speed up PhysicalTopN#containVirtualColumn #46809

tedyu opened this issue Sep 9, 2023 · 1 comment · Fixed by #46812
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@tedyu
Copy link
Contributor

tedyu commented Sep 9, 2023

Enhancement

Currently PhysicalTopN#containVirtualColumn performs nested loop matching given columns with those of ByItems.

We can establish map[int64]*expression.Column at the beginning of the method keyed by column Ids of tCols.

This way, the loop over p.ByItems can utilize the map to perform O(1) lookup.

@tedyu tedyu added the type/enhancement The issue or PR belongs to an enhancement. label Sep 9, 2023
@hawkingrei hawkingrei self-assigned this Sep 9, 2023
@hawkingrei
Copy link
Member

Good Catch! Have you interest to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants