First of all, it *is* possible to index dynamic (large number of)
attributes not known up-front - you can store them as key-value pairs
in an array and index key,value pairs so that whichever attribute you
searched for it would be indexed.
But secondly, you should consider what queries require very fast real
time responses. Any that do are candidates for preaggregation (i.e.
incrementing some counters as the new records come in).
Second possible approach - depending on the range of time you are
dealing with in "timestamp" would be aggregating things into buckets.
For example, at the end of each day, calculate sums of various
combinations of attributes that you expect queries on into a daily
summary collection. You can then do sums across days instead of
across raw data and have it be significantly faster.
It really depends on what queries you expect to have to satisfy and how fast.
Asya
>
https://groups.google.com/d/msgid/mongodb-user/b20c30ab-fb15-49a5-a482-acca1f291744%40googlegroups.com.