nickva commented on issue #5500:
URL: https://github.com/apache/couchdb/issues/5500#issuecomment-2781010739

   Like @big-r81  mentioned in a map-reduce indexes we index `key` : `value` 
pairs. Those are generated using the `emit(MyKey, MyValue)` calls from the map 
functions. The index structure is something like:
   
   ```
   Key1 -> Value1
   Key2 -> Value2
   ....
   ```
   
   The index is implemented using b-trees underneath. We can efficiently look 
up value using key or key prefixes, like in any b-tree.
   
   > So that is what's in RAM, the rest is just "passed by". Right?
   
   Nothing needs to be in RAM. If you provide a key or a range of keys (or key 
prefixes) only the index btree nodes containing those keys will be loaded from 
disk. If you have plenty of RAM your OS page cache may cache a subset of blocks 
returned by the view.
   
   > Even without a precise query (so the index ist not important, I think). 
Would there be a way to optimise that except slice more the documents?
   
   You can use smaller, less complex (shorter) keys and emit just the values 
you need from the document. Say if you don't need the whole 30Mb document but 
just one field then emit that as the value.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to