Skip to content

feat(dsql): enhance query plan explainability with type coercion detection and rewrite references#161

Closed
Morlej wants to merge 1 commit into
awslabs:mainfrom
Morlej:feat/dsql-query-plan-explainability
Closed

feat(dsql): enhance query plan explainability with type coercion detection and rewrite references#161
Morlej wants to merge 1 commit into
awslabs:mainfrom
Morlej:feat/dsql-query-plan-explainability

Conversation

@Morlej
Copy link
Copy Markdown

@Morlej Morlej commented May 8, 2026

Summary

  • Add structured trigger phrases and routing criteria to SKILL.md for query plan diagnosis workflow
  • Add type coercion index bypass detection with implicit cast compatibility matrix to plan-interpretation.md
  • Extend catalog-queries.md with indexed column type retrieval queries
  • Add query-rewrites-generic.md with 11 general SQL rewrite patterns (OR-to-IN, LEFT-to-INNER JOIN, subquery unnesting variants, predicate pushdown, GROUP BY into subquery, etc.)
  • Add query-rewrites-dsql-specific.md with 2 DSQL-specific rewrites (reltuples estimate, split large joins for DP threshold)

Test plan

  • Verify skill triggers activate on relevant phrases (e.g., "why is my DSQL query slow", "explain this plan")
  • Verify type coercion detection identifies cases where type mismatches bypass indexes
  • Confirm rewrite recommendations are surfaced during query plan diagnosis when applicable patterns are detected

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

🤖 Generated with Claude Code

…ction and rewrite references

- Add structured trigger phrases and routing criteria for query plan diagnosis
- Add type coercion index bypass detection (implicit cast compatibility matrix)
- Extend catalog queries with indexed column type retrieval
- Add generic SQL rewrite reference (11 patterns: OR-to-IN, subquery unnesting, etc.)
- Add DSQL-specific rewrite reference (reltuples estimate, split large joins for DP threshold)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Morlej Morlej requested review from a team as code owners May 8, 2026 20:53
@Morlej Morlej closed this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant