AI SQL Tuner Studio User Guide

Last updated: 2026-11-07

Version: 3.5.2.0

This AI SQL Tuner Studio user guide walks you through everything from installation to your first report: system requirements, connecting to SQL Server and Azure SQL, activating your license, running all six tuning goals, choosing a model and reasoning level, reading and exporting reports, and fixing common errors.

New to AI SQL Tuner Studio? Get it from the Microsoft Store or download the Free edition, compare editions, or watch the 2-minute tour first.


Table of Contents

  1. Getting Started
  2. Connections
  3. Models, Reasoning Effort and Privacy
  4. Tuning Goals
  5. License Configuration
  6. AI Configuration
  7. Running an Analysis
  8. Viewing Results
  9. Saving and Exporting
  10. Status Bar
  11. Troubleshooting
  12. Menu Reference
  13. Keyboard Shortcuts
  14. Data Privacy
  15. AI SQL Tuner Studio User Guide FAQ
  16. Support

Getting Started

System Requirements

  • Windows 10 version 1809 or later / Windows 11, on an x64 or ARM64 PC. The installer contains both, and Windows installs the one that matches your PC, so ARM64 PCs run the app natively rather than under x64 emulation.
  • .NET 10.0 Runtime (included with the app)
  • Internet connection (for license activation and tuning requests)
  • SQL Server 2016 or later (on-premises, Azure SQL Database, Azure SQL Managed Instance, Microsoft Fabric SQL Database, or Amazon RDS for SQL Server Standard, Enterprise or Developer edition)
  • A SQL login with read-only diagnostic permissions. The least-privileged account guide sets one up in three steps.

Installing

You can install AI SQL Tuner Studio from either of two places. Install from one of them, not both.

Microsoft Store Download from aisqltuner.com
How to install Open the AI SQL Tuner Studio Microsoft Store listing and select Get or Install Download the AISQLTunerStudio_<version>_x64_ARM64.msixbundle from the download page and double-click it
Prerequisites Installed by the Store Windows App Runtime 1.8 and VCLibs must be installed. If Windows reports a missing framework, see Windows Server 2022 install error. On Windows Server, Install-AISQLTuner.ps1 from the release installs them and then the app
Updates Through the Store; Help → Check for Updates asks the Store Help → Check for Updates compares your version with the latest release
License Activates from the Store account signed in on the PC; a license key entered in the app takes priority. See If You Bought Through the Microsoft Store A license key; see If You Bought a License Key Directly
Windows Server Not available: Windows Server does not include the Microsoft Store Supported

The two are separate apps to Windows. Installing one does not update or replace the other, so if you switch, uninstall the one you no longer use.

First Launch

  1. Launch AI SQL Tuner Studio from the Start menu or desktop shortcut.
  2. The main window displays:
    • Left panel: Configuration sections — Connections, Edition & Licensing, and AI Configuration
    • Right panel: Tuning Setup drawer (goal cards, options, model/reasoning/run controls — collapses automatically when a run starts), the HTML report preview, and the Console drawer
    • Footer status bar: Persistent bar at the bottom showing connection, license edition, primary model, run state, and session run count
  3. The first time you start the app, a four-step Guided Tour opens: create a connection, test it, pick a goal, and run your first report. Skip Tour closes it, and it does not open by itself again. Reopen it any time with Help → Guided Tour… (Ctrl+Shift+G).

The report area initially shows an illustrated empty state with the heading “No report yet” and hints about available tuning goals. Once you run your first analysis, the empty state is replaced with the generated report.

The app follows the active Windows light/dark theme. The left navigation panel, top header/menu, footer status bar, HTML output toolbar, console drawer, section headers, connection list, and action buttons automatically adjust their contrast for readability in dark mode. Left-panel section headers and saved connection names use stronger contrast to remain readable in dark theme environments, and dark mode uses deeper surfaces with clearer panel separation so cards, lists, and controls remain easy to distinguish. Manual theme changes via View → Theme apply instantly across the entire window, including the in-app HTML report preview.

You can override the system theme via View → Theme:

Option Behaviour
Follow System Matches the Windows dark/light setting (default)
Light Forces the light (Paper/Teal) palette regardless of the OS setting
Dark Forces the dark (Graphite/Mint) palette regardless of the OS setting

Your choice is remembered between sessions. The active option is shown with a ✓ check-mark.


Connections

Before running an analysis, configure at least one SQL Server connection.

Adding a New Connection

  1. In the Connections section, click New.
  2. Fill in the connection details:
    • Connection Name: A friendly name for this connection (e.g., “Production Server”)
    • Server Name: The SQL Server hostname or IP address. For Amazon RDS, use the instance endpoint and port, for example mydb.abc123xyz.us-east-1.rds.amazonaws.com,1433
    • Database Name: Target database name (optional; defaults to master)
  3. Choose an authentication method:
    • Windows Authentication: Uses your current Windows credentials
    • SQL Server Authentication: Enter username and password. Use a login with only the permissions AI SQL Tuner Studio needs; see set up a least-privileged login.
    • Microsoft Entra Interactive: For Azure SQL with multi-factor authentication
  4. Optionally enable Trust Server Certificate for development environments. Amazon RDS signs its certificates with an AWS certificate authority that Windows does not trust by default; install the AWS RDS certificate bundle in the Windows Trusted Root Certification Authorities store, or enable Trust Server Certificate. If the test fails on the certificate, the connection dialog says so.
  5. Click Add to save the connection. The connection will be tested before saving.

Managing Connections

  • Select a connection from the list before running an analysis.
  • Click Edit to modify an existing connection.
  • Connections are stored locally in %LOCALAPPDATA%\AISQLTuner\AISQLTunerStudio\connections.json.
  • A SQL Server password is saved only when Remember password is checked, and is then encrypted under your Windows account. A copy of the file opened by another Windows account or on another machine loads the connection without its password, and you enter it again. A password saved in plain text by version 3.0.6 or earlier is encrypted the first time the app loads your connections.

Models, Reasoning Effort and Privacy

These settings apply to every tuning goal: which AI model writes the report, how long it reasons, the language it writes in, and whether your analyses are kept.

Model Selection

Use the MODEL dropdown (above the Run Analysis button) to choose the AI model for the analysis:

Option Provider Notes
GPT-5.6 Luna (Azure OpenAI) EMS-routed Default. Standard model available to Free/Pro/Team/Enterprise
GPT-6 Sol (Azure OpenAI · Team/Enterprise) EMS-routed Premium model. Requires Team or Enterprise entitlement. Use Medium or High reasoning effort, not Low

Each edition includes a default model chosen from real Index Tuning, Query Tuner, and Code Review workloads; see the benchmark results. GPT-5.6 Luna is the default for all editions: it ranked first on Code Review and close to the leader on the other two, with no wrong results in any benchmark run. Team/Enterprise additionally unlock GPT-6 Sol, which answers in about a minute on typical workloads. Do not run GPT-6 Sol at Low: at Low its Code Review advice is much weaker, and some of its rewrites return wrong results.

The desktop app sends every model request to the EMS. Azure AI Foundry credentials stay on the server and are never entered in the client — unless you opt in to BYO AI (Pro/Team/Enterprise only; see Bring Your Own AI Endpoint).

The model you select is always the model that runs — selection is read directly from the dropdown at the moment you click Run Analysis, so switching models is effective immediately without needing to restart or re-save settings.

Reasoning Effort

Use the REASONING dropdown to control the depth of AI analysis:

  • Low: Fastest, but gives noticeably weaker advice for Code Review
  • Medium: Recommended and the default. In benchmark runs it matched High on Code Review with GPT-5.6 Luna, in less than half the time, and on Query Tuner with GPT-6 Sol
  • High: Slowest (two to three times Medium). Try it when a Medium report misses a root cause you can see in the data

Low/Medium/High maps directly to native reasoning effort levels. The Free edition can choose Low or Medium; High requires Pro, Team or Enterprise. The AI SQL Tuner service sets which levels each edition includes and applies them to every analysis: a request for a level the edition does not include runs at the highest level it does. After an upgrade to 3.0.5 or later, a saved Low setting is moved to Medium once, because before 3.0.5 the setting did not reach the model and every analysis already ran at the model’s default (medium).

