I find it helps to visualise Splunk as a single giant database table with unlimited columns. So in fact your events are already "joined" and all you need to do is group statistics together in a meaningful way.
Assuming each mID,jID pair is unique, you can group all you fields together like so
index=performance (source=subtask OR source=maintask ) | stats values(*) AS * by mID,jID
This should give you a table of all the fields that belong to each mID jID pair. The fields will be multivalued, so you may need to split them with mvexpand
There is a great flowchart on when you use each aggregation command here: http://docs.splunk.com/Documentation/Splunk/6.3.2/Search/Abouteventcorrelation
See Stats: http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Stats
See Mvexpand: http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand
... View more