: <http://e-mats.org/2011/01/solr-memory-usage-and-dynamic-fields/ >  
: 
: Just to confirm, the fieldCache doesn't store anything extra when we use
: dynamic fields and do sorting query on that...right?

the way the FieldCache works, is that it has to "cache" a value for every 
document -- even if that document doesn't have a value in the indexed 
field that FieldCache was built from.

so if you have an index of 10K docs, and only 17 of those docs have a 
value in some field "my_really_sparse_int_field" then if you do a search 
and sort on "my_really_sparse_int_field" you're going to get a a 
FieldCache containing an array of 10K ints -- and all but 17 of them will 
be "0".

if you sort on 199 other fields like those, you're going to have 199 other 
arrays of 10K ints.


Instead of relying on the FieldCache, you should consider using DocValues, 
which -- unless i'm forgetting something -- should give you a lot better 
memory efficiencies if you have a lot of dynamicFields that are really 
sparse and you want to sort on them (at the expense of more disk space 
being used in your index).  But i haven't done extensive memory testng of 
this to prove it to myself.


-Hoss
http://www.lucidworks.com/

Reply via email to