advanced
Query Performance Tuning
Analyze and optimize complex SQL queries for large datasets.
📝 Prompt Inhoud
Analyze this complex SQL query involving multiple subqueries, CTEs, and window functions that is currently timing out on a PostgreSQL database with 100 million rows. Rewrite the query to improve execution efficiency by suggesting appropriate indexing strategies, query restructuring, and potential join algorithm hints.