Use 'source' field in SQL queries instead of serialized 'timeline_group' => ['by' => '...', 'field' => 'owner_id'] in PHP. Update code with "TODO: Should be updated when GROUP BY `source` will be used in sub selects."