This setting applies to all tuning goals and is saved automatically.

Report Language

Use the REPORT LANGUAGE dropdown (next to REASONING) to choose the language the report is written in. The default is English.

  • Pick a language from the list, or type another and press Enter: a language’s name in English or in that language (Catalan, català), or a language tag (de-CH, es-419). Text the app does not recognize as a language is not used; the dropdown keeps the previous choice and the Console drawer says why.
  • Everything you read is written in that language: the report title, headings, prose, table headers, status badges (such as Outdated or Never Run), recommendations and the footer. A translated status may be followed once by its English value in parentheses, to match what the analysis collected.
  • T-SQL scripts, database and object names, DMV names and their column names, wait types, performance counter names, configuration and database option names, SQL Server feature names (such as Query Store) and messages quoted from SQL Server are not translated, so scripts still run and names can still be searched for.
  • The report’s HTML declares the language (<html lang="…">), and right-to-left languages such as Arabic and Hebrew are laid out right to left.
  • In the footer, the version number, model name, reasoning effort and analysis time stay exactly as recorded.
  • The No Deadlocks Found page, which the app writes itself rather than the AI, is in English whatever the language.

How well a language is written depends on the model. Have someone fluent in the language and familiar with SQL Server review the recommendations before you act on them in production.

The choice applies to all tuning goals and is saved automatically. The collapsed Tuning Setup header names it when it is not English, and the run plan shows it.

Language statistics. With each analysis, the app sends the AI SQL Tuner service the report language and your Windows display language (for example de-DE; the display language, not your regional format). The service keeps monthly counts per language, which are not linked to you or your license, to decide which languages to support. Neither value changes how your analysis is run. With your own AI endpoint, the analysis goes directly to your endpoint and neither is sent.

Privacy

By default your analyses are not kept. Each run is sent to the service, answered, and discarded.

Under Privacy in the settings pane you can turn on Keep my analyses to improve AI SQL Tuner. With it on, the diagnostics collected from your server and the report written about them are stored against your licence so results can be compared across models and the advice improved. Those diagnostics include table, index, and query text from the databases you analyse — they never include SQL credentials, licence keys, or API keys.

You can turn it off at any time. That stops further analyses being kept, but anything already stored stays until you remove it.

To remove it, use Delete my stored analyses… in the same section. It asks you to confirm, then permanently deletes every analysis stored for your licence along with the reports written about them, and tells you how many were removed. Only your own analyses are affected — the service works out whose they are from your licence, not from anything the app sends — and the deletion cannot be undone.

With the setting off, no diagnostics or report text from your analysis is kept. The service records only that a request was answered, so the same run cannot be billed twice, and the report language and Windows display language it was sent with (see Report Language). If a run is interrupted after it was answered, the report cannot be recovered and a new analysis is needed.

Deleting your stored analyses also deletes those request records. The monthly counts of requests per language are kept, because they are not linked to you or your license.

For how your data is handled end to end, see Data Privacy below and how AI SQL Tuner protects your privacy.


Tuning Goals

Select a tuning goal to determine what type of analysis to perform. There are six, each with its own report:

Goal What it does
Server Health Check Reviews the whole instance: configuration, waits, memory, storage, backups and patch level
Fix Deadlocks Reads your deadlock history and rewrites the code involved
Code Review Reviews stored procedures, functions, triggers and views
Index Tuning Recommends index changes across a database, with storage sizes
Query Tuner Analyzes one query and its execution plan
Locking and Blocking Analysis Explains what is blocking right now and how to fix it

Server Health Check

Server Health Check is a comprehensive review of your SQL Server instance that ranks the issues that matter most. Learn more about the SQL Server health check. It covers:

  • Wait statistics (excluding benign wait types, showing waits > 1% of total)
  • I/O latency by database file
  • System configuration review
  • SQL Server lifecycle status (for on-premises SQL Server only):
    • 🟢 Green: >1 year before mainstream support end
    • 🟡 Yellow: ≤1 year before mainstream end (still supported), or in extended support with >1 year remaining
    • 🔴 Red: In extended support with ≤1 year remaining, or past extended support end
  • CU (cumulative update) currency status (for on-premises SQL Server only) — compares your installed CU against a reference table of the latest published CU for your SQL Server version. The table is kept current by the AI SQL Tuner service and refreshed each time the app checks your license; until then, or without a license, a copy built into the app is used. The report says which was used and when it was last checked against Microsoft’s build list:
    • 🟢 Current: On the latest CU and Microsoft has released a CU within the past 12 months
    • 🟡 Slightly Behind: Exactly one CU behind the latest
    • 🔴 Outdated: Two or more CUs behind the latest
    • 🟢 Current (No recent CUs published): On the latest CU, but either Microsoft has not released a new CU for this version in over 12 months (stalled cadence) or the version is GDR-only — no CU action needed
  • sp_configure settings audit
  • Plan cache analysis (top resource-consuming queries)
  • Plan cache pollution indicators (single-use plan pressure); on Azure SQL Database and Fabric SQL Database, for the connected database’s plans only, which needs VIEW DATABASE STATE
  • Performance counter snapshot (batch requests/compilations)
  • sp_executesql compilation storms: the OPTIMIZED_SP_EXECUTESQL setting and its statistics prerequisites for each database, sp_executesql batches with more than one cached plan for the same SET options, and compilation-related waits. The setting is recommended only where it is off and such duplicate plans are found, and only on SQL Server 2025, Azure SQL Database and Fabric SQL Database, which have it
  • Cardinality estimation (CE) feedback by database: whether it can run (it needs CE_FEEDBACK on, compatibility level 160 or higher and Query Store in READ_WRITE) and why not, whether CE feedback for expressions is on, and a flag for SQL Server 2022 CU8 through CU11, which have a known CE feedback plan cache issue fixed in CU12
  • Degree of parallelism (DOP) feedback by database: whether it can run (it needs DOP_FEEDBACK on, compatibility level 160 or higher and Query Store in READ_WRITE) and why not. DOP_FEEDBACK is off by default on SQL Server 2022 and on by default on SQL Server 2025, and the section says whether an OFF is the default or was set on purpose. On Azure SQL Managed Instance it needs the SQL Server 2025 or Always-up-to-date update policy
  • Optional parameter plan optimization (OPPO), on SQL Server 2025, Azure SQL Database and Fabric SQL Database: the databases where it is not active, because the compatibility level is below 170 or OPTIONAL_PARAMETER_OPTIMIZATION is off
  • High-impact missing indexes across all user databases, each with the table’s row count, the size of its heap or clustered data, and the size of the nonclustered indexes already on it
  • Query Store settings for all databases
  • DBCC CHECKDB history for all databases (from DBCC DBINFO, or, for a login not permitted to run DBCC DBINFO, from the LastGoodCheckDbTime database property on SQL Server 2016 SP2 and later). The date is read the same way whatever the login’s language, and a database on which CHECKDB has never completed is reported as Never Run
  • Backup & recovery status (last full/diff/log backup times, recovery model, and risk flags for missing or delayed backups). On Amazon RDS, databases without backups recorded in msdb are not flagged, because RDS automated backups may not be recorded there
  • Security posture checks (connection encryption and sysadmin role membership)
  • Recent deadlock detection (past 7 days)
  • Memory health history, on SQL Server 2025, Azure SQL Database and Fabric SQL Database: the engine’s own memory health severity over about the last hour (reset when the engine restarts), so a memory pressure episode that has ended still shows, with the window it covers and the top memory clerks during each episode
  • Memory and lock pressure diagnostics: memory clerk breakdown, lock manager cache size, RESOURCE_SEMAPHORE waiters, top memory grants, buffer pool distribution, and lock counts by session
  • TempDB configuration (data file count vs. logical CPUs, file sizing parity, autogrowth settings — on-premises SQL Server; Azure SQL Managed Instance analysis is limited to symptoms and workload impact because tempdb file count and size are platform-managed)
  • Database file autogrowth risks (percent growth, increments under 64 MB, disabled autogrowth, files near their max-size cap)
  • Database options audit (auto-close, auto-shrink, page verify, auto create/update statistics, RCSI, snapshot isolation)
  • Transaction log health: total/active VLF counts, log sizes, and truncation holdup reasons (SQL Server 2016 SP2 or later)
  • Instant file initialization status for the SQL Server service account (on-premises only)
  • HADR synchronization status when availability groups are present

Database requirement: Optional (defaults to master)

Note: Scans all online user databases for comprehensive health assessment. Lifecycle and CU currency status checks apply only to on-premises SQL Server installations (excluded for Azure SQL Database, Azure SQL Managed Instance, and Microsoft Fabric SQL Database). For Azure SQL Managed Instance, Server Health does not recommend changing tempdb file count or file size because those settings are not user-configurable. On Amazon RDS for SQL Server, the CU currency check runs, but recommends an RDS engine version upgrade instead of installing a CU, and Server Health recommends RDS remedies (DB parameter groups, rds.force_ssl, RDS automated backups, Multi-AZ) instead of on-premises ones. Instant file initialization is skipped on RDS because it is platform-managed. The Amazon RDS support document (AmazonRDS_Support.md) has the full details.

Fix Deadlocks

Fix Deadlocks analyzes recent deadlocks from the system_health extended events session, pulls the code each session was running, and rewrites it to prevent them. See how to fix SQL Server deadlocks.

Includes:

  • Deadlock graphs (processes, victims, resources, lock modes) with UTC timestamps
  • The code each deadlocked process was running: the full definition of each stored procedure, function, or trigger in its execution stack, and the text of each ad hoc batch still in the plan cache (up to 30 modules or batches, 60,000 characters each and 300,000 in total)
  • What ran each process and each piece of code: host, login and application, and for a SQL Agent T-SQL job step, the job and step names from msdb. Reading job names needs SELECT on msdb.dbo.sysjobs and sysjobsteps (sysadmin or a SQL Agent role such as SQLAgentReaderRole); without it, a job is shown by its id
  • Rewritten code for each deadlock, with complete CREATE OR ALTER definitions in the Scripts section when the full module text was available. The report names each piece of code it cites, a module by its name and an ad hoc batch by what ran it, and says whether a SQL Agent job step or the application code has to change
  • RCSI, snapshot isolation, accelerated database recovery and optimized locking for each database in the deadlocks, and whether that database holds the locked rows or is only the current database of a session (such as master). The report takes each deadlock’s settings from the database that holds its locked rows, names the database whenever it states a setting, and says a setting is unknown when it could not be read. With those settings it recommends database-level measures (row versioning, optimized locking on SQL Server 2025) besides code changes, plus lock escalation measures and retry handling where the deadlock graph supports them
  • Where a better index would prevent a deadlock, the index it needs and the tables to run Index Tuning for. Fix Deadlocks doesn’t read the tables’ existing indexes, so it gives no CREATE INDEX scripts

Options:

  • Deadlocks to analyze: Number of recent deadlocks to examine (1–20, default 5)

Database requirement: Optional (defaults to master)

Important: Not supported on Azure SQL Database or Microsoft Fabric SQL Database (system_health file target not accessible on these platforms). On Azure SQL Managed Instance and Amazon RDS, deadlocks are read from both the system_health event files and its ring buffer. On Amazon RDS, if no deadlocks are found and system_health is not running, the report says deadlocks are not being recorded instead of reporting none.

Code Review

Code Review is an AI-powered review of your T-SQL stored procedures, functions, triggers, and views for performance issues, anti-patterns, and best practice violations. See the SQL code review page for examples.

Includes:

  • Stored procedures, functions, triggers, and views (based on your object type selection), sent with line numbers up to 60,000 characters each and 300,000 in total. A longer definition is marked truncated, and objects past the total are listed as not reviewed
  • Signals for each object, including catch-all predicates such as (@p IS NULL OR col = @p), RECOMPILE, and the module’s ANSI_NULLS setting; when an object has a catch-all predicate, whether optional parameter plan optimization (OPPO) is active for the database, so the review can say when OPPO already handles the predicate
  • Top tables by row count (>1,000 rows)
  • Largest index usage summary (key/included columns, seeks/scans/lookups/updates, size on disk)

Options:

  • Order: Newest or Oldest (by modification date), or Most expensive (by CPU recorded in Query Store, or in the plan cache when Query Store is off; falls back to newest when neither can rank)
  • Objects: Number of objects to review (1–100, default 100)
  • Object types: Stored procedures, functions, triggers, views (select at least one)
  • Schema (optional): Limit the review to objects in a specific schema (e.g., dbo)
  • Object (optional): Limit the review to a single object by name (e.g., usp_GetOrders). Requires Schema when specified.

Database requirement: Required – must specify a user database (cannot run against system databases: master, tempdb, model, msdb)

Index Tuning

Index Tuning reviews indexes across a database and recommends what to create, change, or drop, with the storage each change adds or frees. It analyzes missing index recommendations, index usage statistics, Query Store and plan cache query patterns, and constraints. See the Index Tuning goal and the SQL Server index tuning guide.

Includes:

  • Missing index analysis with impact scores, and the type of each included column, with an average width sampled from the table for wide and (max) columns, so that the report does not copy an nvarchar(max) column into an index just because a suggestion lists it
  • Index usage statistics (seeks, scans, lookups, updates, key/included columns, size, compression)
  • Duplicate and overlapping index detection (exact key duplicates and left-prefix overlaps, reporting the size of both the narrower and the wider index so a drop or a merge can be costed). Each pair says whether the narrower index is redundant: the wider one covers its included columns and filter and keeps any uniqueness, so the report recommends dropping it whatever its usage. Of two exact duplicates, the clustered, constraint-backed or unique one is the one kept
  • Index dependencies: for up to 200 nonclustered indexes, those that a foreign key references, or that a module (an index hint such as WITH (INDEX(IX_...))), an enabled plan guide, a Query Store hint or a forced Query Store plan names. Dropping such an index breaks what names it, so the report does not recommend dropping it; if it should still go, the report says what has to change first and scripts that change ahead of the drop
  • Constraint and foreign key relationships
  • Untrusted or disabled foreign keys and check constraints (these block optimizer join elimination)
  • Column cardinality estimates for candidate and explicitly selected tables
  • Skewed low-cardinality columns in those tables, where one value is rare or dominant, with each value’s share of the rows (for example Closed: 99.50%, Open: 0.50%), so that a frequent query for the rare value gets a filtered index (SQL Server 2016 SP1 CU2 and later)
  • Large table identification (>1M rows, top 50)
  • Index page density and fragmentation signals, with the size each index occupies
  • Heap table analysis for the 50 largest heaps (row totals, reserved size, forwarded records summed over partitions, fragmentation). For forwarded records the report recommends a clustered index, or rebuilding a table that must stay a heap
  • Plan cache query analysis (query text snippets): the top statements by CPU that ran in the database being tuned, leaving out the queries Studio itself runs to collect data
  • Non-sargable predicates: from those statements’ execution plans, the table columns a predicate wraps in a function, conversion or arithmetic, such as YEAR(InvoiceDate) = @y, which no index can seek. The report recommends the rewrite that can, for example a date range, and an index only together with it
  • Database statistics configuration review
  • Query Store workload insights, forced plan failures, and automatic tuning state. On Standard, Standard Developer and Express, which have no automatic tuning, the report does not recommend enabling FORCE_LAST_GOOD_PLAN; elsewhere it scripts it as ALTER DATABASE [db] SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN = ON)
  • Cardinality estimation (CE) feedback on SQL Server 2022 and later and Azure SQL: whether it can run for the database and why not, its results by state, and Query Store hints by source. When it can run, a recommendation to force a plan or add a query hint or Query Store hint says that this stops CE feedback for that query
  • Degree of parallelism (DOP) feedback on SQL Server 2022 and later and Azure SQL: whether it can run for the database and why not, and its results by state. A forced plan does not stop DOP feedback, but a MAXDOP query hint or Query Store hint makes the query ineligible, which the report says when it recommends one
  • Whether optional parameter plan optimization (OPPO) is active for the database (SQL Server 2025, Azure SQL Database and Fabric SQL Database, compatibility level 170). Query Store workload insights count each adaptive plan query variant under its parent query

Options:

  • Schema: Optional schema filter for narrowing analysis to a single table
  • Table: Optional table filter; requires Schema when specified

