3 EXTRACT(DAY FROM now() - content_updated
::date) AS days_ago
,
4 count(*) AS content_updates
5 FROM topic_content_history
7 (now() - content_updated
::date) < ($
(daysAgo
) * INTERVAL '1 day')
9 ($
(topicIds
) IS NULL OR topic_id
= ANY($
(topicIds
)::uuid[]))
10 GROUP BY content_updated
::date
11 ORDER BY content_updated
::date