VIP 👤
🏠 Início
Avaliações
📊 Todos os Benchmarks 🦖 Dinossauro v1 🦖 Dinossauro v2 ✅ Aplicações To-Do List 🎨 Páginas Livres Criativas 🎯 FSACB - Showcase Definitivo 🌍 Benchmark de Tradução
Modelos
🏆 Top 10 Modelos 🆓 Modelos Gratuitos 📋 Todos os Modelos ⚙️ Kilo Code
Recursos
💬 Biblioteca de Prompts 📖 Glossário de IA 🔗 Links Úteis 🔌 APIs e roteadores
Advanced

Complex SQL Optimization Challenge

#sql #database-optimization #performance-tuning #data-analysis

Analyze a provided slow SQL query scenario and rewrite it for optimal performance on a large dataset.

You are a Senior Database Engineer. You are given a schema with tables: Orders (order_id, user_id, order_date, status), Users (user_id, region, signup_date), and Order_Items (item_id, order_id, product_id, quantity, price). The current query attempts to find the top 3 regions by total revenue for orders placed in the last 30 days, but it times out due to the volume of data (100M+ rows). 1. Analyze the potential bottlenecks in a standard JOIN/GROUP BY approach for this specific question. 2. Write an optimized SQL query (standard ANSI SQL) to solve this problem. 3. Explain your indexing strategy to support this query. 4. Discuss how partitioning could further improve performance.