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

Setting key to an existing index can skip forder step #2889

Closed
MichaelChirico opened this issue May 18, 2018 · 0 comments · Fixed by #3582
Closed

Setting key to an existing index can skip forder step #2889

MichaelChirico opened this issue May 18, 2018 · 0 comments · Fixed by #3582
Milestone

Comments

@MichaelChirico
Copy link
Member

Consider

DT = data.table(
  ID1 = rep(10:1, 10:1),
  ID2 = rep(1:10, 1:10)
)
setindex(DT, ID1, verbose = TRUE)
# forder took 0 sec
setkey(DT, ID1, verbose = TRUE)
# forder took 0 sec
# reorder took 0 sec

I believe the second forder is superfluous -- only the physical reordering is necessary in the setkey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants