// Returns true if we can aggregate the data locally per shard, // i.e. the group by interval lines up with the shard duration and // there are no joins or merges func (self *ShardData) ShouldAggregateLocally(querySpec *parser.QuerySpec) bool { f := querySpec.GetFromClause() if f != nil && (f.Type == parser.FromClauseInnerJoin || f.Type == parser.FromClauseMerge) { return false } groupByInterval := querySpec.GetGroupByInterval() if groupByInterval == nil { if querySpec.HasAggregates() { return false } return true } return (self.shardDuration%*groupByInterval == 0) && !querySpec.GroupByIrregularInterval }