Skip to content

PERF: pass how=left to _factorize_keys in _left_join_on_index (#65160)#65199

Open
iabhi4 wants to merge 1 commit intopandas-dev:mainfrom
iabhi4:fix/65160
Open

PERF: pass how=left to _factorize_keys in _left_join_on_index (#65160)#65199
iabhi4 wants to merge 1 commit intopandas-dev:mainfrom
iabhi4:fix/65160

Conversation

@iabhi4
Copy link
Copy Markdown
Contributor

@iabhi4 iabhi4 commented Apr 13, 2026

Pass how="left" to _factorize_keys in _left_join_on_index, enabling the hash join fast path (using table.lookup) for left joins on a right index with unique numeric keys and sort=False.

Investigated all 6 _factorize_keys call sites. The remaining 4 (get_join_indexers multi-key, _get_multiindex_indexer, asof "by" keys, _get_join_keys) use return values as labels for further key combination and cannot use the hash join shortcut, which changes return semantics to join indexers with count=-1.

Copy link
Copy Markdown
Member

@rhshadrach rhshadrach 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, just one nit.

@iabhi4
Copy link
Copy Markdown
Contributor Author

iabhi4 commented Apr 15, 2026

Looks good, just one nit.

Thx for the review @rhshadrach , Appreciate it!

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.

PERF: Specify how when calling merge._factorize_keys when possible

2 participants