At first sight, I would say that you have too many sub searches, no proper grouping, so the same data has to be processed 4 times....
if the goals is to find the absence of groups, you need an static external list to compare.
PS : I did not understood the link between source and groupid, so you may have to do your own sauce.
add your source in all your stats.
replace all your join subsearches for the source by a simple static csv table or a lookup . (read the documentation for details)
with a line per groupid/source combo:
example :
source, GroupId, present
sourceA, group1,"yes"
sourceB, group2,"yes"
...
replace by an outer join | join mode=outer groupid source [ | inputcsv groupcsv ] | fillnull value="no" present
at the end the columns present should tell you if your data matched the list , and if an item of the list didn't match your data.
... View more