AxonFramework/AxonFramework — pull request #73 by andyduncan192 (2012-10-11 08:37:09+00:00)
Title: Better index use in MongoSagaRepository

Hi.

I was having a problem with slow-down when using the MongoSagaRepository which I tracked down to the find by association value query.

In the way it was written, MongoDB couldn't make use of an index on the association value key and value since they are parallel properties. I've altered the structure of the query to be of the form ```{sagaType : "type", associations : { key : "key", value : "value" } }``` so an index of the form ```{ sagaType:1, associations:1}``` can be used.

In my application I then ensure that index in my MongoTemplate implementation.

Thanks,

Andy Duncan