Scope behavior:

  • The schema/table filter applies to object-scoped sections such as missing indexes, index usage, duplicate/overlapping indexes, index dependencies, constraints, untrusted constraints, column cardinality and skewed low-cardinality columns, large tables, and index page density.
  • For Index Page Density, specifying both schema and table limits results to that table only; specifying only schema limits the candidate tables to missing-index and large-table candidates within that schema.
  • The Query Store sections (workload insights, write workload mix, and forced plan failures) are scoped as well: they are limited to the queries whose execution plans reference the chosen object, so a stored procedure contributes only the statements that actually touch it. The report states how that scope was resolved and how many queries it covers.
  • Plan cache, automatic tuning, CE feedback, DOP feedback, optional parameter plan optimization, and database statistics settings remain database-wide to provide context.

Database requirement: Required – must specify a user database (cannot run against system databases: master, tempdb, model, msdb)

Query Tuner

Query Tuner provides focused tuning for a single SQL query. It captures the estimated execution plan for the query, extracts referenced tables and operators, collects targeted metadata for those tables, and asks the AI model for query-level recommendations. See the Query Tuner page for a walkthrough.

Includes:

  • The query text you enter in the Query to analyze box
  • Estimated execution plan XML captured with SET SHOWPLAN_XML ON (the query is not executed during plan capture)
  • Execution plan summary, labelled as an estimated plan, for each statement in the batch (the most expensive first): its cost, whether it runs in parallel and, for a serial plan, the reason the plan gives (such as a scalar function that cannot be inlined, or MAXDOP 1), its SET options, parameters with their compiled values and local variables, each operator with estimated rows, rows read, executions, seek range and residual predicate, the plan’s warnings, each implicit conversion with the side it converts, and missing index recommendations from the plan
  • Targeted metadata for referenced tables only: index usage statistics, DMV missing indexes, table sizes, foreign keys, column cardinality, statistics settings, the statistics the plan used with their current last update, sample size and modification count, and the data type, length and collation of each column the plan compares or converts
  • Parallelism settings (server and database-scoped MAXDOP, cost threshold for parallelism) and the database settings for scalar UDF inlining, Parameter Sensitive Plan optimization, LAST_QUERY_PLAN_STATS, CE_FEEDBACK, CE_FEEDBACK_FOR_EXPRESSIONS and DOP_FEEDBACK
  • The last actual plan from the plan cache, on SQL Server 2019 and later and Azure SQL, when the query has run there before: estimated against actual rows for each operator, with the operator where the estimate first goes wrong, and the DOP the query ran at next to the plan’s. The query itself is never run
  • Query Store history for the query, matched by its text and query hash, when Query Store is available: each SET-options context separately, with its plans’ executions, duration, CPU, logical reads, rows and runtime DOP, and a warning when the application’s SET options differ from Studio’s (for example ARITHABORT), so the plan Studio sees may not be the application’s
  • Cardinality estimation (CE) feedback, on SQL Server 2022 and later and Azure SQL: whether it can run for the database and why not, and for the query its CE feedback results, its Query Store hints with their source (set by a user, or by CE feedback), and any forced plan. The report does not propose by hand a cardinality estimation hint that CE feedback already applied or rejected, and says when a recommended hint or forced plan would stop CE feedback for the query
  • Degree of parallelism (DOP) feedback, on SQL Server 2022 and later and Azure SQL: whether it can run for the database and why not, and the query’s DOP feedback results. The report does not propose a MAXDOP hint for a query DOP feedback is already adjusting, and says when a recommended MAXDOP hint would make the query ineligible for DOP feedback
  • Optional parameter plan optimization (OPPO), on SQL Server 2025, Azure SQL Database and Fabric SQL Database: the OPTIONAL_PARAMETER_OPTIMIZATION setting, and for each statement with a catch-all predicate such as (@p IS NULL OR col = @p), the parameters OPPO picks plans by, or the reasons found in the input that it did not engage (a local variable, RECOMPILE, the compatibility level, the setting, or the platform). Adaptive plans are labelled by feature, Optional Parameter Plan or Parameter Sensitive Plan, and when a procedure’s estimated plan has only the dispatcher, the tables are taken from its cached variant

Prompted AI output typically includes:

  • Query rewrite suggestions with before/after T-SQL examples
  • Index recommendations with full scripts
  • For each index recommendation: its expected read benefit and write overhead, stated from the plan and usage figures they rest on, and maintenance notes
  • The estimated size of every index created, the storage reclaimed by every index dropped, and the net storage change across all of them
  • Statistics maintenance recommendations, based on modification counts and sample sizes rather than on dates alone
  • The reason for a serial plan and the fix that matches it
  • Parameter sniffing or plan guidance when applicable
  • Evidence lines from SHOWPLAN XML or collected metadata for each major finding
  • Confidence level estimates and prioritized recommendations

Options:

  • Query to analyze: Required multiline text box for the SQL statement you want reviewed
  • Reasoning effort: Low, Medium, or High

Database requirement: Required – must specify a user database (cannot run against system databases: master, tempdb, model, msdb)

Permissions commonly required:

  • SHOWPLAN
  • VIEW DATABASE STATE
  • VIEW DEFINITION
  • VIEW SERVER STATE on SQL Server and Managed Instance for the last actual plan (VIEW DATABASE STATE on Azure SQL Database); without it that section reports the error and the rest of the analysis runs

Platform support: Supported for on-premises SQL Server, Azure SQL Database, Azure SQL Managed Instance, Microsoft Fabric SQL Database, and Amazon RDS for SQL Server (Standard, Enterprise and Developer editions).

Locking and Blocking Analysis

Locking and Blocking Analysis captures a live concurrency snapshot for the selected user database and asks the AI to identify root causes of active blocking, lock amplification, deadlocks, and TempDB-related contention. See locking and blocking analysis.

Includes:

  • Active blocker → waiter chains with compact statement-level SQL, short batch context, and each waiter’s wait type and wait resource (a [COMPILE] resource is a wait for another session’s compile)
  • Summarized lock inventory for the selected database plus tempdb
  • Long-running transactions
  • Index usage statistics and missing index candidates tied to blocking patterns, with each index’s size and its table’s row count
  • Blocker query plans and deadlock history when available
  • Query Store top-query evidence and database settings (including RCSI/snapshot, accelerated database recovery, optimized locking, OPTIMIZED_SP_EXECUTESQL and lock escalation) that influence blocking behavior
  • TempDB contention signals including pagelatch waits, file-space pressure, version store health, and spilling queries

Prompted AI output typically includes:

  • Blocking tree and root-cause classification
  • Prioritized fixes with evidence references and confidence levels
  • Query or code-change recommendations when the captured SQL suggests non-sargable predicates, broad transaction scope, scans, or oversized modifications
  • Enablement guidance when Query Store is disabled, or when deadlock capture is stopped, blocked by permissions, or not available on the platform (Azure SQL Database and Fabric SQL Database need a database-scoped event session)

Database requirement: Required – must specify a user database (cannot run against system databases: master, tempdb, model, msdb)


License Configuration

Every edition includes all six tuning goals and supports every SQL Server platform. The editions differ in monthly analyses, server connections, models, and reasoning levels:

Edition Analyses per month Server connections Models Reasoning effort Bring your own AI endpoint
Free 10 1 GPT-5.6 Luna Low, Medium No
Pro 50 Up to 2 GPT-5.6 Luna Low, Medium, High Yes
Team 150 Up to 2 GPT-5.6 Luna, GPT-6 Sol Low, Medium, High Yes
Enterprise 400 Unlimited GPT-5.6 Luna, GPT-6 Sol Low, Medium, High Yes

Each analysis on the hosted service uses one unit of your monthly quota; the count resets each month on the day your subscription or free license started. See compare editions for pricing, and the license activation guide for step-by-step activation with screenshots.

Server Connections

Server connections is the number of SQL Server instances a license can be used to analyze. Free can be used with 1, Pro and Team with up to 2 each; Enterprise has no limit. You can have any number of saved connections and databases: two connections to different databases on the same server count once.

  • A server is counted the first time you run an analysis on it, by every analysis including those sent to your own AI endpoint. It is identified by the name SQL Server reports for itself, so localhost, ., an IP address and the machine name are one server, while two named instances on one machine are two.
  • Once a license is in use with as many servers as its edition allows, an analysis on another server stops with Server limit reached after connecting and before anything is collected or sent, and uses no quota. Adding a new connection to such a server is refused too.
  • Deleting a connection, or reinstalling the app, does not free a server: the count is kept by the AI SQL Tuner service, per license. If you no longer use a server, contact support to release it, or upgrade to an edition with a higher limit.
  • The Edition & Licensing panel shows how many servers the license is in use with, for example Servers: 1 / 2.
  • Upgrading keeps the servers already counted: a Free license’s server stays counted when it moves to Pro, which then has room for one more. Moving from Enterprise to another edition starts with no servers counted.

If You Bought Through the Microsoft Store

You do not need a licence key. The app activates from your Store purchase automatically when it starts, using the account signed in to the Microsoft Store on this PC. To retry it by hand, use Help → Activate with Microsoft Store. The free edition activates this way too, without a subscription.

If activation reports No Microsoft Store purchase was found for the signed-in account right after you install the app or buy a subscription, the Store may not have reported it yet. Wait a few minutes and use Help → Activate with Microsoft Store again.

To subscribe to Pro, Team or Enterprise in the Store version of the app:

  1. Open Help → Manage license… (or License… in the Edition & Licensing panel).
  2. Under Microsoft Store subscription, each edition is listed with its price for your market. Click Subscribe next to the one you want.
  3. Complete the purchase in the Microsoft Store window that opens. The Store handles payment.
  4. The app activates the subscription straight away and the Edition & Licensing panel shows the new edition. If it reports that the purchase is not activated yet, use Help → Activate with Microsoft Store again in a few minutes.

Subscriptions renew automatically. Manage or cancel them at account.microsoft.com/services; a cancelled subscription stays active until the end of the period you paid for. The Store does not switch a subscription from one edition to another: to move up, subscribe to the higher edition and cancel the lower one. While you own more than one, the app uses the highest. A subscription belongs to your Microsoft account: on every PC where you sign in to the Store with that account, the app has the same edition and draws on the same monthly analyses. The subscription section appears only in the Microsoft Store version of the app; the version downloaded from aisqltuner.com uses license keys.

If you have entered a licence key, that key is used instead: a directly-purchased licence always takes priority over a Store entitlement.

If You Bought a License Key Directly

  1. Select your edition in the Edition dropdown of the Edition & Licensing section. Before a key is activated, this selection decides which models and reasoning levels the app offers.
  2. Click License… (or use Help → Manage license… / Ctrl+L) to open the activation dialog.
  3. Paste your EDD key.
  4. Click Save to persist the key and activate against the EMS.
  5. The sidebar shows the active tier plus the current used / limit quota and reset date.

Your edition selection is remembered between sessions. Activating a key confirms the real tier and updates the dropdown to match it. If the two disagree — you selected Team but your key is a Pro key — the sidebar says so explicitly:

Your license activates as Pro, not Team.

Selecting a higher edition does not grant its features. The dropdown only changes what the app offers locally; the EMS decides the tier, the model catalog, and the quota, and enforces them on every request.

Note: The EMS is authoritative for quota and tier changes. If an admin changes the quota server-side, the next request uses the new limit immediately even if the cached desktop token has not expired yet.

If Activation Fails

When the licensing service refuses your key, the sidebar shows Activation failed with a red dot and the reason in place of the quota, even if an earlier activation is still cached. The run plan’s License card says the same. Runs are refused until the key activates, so fix the cause below and save the key again from License…; the sidebar shows the tier and quota once activation succeeds. A network failure does not count: if the service cannot be reached, the sidebar keeps showing your last activation.

The message tells you what the licensing service actually reported, rather than a generic “invalid key”. Common ones:

Message Meaning
The license key has expired. The key was valid but its term has ended; renew it.
The license key has been disabled. The key was revoked. Contact support.
The license key has no activations left. Deactivate another installation, or buy more seats.
The license key was not found. The key does not exist — check for a typo.
The Microsoft Store subscription on this account expired on … Your Store subscription lapsed. Renew it in the Microsoft Store.
The Microsoft Store entitlement on this account is a trial. You are on a trial SKU. Buy the full edition to continue.
No Microsoft Store purchase was found for the signed-in account. The Store account signed in on this PC does not own the app. Check you are signed in with the account that bought it.
The license key is for a product that is not one of the editions this application supports. The key exists, but is not registered to an AI SQL Tuner Studio edition. Contact support with the key so the license can be checked. A key bought under a product’s former name still works — the edition is matched on the product id, not its name.
The licensing service is temporarily unavailable. A service problem, not a problem with your key. Try again shortly.

AI Configuration

Service Endpoint

The service endpoint is already configured. It ships with the app, and AI Configuration shows the endpoint currently in use. The desktop app routes all tuning requests through the EMS; Azure AI Foundry credentials stay server-side.

  1. EMS endpoint: Shown for reference, and not editable. Your license key and the diagnostics collected from your server are sent to this endpoint, so it is fixed by the app rather than typed in. No one from support will ever ask you to change it — if someone does, they are not from support.
  2. Primary model: With your own AI endpoint, the deployment name to call (e.g., gpt-6-sol, claude-opus-5-5). On the hosted service, the MODEL dropdown decides the model
  3. Fallback model: Not used. Requests the primary model cannot take are blocked with a Request too large dialog instead

Click Save AI settings to persist your configuration.

The app activates your license against the EMS at startup and shows the endpoint it is using in the console drawer, for example:

EMS endpoint: https://ca-ems-prod-3t2tsp2e... (Production).

If activation fails (no network, or the service is unreachable) the app still opens; it retries before your first analysis run. If the service refuses the key, the sidebar shows Activation failed and the reason — see If Activation Fails.

Bring Your Own AI Endpoint (Pro, Team and Enterprise)

If you want to use your own Azure OpenAI or Microsoft Foundry endpoint, check “Use my own AI endpoint (uncapped)” (only shown for editions that include BYO AI, which the AI SQL Tuner service decides: Pro, Team and Enterprise).

When BYO AI is active:

  • The app verifies your license via EMS, then calls your AI endpoint directly.
  • No monthly quota is consumed — usage is uncapped because it runs against your own resource.
  • Enter your BYO endpoint URL and API key in the fields that appear.
  • Enter your deployment name in Primary model, for example gpt-6-sol or claude-opus-5-5. A name starting with claude- is called through the Anthropic Messages API; any other name through the Azure OpenAI Responses API. Leave it empty to send the name of the model selected in the MODEL dropdown.
  • Optionally check Save key to persist the key locally.

See the full guide: Configure your own AI endpoint.

How the AI is Prompted

When running from the UI, the app asks the model to return a complete HTML document with:

  • An Executive summary with top priorities
  • Detailed prioritized recommendations
  • A left-side table of contents
  • A unique report title built from the report type plus one or more context anchors (such as server, database, query hash, scope, or date/identifier)
  • Server name, server version, and database name when available
  • Confidence level estimates
  • A footer showing the AI SQL Tuner Studio version, model used, reasoning effort, and the UTC analysis timestamp
  • When a report language other than English is chosen: the report written in that language, with T-SQL, object names and other identifiers left untranslated, the report title, headings, status labels and footer in that language too, the <html lang> attribute set to the language, and the scripts section ids unchanged. With English, the prompt is the same as before the language choice existed

Each tuning goal has additional goal-specific instructions. For example:

  • Code Review focuses on stored procedures, functions, triggers, and views plus table/index context
  • Index Tuning emphasizes index benefit vs. write overhead, Query Store insights, and full scripts
  • Query Tuner emphasizes execution plan evidence, query rewrites, targeted index design, and statistics guidance
  • Locking and Blocking Analysis emphasizes blocker/waiter SQL, compact plan evidence, and query/code changes that reduce blocking scope

Every goal that can recommend an index change — Code Review, Index Tuning, Server Health, Query Tuner, and Locking and Blocking Analysis — is also asked to state what that change costs in storage. See Index size estimates.

For HTML reports, the generated title is used consistently for the HTML <title>, the document <h1>, and the structured-data headline so each report is treated as a distinct document.

Server Information and Uptime

Every analysis starts its input with information about the server: its name, edition, version, and the time SQL Server last started, with the uptime since then.

The uptime matters because SQL Server clears some statistics when it restarts: index usage statistics, missing index statistics, index operational statistics and the plan cache. They describe only the period since the last restart, so an index with no reads may simply not have been needed yet.

A restart is not the only thing that clears them. SQL Server also clears them for one database when that database is restored, reverted from a database snapshot, detached and attached, taken offline and brought back online, or closed and reopened under AUTO_CLOSE. The server can then show 30 days of uptime while the database’s statistics cover a few hours. So the input also has a Database Usage Statistics Since line: the later of the server start time and the database’s last reset, how long ago that was, and where it came from. SQL Server has no single view for this, so AI SQL Tuner checks, in the server’s local time:

  • the SQL Server error log, for the database’s latest “Starting up database” message. SQL Server writes it for every reset listed above. This needs membership in the securityadmin or sysadmin server role. The current log and up to six archives are searched.
  • msdb.dbo.restorehistory, for the database’s latest restore. A snapshot revert is not recorded there.
  • the database’s create date in sys.databases, which an attach, or a restore under a new name, sets. A restore over the existing database keeps the original date.
  • the SQL Server start time.

When the error log cannot be read, the line names the resets that would not show, and says the statistics may cover less than the period given. On Azure SQL Database the error log and restore history are not available, and a failover can clear the statistics without changing these times, so the line says the same. When the database has AUTO_CLOSE on, the line also says that the statistics are cleared whenever its last connection closes.

Index Tuning checks this period before recommending that an index be dropped. When it is shorter than one week, the index is listed as a candidate to confirm later rather than recommended for dropping, and the period and its source are given as the reason. With a week or more the index can be recommended for dropping, with a note that monthly or quarterly work may not have run in that time. This caution is only for drops justified by low use: an exact duplicate, or an index that another index makes redundant, loses nothing when dropped and is recommended for dropping whatever the period.

Reading the start time needs the VIEW SERVER STATE permission. Without it, the input says the start time is unknown. If no time can be determined at all, the AI treats unread indexes with the same caution.

Index Size Estimates

An index buys read speed with disk space and write work, so a recommendation to create or drop one is incomplete without its size. Every goal that can recommend an index change — Code Review, Index Tuning, Server Health, Query Tuner, and Locking and Blocking Analysis — asks the model to report:

  • the estimated size a new index will occupy once built;
  • the storage a dropped index will reclaim;
  • the size before, the size after, and the net change for a modified index (added or removed columns, changed compression or fill factor);
  • the net storage change across all index recommendations, in the executive summary.

Sizes are reported in MB, or in GB above 1024 MB, next to the table’s row count and the assumptions behind the figure.

Where the number comes from:

  • Existing indexes are measured. The collectors read the real size from sys.dm_db_partition_stats, so a drop or a rebuild is costed from what is actually on disk.
  • New indexes are estimated, from the table’s row count and the width of the key, included, and clustering-key columns, adjusted for any compression or fill factor the recommendation asks for.
  • Where the collected data does not contain the row counts or column widths needed for a firm figure, the model gives a range rather than a single number. Treat an estimate as a planning figure, not a guarantee — the built size depends on actual column values, fill factor, and compression ratios.

Fix Deadlocks is the one goal excluded. Its input is deadlock graphs and statement text, with no table or index metadata, so there is nothing to size an estimate against.


Running an Analysis

  1. Select a connection from the Connections list in the left panel.
  2. Choose a tuning goal by clicking one of the goal preset cards in the right panel.
  3. Configure goal options if applicable (deadlock count, code review scope, index tuning filters, query text, etc.).
  4. Verify database selection:
    • For Code Review, Index Tuning, or Query Tuner: Ensure a user database is specified (not master, tempdb, model, or msdb)
    • For Server Health Check or Fix Deadlocks: Database is optional (defaults to master)
  5. Select a model from the MODEL dropdown.
  6. Adjust reasoning effort if needed.
  7. If using Query Tuner, paste the SQL statement into Query to analyze.
  8. Click Run Analysis (or press Ctrl+R).

What happens the moment you click Run Analysis

The status line reads Checking license… and the progress ring starts straight away. Before every run the app confirms your licence with the licensing service, and that check can take a few seconds — occasionally much longer when the service has been idle and has to start up again.

You do not wait for it. The check runs while you read the run plan described below, and its result is collected when you choose Send to AI. If it fails, the run does not start: the reason appears in a dialog and stays in the Console drawer.

If your entitlement turns out to have changed since your last run — a different edition, or a model that is no longer offered to you — the plan is rebuilt from the new entitlement and shown again, so what you approve is always what runs.

Reviewing a run before it leaves your machine

When you click Run Analysis, a Review run plan dialog appears showing exactly what will happen:

  • Connection — server, database, authentication method, encryption state.
  • AI call — provider, endpoint host, model, fallback model, reasoning level, report language, and whether the endpoint is cloud or on-premise. When the analysis goes to the AI SQL Tuner service, it also names the Windows display language sent for language statistics.
  • License — edition and activation status, including where the activation came from: your license key or your Microsoft Store purchase. If the last activation was refused, it says so and gives the reason; activation is tried again before the run starts.
  • Collectors — a table listing each data collector that will query your SQL Server, including the DMVs it touches, estimated row cap, and estimated payload size. Click any row to expand its description and SQL fingerprint. Each row corresponds to a distinct collection section executed at run time — goals such as Code Review, Index Tuning, Query Tuner, Locking and Blocking, and Server Health each run multiple sections, all of which are shown.
  • Plan fingerprint — a stable hash (16 hex characters) identifying this specific configuration. Click the fingerprint pill to copy it.

From the dialog you can:

  • Save plan… — Export the plan as a JSON file ({server}-{goal}-{utc}.runplan.json) suitable for attaching to change-control tickets or procurement reviews. The JSON never contains secrets (no API keys, no passwords, no license keys).
  • Don’t show again until settings change — Suppress the dialog for repeated runs with the same configuration. The dialog automatically re-appears when you change the goal, model, reasoning level, report language, server, or database.
  • Send to AI — Proceed with the run.
  • Cancel — Abort without starting the run.

The plan summary is always logged to the Console drawer regardless of dialog suppression, providing an audit trail for every run.

When you click Run Analysis, the Tuning Setup drawer automatically collapses to give the HTML report panel maximum space. The collapsed header shows a one-line summary of your run configuration (e.g. Code Review • GPT-6 Sol • Medium • MyServer/MyDB, with the report language added after the reasoning level when it is not English) and a live status badge (e.g. Running…, Completed, Failed). Click the header bar to re-expand the drawer and adjust settings for the next run.

If the request exceeds the maximum supported size, the app will display a dialog asking you to reduce the request size before retrying.

Progress and status messages appear in the Console drawer at the bottom of the right panel. Click the Console header bar (or press Ctrl+J) to expand or collapse it. The AI model in use is shown in the console and in the footer status bar.

The HTML report renders progressively as the AI response streams in — content appears in the report panel before the analysis is fully complete. You can scroll and read early sections while the rest of the report is still being generated.

Long-running analyses may take up to about 4 minutes before completing or failing. This is expected for larger environments. If the AI provider remains too slow, the run now returns a provider timeout explanation in the console/report flow instead of ending with a generic client cancellation timeout.


Viewing Results

Tuning Setup Drawer

The Tuning Setup drawer sits at the top of the right panel and contains the goal cards, goal-specific options, model, reasoning and language dropdowns, and the Run Analysis button. It starts expanded so you can configure your run.

  • Toggle: Click the Tuning Setup header bar to expand or collapse the drawer at any time.
  • Auto-collapse: The drawer collapses automatically when you click Run Analysis, maximising the space available for the HTML report.
  • Dynamic resize: The drawer automatically resizes to fit the selected goal’s options — goals with more settings (e.g. Code Review, Query Tuner) expand the drawer taller; simpler goals keep it compact.
  • Collapsed header: Shows a one-line summary of the run configuration — Goal • Model • Reasoning • Server/Database — plus a live status badge (Running…, Completed, Failed, Cancelled).
  • Resize: Drag the handle at the bottom of the expanded drawer to adjust its height manually.

