What's the general data pattern as far as average number of tags per document?
The reason I ask is that with regular indexes, the maintenance is
proportional to the number of documents being inserted/deleted.
However, with multikey indexes it is proportional to the number of
entries in the array of each document.
So if you are removing document:
{ _id:1, tags: [ "foo", "bar" ] } then two indexes need to be updated,
one entry in _id index and two entries in "tags" index.
If the document is
{ _id:1, tags: [ "foo1", "foo2", "foo3", ... ] } and there a few
hundred entries in the tags array, that's a few hundred entries that
need to be updated when this document is inserted, deleted (or updated
in a way that requires moving it).
This is bad for efficient performance - this is why we recommend that
you only index arrays whose size is naturally bounded (and to
something reasonable).
Asya
P.S. I wrote a little on the subject last year
http://askasya.com/post/largeembeddedarrays
>
https://groups.google.com/d/msgid/mongodb-user/0812ae37-6100-411a-9496-181edaa6094c%40googlegroups.com.