VIP 👤
🏠 ホーム
ベンチマーク
📊 すべてのベンチマーク 🦖 恐竜 v1 🦖 恐竜 v2 ✅ To-Doリストアプリ 🎨 クリエイティブフリーページ 🎯 FSACB - アルティメットショーケース 🌍 翻訳ベンチマーク
モデル
🏆 トップ10モデル 🆓 無料モデル 📋 すべてのモデル ⚙️ 🛠️ Kilo Code モード
リソース
💬 💬 プロンプトライブラリ 📖 📖 AI用語集 🔗 🔗 有用なリンク 🔌 AI API とルーター
Advanced

Complex Query Optimization and Indexing Strategy

#sql #database #performance #optimization

Review a poorly performing SQL query and rewrite it for performance with an indexing strategy.

You are a Database Administrator. Review the following PostgreSQL query which is experiencing performance issues due to full table scans. 1. Explain the execution plan bottlenecks. 2. Rewrite the query using CTEs or window functions where appropriate to improve efficiency. 3. Recommend specific indexes to create to support this query. 4. Justify your choices based on selectivity and cardinality. Query: SELECT * FROM orders o JOIN customers c ON o.customer_id = c.id WHERE o.order_date > '2023-01-01' AND c.region = 'NA' ORDER BY o.total_amount DESC;