Use the prompt
Share the query plan, table definitions, and database version. Data size and distribution matter when deciding whether an index or rewrite will improve the query.
Optimize slow queries with index suggestions and query rewrites. Improve database performance.
For GitLab Duo
Optimize this slow query:
[PASTE SQL QUERY]
Execution plan:
[PASTE EXPLAIN OUTPUT]
Optimize for:
1. Query speed
2. Index usage
3. Join efficiency
4. Maintainability
5. Provide explain planShare the query plan, table definitions, and database version. Data size and distribution matter when deciding whether an index or rewrite will improve the query.