Databases will be dynamiclly Cruded(create.Retrieve.update.delete)
So do Fields for each database.
To avoid map syn and lock, l'd rather use hash.
By saying" add a small overhead ...", does it mean a random slot
number only affect the size of each doc ,without other side effects?
????????
Olly Betts <olly at survex.com>???
>On Sun, Mar 29, 2015 at 07:07:25PM +0800, ??? wrote:
>> now I am trying to index docs in json format, and came to a question
>> about prefix mapping:
>> a json doc like:???
{"starttime":1111,"endtime":2222}
>> considerring mapping prefix to slot number in two ways:
>> 1.starttime-->0,endtime--->1
>> 2.startime--->hash(starttime), endtime--->hash(endtime), while
>> hash(key) is a random int, which may be very sparse but unique, for
>> example, using BKDR hash.
>>
>> after simple test, both ways seemed to work well. can I use the second
>> way(do not have to maintain a mapping), is there performance issues?
>
>It'll add a small overhead to anywhere that has to store the value slot
>number.? Also, you have to worry what to do if two fieldnames hash to
>the same value...
>
>If you can't have a static mapping, I'd just store the mapping in
the
>user metadata, then it's there with the database, and any changes are
>committed in sync with corresponding changes to the database.
>
>Cheers,
>??? Olly