Console Drawer

The Console is a collapsible drawer at the bottom of the right panel. Click the Console header bar (or press Ctrl+J) to expand or collapse it. When collapsed, the latest log line is shown in the header for quick status at a glance. Use the Clear button (trash icon) to clear the console output.

The Console shows:

  • Connection status and database information
  • Data collection progress and per-section character counts
  • AI model in use (shows actual model if routing occurs)
  • Reasoning effort level
  • Query Tuner execution-plan retrieval and metadata collection status when applicable
  • Truncation warnings if the AI response was cut short due to output token limits
  • Any warnings or errors

HTML Report

Every analysis produces an interactive, professionally formatted report. See real examples in the sample reports. Each report includes:

  • Executive summary with top priorities
  • Detailed findings organized by severity
  • Actionable recommendations with T-SQL scripts
  • Table of contents for easy navigation
  • Platform-specific guidance based on your SQL Server edition and version
  • Visualizations when they improve clarity (for example blocking trees, deadlock flow diagrams, and before/after plan views)

Report features:

  • Progressive rendering: The report appears in the panel as the AI streams its response — you can read and scroll through early sections while the analysis is still running. The full report is available once the status shows Completed.
  • Color-coded severity indicators
  • Code blocks with proper formatting
  • Responsive design (adapts to light/dark mode — the in-app report preview automatically follows the active View → Theme setting; saved HTML files adapt to the browser’s system theme)
  • Includes server name, version, and database information
  • Footer includes the model name, reasoning effort, and analysis timestamp
  • Truncation warning banner if the AI response was incomplete

For Query Tuner, the report may also include:

  • Execution plan bottlenecks and warnings
  • Query rewrite examples
  • Query-specific index recommendations with benefit/overhead details, including the estimated size of each index added or dropped
  • Statistics recommendations tied to the referenced tables
  • Simplified visual comparisons of plan shape before/after recommended changes when that improves readability

For Locking and Blocking Analysis, the report may also include:

  • Blocking tree visualizations that show lead blocker and waiter chains
  • Deadlock or lock-order diagrams when they help explain root cause and remediation sequence

Use the horizontal splitter to resize the Console and HTML Report panels.


Saving and Exporting

Save HTML Report

  1. Click Save HTML button or use File > Save Output menu (Ctrl+S).
  2. Choose a destination folder.
  3. Enter or confirm the filename (defaults to the report HTML title converted to kebab case, for example index-tuning-salesdb-2026-05-06.html). If the title is unavailable, the app falls back to a goal-based filename.
  4. Click Save.

The report can be opened in any web browser and shared with your team.

Open in Browser

Click Open in Browser to view the current report in your default web browser. The file is temporarily saved to %TEMP%\AISQLTuner\preview\aisqltuner-preview.html.

Tip: Opening in a browser allows you to use browser features like print, zoom, and search.

Export SQL

Click Export SQL in the report toolbar to extract every executable T-SQL script from the report’s Scripts section into a single .sql file ready to run in SSMS or sqlcmd.

  • What gets exported: only the SQL inside the report’s Scripts section (<section id="scripts">). Each script is preceded by a comment derived from its <h3> heading so the output is self-documenting. Illustrative SQL fragments elsewhere in the report (in inline <code> blocks) are intentionally excluded so the exported file contains only scripts the AI explicitly recommends running.
  • Filename: defaults to the report’s HTML title converted to kebab case with a .sql extension — for example, index-tuning-report-rockypc-sqlstorm-dbo-votes-2026-05-12-03-04-35-utc.sql. This matches the Save HTML naming convention so paired .html and .sql files sort together.
  • No Scripts section? Every report produced by the current prompt includes a Scripts section, even when there are no recommended actions (in which case the section explains why). If you load an older report that lacks one, Export SQL will tell you there is nothing to export.

Safety: Always review the exported SQL before running it. Scripts may include DROP, ALTER, or UPDATE STATISTICS operations. Test in a non-production environment first.


Status Bar

A persistent footer bar at the bottom of the window shows at-a-glance information:

Segment Description
Connection dot + name Green = last test succeeded; amber = untested; grey = no connection selected. Hover for server, database, and auth details.
License pill Shows the active tier and activation state. The left pane also shows the current quota usage and reset date.
Model Shows the model the next run uses: the one selected in the MODEL dropdown, or your deployment name when your own AI endpoint is on and Primary model is set.
Run state Shows Ready, Running…, Completed, Completed (truncated), or Cancelled. Hover to see the completion timestamp of the last run.
Run count Number of analyses started since the app was launched. Resets on close.

Troubleshooting

Common problems and how to fix them. For questions about editions, quotas, models, and data handling, see the FAQ.

Connection Failed

  • Verify server name and port (default SQL Server port is 1433).
  • Check firewall rules on both client and server.
  • For Azure SQL, ensure your client IP address is allowed in the firewall rules.
  • For Azure SQL with Microsoft Entra Interactive, verify you have access permissions.
  • For Amazon RDS, ensure the instance’s VPC security group allows inbound traffic on its port from your client IP address. If the error mentions the certificate chain, install the AWS RDS certificate bundle or enable Trust Server Certificate.
  • Try enabling Trust Server Certificate for development/test environments.

System Database Validation Error

If you see an error about system databases when running Code Review, Index Tuning, or Query Tuner:

  • Edit your connection and specify a user database instead of master, tempdb, model, or msdb.
  • These goals require a user database to provide meaningful recommendations.

Query Tuner Errors

If Query Tuner fails before analysis starts:

  • Ensure Query to analyze is not blank.
  • Check the SQL for syntax errors.
  • Verify the login has SHOWPLAN, VIEW DATABASE STATE, and VIEW DEFINITION on the target database.

If the plan is returned but no user tables are found:

  • Metadata collection may be skipped.
  • The AI can still analyze the estimated execution plan itself.

Azure SQL Database Limitations

  • Fix Deadlocks goal is not available on Azure SQL Database or Microsoft Fabric SQL Database.
  • Use Code Review, Index Tuning, or Query Tuner instead, or enable Query Store for deadlock analysis.

Rate Limit Errors

With your own AI endpoint, the app does not switch to another deployment when yours is rate-limited; the run fails with the endpoint’s error. If you continue to experience rate limits:

  • Consider using a lower reasoning effort level.
  • Check your deployment’s quota in Microsoft Foundry and consider requesting an increase.

Request Too Large

If the app shows a Request too large dialog, reduce the request size and try again:

  • Lower the number of objects in Code Review.
  • Reduce the scope of the analysis by selecting a smaller database.
  • For Query Tuner, simplify the query or reduce the amount of referenced object complexity.
  • Try a lower reasoning effort level.

Truncated Report

If the console shows a truncation warning or the status shows “Completed (truncated)”, the AI response was cut short due to output token limits. The report may be incomplete. To resolve:

  • Lower the Reasoning effort level.
  • Reduce the number of objects or scope of the analysis.

“The service could not finalize the response”

This message appears in the console when the AI finished its answer but the AI SQL Tuner service failed at the very end of the run. The report that streamed in is shown and is complete. The run still counts against your monthly quota, because the analysis was delivered. Since version 3.3.1, the service retries a failed database write and no longer reports a failure to record the request as an error, so the message should be rare. If it keeps appearing, note the time of the run and contact support.

Long-running Analysis Timeout

Large runs (for example, broad Server Health scans) can legitimately run for 90–150 seconds and may take up to about 4 minutes before a timeout decision is made.

If the AI provider exceeds that service-side timeout window, the app now reports a provider timeout explanation instead of failing with a generic client-side cancellation timeout.

WebView2 Errors

If the HTML report pane fails to load:

Documentation Window

The documentation opens in a separate, resizable window. If you don’t see it:

  • Check if it opened behind the main window.
  • Look for it in the taskbar.
  • Close and reopen from Help > Documentation.

Links to web pages in the guide open in your default browser, and email links in your mail app, so the guide stays open in its window.

Release Notes Window

