Trends aggregate per bucket and in total with grouping sets and take the
breakdown's top values from a first small query. Funnels drop attempts that
a later attempt always beats (same counts, ties go to the latest attempt),
so a 3-step funnel joins about 17 000 entries instead of 340 000.
Retention aggregates returns once. A covering index (event, timestamp)
include (person_id) lets person-level insights skip the table; insight
transactions use work_mem 32MB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>