In this task, I will provide a set of queries to identify some of the "worst case scenario" examples for the queries introduced in the parent task, so that our DBA team can estimate the performance of the query in those extreme cases. Hopefully, the outcome of this task is either that the queries run efficiently enough already, or a specific recommendation for a new index is made.
Some of the new queries use GROUP BY cuc_agent or have a WHERE clause that uses cuc_agent. This further signifies the need for T147894: Create index for cu_agents in cu_changes table to be addressed. As in, if the queries below show that an index is not needed, then we can possible close T147894 too (note that the patch associated with that task has already been turned down).