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

Join only construct joined columns that is needed by its parent operator #8296

Closed
windtalker opened this issue Nov 2, 2023 · 0 comments · Fixed by #8366
Closed

Join only construct joined columns that is needed by its parent operator #8296

windtalker opened this issue Nov 2, 2023 · 0 comments · Fixed by #8366
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@windtalker
Copy link
Contributor

Enhancement

In TiFlash, the output schema of join is [left_columns, right_columns], for example

select a.id from a join b on a.id = b.id and a.id1 = b.id1 and a.id2 = b.id2 and a.id3 = b.id3

The output schema of join is [a.id, a.id1, a.id2, a.id3, b.id, b.id1, b.id2, b.id3]

However, only a.id is actually needed. And inside join, the cost of combine the left columns with the right columns is actually very high: for left columns, it need to call replicateRange, and for right columns, it need to be added row by row using AddFound, if we can only return the column used by the parent operators, it will avoid some meaningless cost and increase the performance of join.

@windtalker windtalker added the type/enhancement The issue or PR belongs to an enhancement. label Nov 2, 2023
@windtalker windtalker changed the title Join only construct joined rows that is needed by its parent operator Join only construct joined columns that is needed by its parent operator Nov 2, 2023
ti-chi-bot bot pushed a commit that referenced this issue Dec 28, 2023
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.

1 participant