The release notes open in the same style of separate, resizable window when you click Release Notes in Help > About. If you don’t see them:

  • Check if the window opened behind the main window.
  • Look for a second app window in the taskbar.
  • Reopen Help > About and click Release Notes again.

Windows Server 2022 install error: Windows App Runtime missing

If you install the app by double-clicking the AISQLTunerStudio_*.msixbundle on Windows Server 2022, you may see:

Microsoft.WindowsAppRuntime.1_8 framework cannot be found

This means the Windows App Runtime 1.8 framework is not installed on the server.

Option A (recommended): Install Windows App Runtime 1.8 using Microsoft’s installer

  1. Open Microsoft’s official Windows App SDK downloads page: https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads
  2. In the Windows App Runtime section, download the Windows App Runtime 1.8 installer for your server’s architecture (x64 on almost every server).
  3. Run the installer.
  4. Retry installing the app by double-clicking the .msixbundle again.

Option B (offline / locked-down servers): Install the Windows App Runtime 1.8 MSIX packages

  1. Download the Windows App Runtime 1.8 MSIX packages (x64) from: https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads

  2. Copy these files onto the server:

    • Microsoft.WindowsAppRuntime.Main.1.8.msix
    • Microsoft.WindowsAppRuntime.Singleton.1.8.msix
    • Microsoft.WindowsAppRuntime.DDLM.1.8.msix
    • Microsoft.WindowsAppRuntime.1.8.msix
  3. Open PowerShell as Administrator, cd to the folder containing the files, then install in this order:

    • Add-AppxPackage -Path .\Microsoft.WindowsAppRuntime.Main.1.8.msix
    • Add-AppxPackage -Path .\Microsoft.WindowsAppRuntime.Singleton.1.8.msix
    • Add-AppxPackage -Path .\Microsoft.WindowsAppRuntime.DDLM.1.8.msix
    • Add-AppxPackage -Path .\Microsoft.WindowsAppRuntime.1.8.msix
  4. Retry installing the app by double-clicking the .msixbundle.

Note: Your server may require enabling MSIX sideloading/trusted app installation per organization policy.


Menu Reference

File

Item Description
Save Output (Ctrl+S) Save the current HTML report to a file
Exit (Ctrl+Q) Close the application

View

Item Description
Theme → Follow System (Ctrl+Shift+T) Use the Windows dark/light setting
Theme → Light Force the light (Paper/Teal) palette
Theme → Dark Force the dark (Graphite/Mint) palette

Help

Item Description
Manage license… (Ctrl+L) Open the license dialog to enter or update your key. In the Microsoft Store version it also lists the Pro, Team and Enterprise subscriptions and lets you subscribe
Activate with Microsoft Store Activates from the Microsoft Store purchase of the account signed in to the Store on this PC. The app does this at startup; use this item to retry, for example after buying an upgrade. See If You Bought Through the Microsoft Store
Guided Tour… (Ctrl+Shift+G) Opens the four-step introduction that appears on first launch
Check for Updates Checks for a newer version where you installed the app from. If you installed it from the Microsoft Store, it asks the Store, and Update installs the new version through the Store; Windows asks for your permission first and may close the app while it installs. If you downloaded it from aisqltuner.com, it compares your version with the latest release and Download fetches the new installer.
Documentation Opens this user guide in a separate window
About Shows the installed version number, copyright information, and a Release Notes link that opens the packaged release notes in a separate window

Keyboard Shortcuts

Shortcut Action
Ctrl+S Save HTML output
Ctrl+Q Exit application
Ctrl+R Run analysis
Ctrl+J Toggle console drawer
Ctrl+L Manage license
Ctrl+Shift+G Open the Guided Tour
Ctrl+Shift+T Switch theme to Follow System

Data Privacy

  • Connection credentials: Stored locally in %LOCALAPPDATA%\AISQLTuner\AISQLTunerStudio\connections.json, with passwords encrypted, and only if you choose to save them.
  • License token: Stored locally and encrypted under your Windows account.
  • API keys (bring your own AI endpoint): Stored locally only if the Save key checkbox is enabled, and then encrypted under your Windows account so other accounts, or a copy of the file on another machine, cannot read it. Never sent to AI SQL Tuner.
  • Where analyses go: To AI SQL Tuner’s hosted models on Microsoft Foundry in Azure, or, with your own AI endpoint, directly from your machine to your endpoint.
  • What is kept: By default, nothing. Each analysis is answered and discarded; the service records only that a request was answered, so the same run cannot be billed twice, with its report language and Windows display language. Monthly counts of requests per language, not linked to you or your license, are kept to plan language support. For Free, Pro and Team licenses, a one-way hash of the name of each SQL Server the license is used with is kept to apply the server connection limit; Delete my stored analyses does not remove these. If you turn on Keep my analyses to improve AI SQL Tuner (see Privacy), the diagnostics and report are stored against your license until you delete them.
  • Model training: Microsoft does not use this data to train its models.
  • You approve every run: The run plan lists every collector before anything is sent.

What is sent for analysis:

  • Database schema information (table and column names, indexes, constraints)
  • Query text from the plan cache, Query Store, or the code objects you review
  • Query text entered manually for Query Tuner
  • Estimated execution plan XML and plan warnings for Query Tuner
  • Performance statistics (waits, I/O, execution counts)
  • Configuration settings
  • The report language and your Windows display language, recorded by the service for language statistics (not sent with your own AI endpoint)
  • A one-way hash of the name your SQL Server reports for itself, sent with every analysis (your own AI endpoint included) so the service can apply your edition’s server connection limit. The service keeps the hashes of the servers a Free, Pro or Team license is used with; it never receives the server name

What is never sent:

  • Table data or query results
  • Passwords or credentials
  • Personal identifying information (unless present in object names or query text)

See also how AI SQL Tuner protects your privacy.


AI SQL Tuner Studio User Guide FAQ

What SQL Server versions does AI SQL Tuner Studio support?

SQL Server 2016 and later, including on-premises installations, Azure SQL Database, Azure SQL Managed Instance, Microsoft Fabric SQL Database, and Amazon RDS for SQL Server (Standard, Enterprise and Developer editions; Express and Web editions on RDS are not yet supported). Every edition, including Free, supports every platform.

Do I need an Azure OpenAI account to use AI SQL Tuner Studio?

No. By default, analyses go to AI SQL Tuner’s hosted models on Microsoft Foundry, so you can start immediately without any Azure setup. On Pro, Team, and Enterprise you can optionally bring your own AI endpoint; analyses on your own endpoint don’t count against your monthly quota.

Is my SQL Server data sent to third-party servers?

AI SQL Tuner Studio sends diagnostic metadata, such as query text, execution plans, index statistics, and configuration, to the AI model you use: AI SQL Tuner’s hosted models on Microsoft Foundry in Azure, or your own endpoint. It never sends table data, query results, passwords, or credentials. Analyses are not kept unless you opt in. See Data Privacy.

What is the difference between the tuning goals?

There are six. Server Health Check reviews the whole instance. Index Tuning recommends index changes across a database. Query Tuner analyzes one query and its execution plan. Code Review checks stored procedures, functions, triggers, and views. Fix Deadlocks reads your deadlock history and rewrites the code involved. Locking and Blocking Analysis explains what is blocking right now. See Tuning Goals.

How do I choose the right reasoning effort level?

Start with Medium, the default; a report usually takes about a minute. Low is faster but gives much weaker advice for Code Review. Use High (Pro, Team, and Enterprise) when a Medium report misses a root cause you can see in the data; it takes two to three times as long. If a report is cut off, narrow the scope or lower the level. See Reasoning Effort.

Can I run AI SQL Tuner Studio on Windows Server 2022?

Yes, from the aisqltuner.com download; Windows Server does not include the Microsoft Store. Run Install-AISQLTuner.ps1 from the release as Administrator: it installs the Windows App Runtime 1.8 and VCLibs the app needs, then the app. To install by hand, see Windows Server 2022 install error.

Should I install from the Microsoft Store or from aisqltuner.com?

Either works on Windows 10 and 11, on x64 and ARM64 PCs. The Store installs the prerequisites and keeps the app updated, and activates from a Store purchase; the download needs a license key and is the only option on Windows Server. Install from one place only: the two are separate apps to Windows, and one does not update the other. See Installing.


Support