-
Notifications
You must be signed in to change notification settings - Fork 91
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
multi_get and duplicate keys #82
Comments
Hi, the document says for that function: |
BTW what you mentioned NOTICE is right, you put your keys in a list, then the function will get from the database every item what is on the list, after that they will put into a dict and overwrites it when there are duplicates. If you request one single key 1M times, it will be read from the database 1M times and you got only a dict with one key. |
Yes, I understand that the database is queried twice when the list of keys contains the twice the same key. However, given that python dict's cannot store duplicated keys and the documentation states: Duplicate keys will return duplicate values in order.
since this seems to be the pythonic way of storing duplicated entries in a |
The doc for
multi_get
mentions that:keys will not be “de-duplicated”. Duplicate keys will return duplicate values in order.
https://python-rocksdb.readthedocs.io/en/latest/api/database.html
But when I use it with duplicated keys I get a dictionary with a single key whose value is not a list with the repeated values:
Example:
outputs:
The text was updated successfully, but these errors were encountered: