-
Notifications
You must be signed in to change notification settings - Fork 61
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
btree_index
in existing database
#129
Comments
The db should not open because this is not a supported change (if you look in 'metadata' file in the db repo, all config written should be check on start and an error raised if one of these config is different). Changing it is not really doable because when |
Note that with |
Probably changing a bit Line 62 in 3e988a7
(but only when uniform = true and the hash function output is 32bytes)
|
Thank you @cheme. For an existing db that was created with the default Also
If that's the case shouldn't |
|
I see thank you. Just to clarify then, if I configured a db with default column options, I understand is not possible to iterate over the keys of a column using the public api? |
Yes you can't. |
Another question, when you mentioned |
Write and read. |
From a user prespective, I think having the possibility of iterating the keys of a column is a must for most data migrations and it would be a neat addition to the existing api. You mentioned the case of
Could you elaborate a bit more on iteration need to be part of a migration? If I understood correctly only btree indexed column can provide an iterator. |
yes I hear this a bit (really should have trace the past conversation where the question arise), I also understand that it may be a bit awkward to not be able to retrieve the original keys.
Current migration iteration only look at the files and skip all intermediate in memory changes (commit overlay and maybe log overlay), so it requires to flush everything first (and complete running reindexing).
So that's why we currently only have it for migration. |
As @cheme explained, migration from hash index to btree is not possible in general. Hash tables don't even store original keys, only their hashes. You'd need to perform the migration on the higher level. E.g. if your keys are block hashes you can enumerate them pu following parent hashes and reinsert into a new database. |
If I change the configuration for a column from default (
btree_index = false
) tobtree_index = true
and the db already existed, will it automatically index that column when Iopen
the db?The text was updated successfully, but these errors were encountered: