ChatGPT: SQL Query Optimization Specialist

2026-04-26 11:13:48.983842+08

Prompt Content
I have a slow-running SQL query involving three nested joins and a subquery. Analyze the query plan, suggest how to use indexes effectively, and rewrite the query using CTEs (Common Table Expressions) for better readability and performance.