Databricks sql performance

From VincentChuWaiChow/vanguard-frontier-agentic · View interactive version

Databricks sql performance is an AI agent skill from the GitHub repository VincentChuWaiChow/vanguard-frontier-agentic. Use this skill to statically review SQL warehouse and query performance: warehouse type and sizing for concurrency, Photon and Predictive I/O applicability, three-tier caching semantics and when a cached result is misleading, query-profile reading for skew and spill, data layout via liquid clusterin

How to use this skill

Skill file

databricks-sql-performance

Purpose

This skill decides whether a SQL query's performance is bounded by warehouse sizing, caching semantics, data layout, query-execution patterns, or architectural limits. A query is optimizable only when the performance bottleneck is identified via query profile (skew, spill, shuffle), data layout is correctly sized for the access pattern, and the warehouse tier and concurrency model match the workload. Anything requiring a warehouse resize or schema rewrite is T2 and requires human approval.

When to use

When NOT to use

Scope

Decision workflow

  1. Establish the warehouse type (serverless, pro, classic) and current configuration — refuse-and-ask if missing.
  2. Collect a query profile (wall-clock, task times, memory, spill, shuffle, task-duration percentiles) or flag if unavailable.
  3. Analyse task-duration skew: maximum > 75th percentile + 50% indicates data skew — identify the skewed stage and join or grouping operation.
  4. Check data layout: is the table liquid-clustered on the filter/join columns, or is Z-ORDER or partitioning in use? Recommend liquid clustering for all new tables.
  5. Verify data-skipping: first 32 columns are indexed by default; flag filter columns beyond position 32 or low-selectivity columns in the index.
  6. Review cache status: UI cache (7-day), remote result cache (24-hour, schema-invalidated), local disk cache (per-node, invalidates on file change). Flag stale results.
  7. Confirm warehouse type supports the optimization (Photon all types; Predictive I/O serverless/pro only; IWM serverless only).

Lean operating rules

Evidence requirements

No recommendation is issued before the evidence below exists. When it is missing, name the smallest artifact that would supply it and stop.

Context7 MCP policy

Context7 supplies current, version-specific library and SDK documentation. It does not establish Databricks service behaviour — Databricks' own documentation does. Use it exactly when:

If Context7 is not exposed in the session, say so and label every version-sensitive claim unknown rather than answering from memory. Never state that Context7 was consulted when it was not, and never assume an MCP server or tool name.

Official documentation policy

Databricks service semantics come from current Databricks documentation, not from memory, blog posts, conference talks, or release-note summaries. Where the behaviour differs by cloud (AWS / Azure / GCP), name the cloud the claim applies to. Where a feature is Public Preview or Beta, say so on first mention and never describe it as a production default. Anything that cannot be grounded stays out of the answer and is reported as an open question.

Security boundaries

Runtime authority

T0 (static review only). Reads warehouse configuration, schema, query text, query profiles, query history, and ANALYZE output; never executes any query and never recommends a live mutation. A performance recommendation implies a warehouse resize, auto-scaling rule, or schema change; those are T2 decisions requiring explicit human approval and a rollback owner.

Authority tiers used across this board: T0 static review (read artifacts only); T1 read-only runtime (allowlisted read-only queries against a workspace, no writes); T2 sandbox-mutating (dry-run or non-production only); T3 mutating-runtime (changes production state — human-approved live guards only). This skill never raises its own tier, and never hands a task to a higher tier without an explicit named human owner.

Production caveats

References

Progressive disclosure — load only the one the task needs:

Response minimum

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.