/fabric-dw:query-optimizerfrom Fabric DW Agent Skills
Analyzes and optimizes slow queries on a Fabric Data Warehouse by capturing execution plans, inspecting statistics, and suggesting clustering improvements.
Ships in Fabric DW Agent Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyzes and optimizes a query on a Fabric Data Warehouse using the fabric-dw MCP tools.
Gather these from the user (via $ARGUMENTS or natural language) before starting:
If the warehouse is a SQL Analytics Endpoint, skip steps 8, 9, 11 (clustering), and 13 (set_cluster_columns).
Call get_query_plan with the query text. This returns a SHOWPLAN_XML document without executing the query.
To visualize the plan, use the CLI (pass the warehouse name as the first argument and the query via -q):
fdw sql plan <warehouse> -q "<query>" --format html -o plan.html # writes self-contained HTML; open plan.html in any browser
fdw sql plan <workspace>/<warehouse> -q "<query>" --format svg -o plan.svg # renders SVG via system dot binary (requires Graphviz)
Note: --format html requires -o/--output; it writes a file and does not open the browser automatically.
Analyze the returned SHOWPLAN_XML for:
CONVERT_IMPLICIT on a column used in a predicateUse list_request_history (filter by SQL text substring if supported) and list_long_running_queries to see whether this query pattern has a history of slow executions. Note elapsed time and status.
For every table referenced in the query, call list_statistics to enumerate existing statistics objects. Note which columns lack statistics.
For any statistic that appears potentially stale or absent, call show_statistics to examine its header (last_updated timestamp, row count, rows sampled) and histogram. Flag statistics whose sample rate or update date suggests staleness. This is heuristic; flag rather than assert.
For each table referenced in the query, call get_table_columns to retrieve: column name, formatted data type (e.g. VARCHAR(50), DECIMAL(18,2)), nullable flag, identity flag, computed flag.
Use column types and nullable flags to identify:
Call get_cluster_columns for each table (skip for SQL Analytics Endpoints). Returns the ordered list of CLUSTER BY columns, or an empty list if no clustering is defined.
Compare current clustering columns (and their data types from step 6) against the WHERE predicates, JOIN keys, and aggregation patterns in the query plan. A good clustering candidate:
Note whether a table lacks clustering entirely but would benefit from it.
Summarize all findings in a structured report:
For each finding, propose a concrete action:
Before calling any statistics tool, ask the user explicitly: "Should I apply the statistics changes now?" The MCP server enforces its own write-guard (controlled by
FABRIC_MCP_ALLOW_WRITES/FABRIC_MCP_ALLOW_DESTRUCTIVEserver config), but it does not pop a user dialog. The agent must ask before proceeding.
If the user confirms, apply statistics changes using create_statistics (for absent stats) or update_statistics (for stale stats). For large tables, prefer update_statistics with a SAMPLE percentage rather than FULLSCAN to limit execution time.
Before calling
set_cluster_columns, ask the user explicitly and surface the following: "set_cluster_columnsperforms a full transactional CTAS-swap, a complete physical copy of the table. This may take significant time on large tables, the table will be briefly unavailable during the swap, and dependent views or stored procedures may need refreshing afterwards. Should I proceed?" Only call the tool after the user explicitly acknowledges and approves.
If the user confirms and acknowledges, call set_cluster_columns with the recommended clustering columns.
get_query_plan obtains the plan without executionWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sdebruyn/fabric-dw-mcp-cli --plugin fabric-dw3 skills in this plugin
/dbt-setupScaffolds a complete dbt-fabric project for a Fabric Data Warehouse: generates profiles.yml, dbt_project.yml, a column-rich _sources.yml (with data types for every table column, ready for dbt contracts), requirements.txt, and .gitignore, then writes them to the local filesystem. Use when the user asks to "set up dbt", "scaffold a dbt project", "create dbt profile", "initialize dbt for my warehouse", "generate dbt sources", or "bootstrap dbt-fabric".
/warehouse-performanceInvestigates the performance of an ENTIRE Fabric Data Warehouse (warehouse-wide, not a single query): surfaces long-running and frequent queries, reads SQL pool resource-pressure insights, audits statistics health, checks result-set caching, reviews and tunes SQL pool configuration, and produces a prioritized findings + recommendations report. Use when the user asks to "investigate warehouse performance", "why is my warehouse slow", "tune sql pools", "find expensive queries", "find the most frequent queries", "check sql pool pressure", or "enable result set caching". For diagnosing or rewriting ONE specific query (execution plan, missing statistics on its tables, clustering), use /query-optimizer instead.
Other plugins' skills for the same job