ac9fcd8d30
- Use UNION ALL + count(distinct) for recursive CTE (faster, cycle-safe) - Derive total_earnings from personal_revenue dict (remove redundant query) - Merge duplicate campaign registration queries into single query - Add MAX_REFERRAL_DEPTH constant, _format_datetime type hint