I have some c# code that currently uses SubscribeToAllFrom to set up my projections for my read model
in the eventAppeared Handler I then filter those events to a subset of all the events in the system.
now that we have upgraded to eventstore v4 I am reviewing the projections to see if I can speed up this code, profiling shows that it spends a lot of time during a rebuild dealing with “uninteresting events”
It feels like if I create a projection like this for each of my c# projections and then have the projection subscribe to the output stream then I should get some major speed improvements
fromAll().when( {
‘EventType1’ : function(s,e) {linkTo(“ProjectionIndexStream-ProjectionType”, e)},
‘EventType5’ : function(s,e) {linkTo(“ProjectionIndexStream-ProjectionType”, e)},
‘EventType7’ : function(s,e) {linkTo(“ProjectionIndexStream-ProjectionType”, e)},
‘EventType8’ : function(s,e) {linkTo(“ProjectionIndexStream-ProjectionType”, e)},
‘EventType9’ : function(s,e) {linkTo(“ProjectionIndexStream-ProjectionType”, e)},
‘EventType12’ : function(s,e) {linkTo(“ProjectionIndexStream-ProjectionType”, e)}
})
is this the best way to write this projection or is there a better way?
Secondly: when I change my code - and need a new event type and want to rerun the c# projection - should I edit the projection or delete it and recreate it? should I version my output stream name or delete it and keep using it?
Thanks
R.