Queries in the Stack Exchange Data Explorer are usually run over one database, i.e. a single Stack Exchange site. It is possible to do a multi-site query by fully qualifying tables (including the database name), and there are some tricks like building up a dynamic SQL string which fills a temporary table when executed. There are countless examples/templates, here is one of my latest versions which stands on the shoulders of several other giants.
This morning I was checking SEDE's source code and stumbled upon this:
private static QueryResults GetMultiSiteResults(ParsedQuery parsedQuery, User currentUser, AsyncQueryRunner.AsyncResult result = null)
{
var sites = Current.DB.Sites.All();
if (parsedQuery.TargetSites == TargetSites.AllNonMetaSites)
{
sites = sites.Where(s => !s.Url.Contains("meta.")).ToList();
}
else if (parsedQuery.TargetSites == TargetSites.AllMetaSites)
{
sites = sites.Where(s => s.Url.Contains("meta.")).ToList();
}
else if (parsedQuery.TargetSites == TargetSites.AllNonMetaSitesButSO)
{
sites = sites.Where(s => !s.Url.Contains("meta.") && !s.Url.Contains("stackoverflow.")).ToList();
}
else if (parsedQuery.TargetSites == TargetSites.AllMetaSitesButMSE)
{
sites = sites.Where(s => s.Url.Contains("meta.") && s.Url != "http://meta.stackexchange.com").ToList();
}
To my untrained eye, that seems like a built-in functionality for cross-site queries; it even seems to offer some kind of aggregation. It is possible to access this functionality, or is it a remnant of a long-lost feature?