optimizing-databricks-sqllisted
Install: claude install-skill AltimateAI/data-engineering-skills
# Databricks Optimize (DBSQL)
A Databricks/Delta-platform **overlay**, not a standalone optimizer. The
generic rewrite/analyze/verify pipeline (Steps 1, 5, 6) is the same
pipeline altimate-code's native `query-optimize` skill runs — same tool
calls, same composition. This skill's only job is the part `query-optimize`
structurally can't do: detecting Databricks/Delta platform-specific issues
(Z-ordering, table statistics, Photon UDF blocking) that need table
metadata and Databricks docs knowledge, not just query text, and folding
those findings in alongside the generic ones.
If `query-optimize` is installed in the current environment, prefer
invoking it for Steps 1/5/6 and layer Steps 2–4's Databricks-specific
findings on top of its output, the same way `sql-review` defers to
sibling skills instead of duplicating them. If it isn't available (e.g.
this skill is running standalone, outside altimate-code), fall back to
calling the same tools directly as described below — the tool calls are
identical either way, so behavior doesn't change based on which path ran.
No rewrite is reported as "optimized" until it clears the validation gate
in Step 7 — that gate is a hard requirement, not a suggestion.
## When to use this skill
**Use when:**
- The query is DBSQL (standalone or embedded in a notebook cell) and the
question involves Databricks/Delta-specific behavior: Z-ordering,
liquid clustering, table statistics, Photon, Unity Catalog, Predictive
Optimization.
**Do NOT use