Large Number of Items In A MultiMap Index

13 views
Skip to first unread message

Phil

unread,
Feb 22, 2012, 3:18:02 PM2/22/12
to rav...@googlegroups.com
I have a large number of objects (over 20) that need to be searched within a single index.  I was looking at using a multi map index but wanted to know if there is a max number where this approach is not the best choice.  We are currently using a convention which stores all of these object types as the base type.  

Do we gain anything from using the multi map method?

Matt Warren

unread,
Feb 22, 2012, 4:43:59 PM2/22/12
to rav...@googlegroups.com
If you have something working with a base type, then I'd stick with that.

The main appeal of Multi-Map is that it's easy to write an index that works across types that have some/all fields in common. However writing an index with 20 Multi-Map clauses is more code to maintain, especially compared to what you already have.

I don't think they'll be much of a perf difference, the index will be run over all the docs in the doc store, so any difference in the time per/doc will be small compared to all the I/O etc

Oren Eini (Ayende Rahien)

unread,
Feb 22, 2012, 11:13:10 PM2/22/12
to rav...@googlegroups.com
Use the base class to generate just a single map statement.
In terms of perf, there is some minute perf cost to having multiple map statements, but not much.

I am thinking about having to generate so many maps in your code.

If you can, make them all use the same Entity Name, in which case the DB will threat them as a single item.

If not, just stick something in the metadata for them and then do something like:

"from foo in docs
where foo["@metadata"]["base-class-tag"] == "MyBaseClass"
select new 
{
Reply all
Reply to author
Forward
0 new messages