I am working on a design where secondary data indexes will be built with all the information in a key that does not need any side of value. Could this cause problems?
I am not asking how technically possible it is to have an empty meaning. Are there structural consequences , for example: adding sorted keys can lead to an imbalance of some tree structures? (I'm not saying leveldb uses trees, just trying to come up with an analogy ;-))
that is: let's say that the "primary record" looks like (zeros as delimiters)
- key = uniqueTableID \ 0 uniqueRowID
- value = some collection of fields
the secondary index for a typical single-valued field will look like this:
- key = uniqueFieldID \ 0 keyValue \ 0 uniqueRowID
which allows you to iterate using the partial key [uniqueFieldID \ 0 keyValue], and also allows you to easily find these keys and delete them if the master record is deleted or the key value changes, returning from the uniqueRowID master record. Thus, there can be several key values ending with the same unique RowID, but there can only be one key for a particular combination starting with uniqueFieldID and ending with a unique RowID
The only thing I do not need to put the value in the direction of the value of the pair.
, , - . , leveldb, .
, .
, , :
- key = uniqueFieldID\0 keyValue\0 GUID
- value = , , ,