-
Notifications
You must be signed in to change notification settings - Fork 992
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
[Request] assigning with := should retain keys better #2372
Comments
I am working on a solution. Just need to memCheck for memory leaks before creating a pull request |
I have discovered a minor fault in my implementation: I am assuming that secondary indices behave exactly like the key.
If there is a key on columns x and y, it is a fully valid key on x as well. If there is an index on columns x and y, it is also a fully valid index on x, but it may cause spurious reordering in y if used as an index for x. The only secondary index that is fully equivalent to a key is a Therefore, I need to change my implementation as follows:
I will fix asap and create a PR. |
Currently, keys and secondary indices are dropped, if any of the key columns is altered via a
:=
assignment.This is not necessary, however, since the key is still valid for all key columns before the assigned one.
Given this, we can better retain keys and secondary indices and improve data.table performance.
An example:
The text was updated successfully, but these errors were encountered: