Translated from the Korean original. Some screenshots show the original Korean interface.
Why AI tuning proposals are hard to apply right away
When a SQL statement has a performance problem, it is now common to hand it to an AI along with its execution plan before doing anything else. Within seconds the AI tells you to add an index or insert a hint, and it explains why. The numbers show the same trend. In Redgate's 2026 report, based on a survey of 2,162 practitioners and executives, the share of respondents using AI for database management rose from 15% the previous year to 44%.
But practitioners tend to hesitate when it is time to apply the change to the production DB. An answer can look plausible and still need to be checked separately. In the 2026 Stack Overflow Developer Survey, 48% of respondents said they trust AI output "when it is easy to verify," while only 6.6% said they trust it for important business decisions.
AI tools that connect to a database and act on it also come with an approval step before execution. For example, GitHub Copilot agent mode in SSMS can run queries and analyze execution plans, but by default it asks for user approval before running each query or command. Having an approval step is not the same as having verified that the suggestion is sound. The reviewer needs evidence to decide whether approving is safe.
A SQL tuning proposal is hard to judge just by reading it. For the same SQL, the execution plan the optimizer picks can change with the table's data volume and distribution, its statistics, and the bind variable values. When a proposal rewrites the SQL, it is also hard to be sure from the text alone that it returns the same result as before. A tuning proposal from an AI is no different: without results from running and verifying it in that environment, it is not enough to justify a production change. So before deciding to apply a change to production, you need to check the following 3 things.
- Result match: When run with the same data and bind values, do the SQL before and after the change return the same result?
- Measured performance: Under the same verification conditions, are the actual execution metrics of the changed SQL better than those of the original?
- Index impact: How does a new index affect the execution plans and performance of other SQL that references the same table?
Index impact in particular is hard to judge by looking only at the SQL being tuned. A new index can also change the execution plans of other SQL that references the same table. You therefore have to compare the execution plans of the related SQL, and if any of it gets slower, review the scope, the execution frequency, and the business importance together. The more related SQL there is, the heavier this check becomes.
ExTuner AI is a SQL tuning automation solution that builds these 3 checks into the tuning process. The AI analyzes high-load SQL, creates tuning proposals, and checks result match, measured performance, and index impact on a separate verification DB, not on the production DB. The reviewer looks at this evidence together with the tuning proposal and decides whether to approve it.
1. Creating tuning proposals: from extracting top-load SQL to measuring alternatives
ExTuner AI connects everything from finding the SQL to tune to generating alternatives and running them for comparison into a single flow. It collects top-load SQL into a job queue, creates tuning alternatives for each SQL, then runs them on the verification DB and compares them. The operations overview screen shows the waiting SQL, the progress of each job slot, and the list of processed SQL at a glance.

1-1. Selecting tuning targets: automatic extraction of top-load SQL
Instead of finding tuning targets by hand every time, you can set a schedule that repeats daily or weekly. At the scheduled time, ExTuner AI queries execution statistics from V$SQL and AWR on the production DB, picks out the top-load SQL by metrics such as Elapsed Time or CPU Time, and puts it in the job queue. In environments where AWR is not available, it can collect from V$SQL alone. SQL registered as an exception and SQL that has already been tuned are excluded from collection to reduce duplicate analysis.
V$SQL is a view that provides execution statistics for the SQL cursors in the shared SQL area. AWR is a repository that periodically collects and stores performance statistics, so you can look up the past execution statistics of the SQL it has captured. Querying SQL statistics through AWR requires an Oracle Diagnostics Pack license.
Besides scheduled collection, you can also request tuning for a specific SQL. Select a SQL from the list, check its execution plan, performance trend, and bind variables, and then request tuning. For SQL that is not in the list, enter it directly and specify the bind values needed to run it. This lets you check not only SQL that is under heavy load now but also new SQL that is about to be deployed to production, on the verification DB.
SQL in the job queue is processed in the order it was registered, whether it came from scheduled collection or an individual request. If a SQL needs to be looked at first, the reviewer can change its position in the queue, and can also pause jobs when needed.
1-2. Generating and measuring alternatives: comparing proposals with different strategies
When tuning starts, the AI analyzes the execution plan and statistics to find the bottleneck, then combines index additions, hints, and SQL rewrites to create alternatives that take different approaches. The optimizer's estimated cost is calculated from statistics and can differ from reality, so ExTuner AI runs each alternative directly on the verification DB and compares the actual execution metrics.
The recommended alternative is chosen by Buffer Gets. Buffer Gets is the number of blocks read logically while the SQL runs. ExTuner AI compares Buffer Gets across the alternatives and marks the one with the lowest value as recommended. Keeping in mind that this recommendation is based on logical block access, the reviewer also looks at other measured metrics such as Elapsed Time to judge the change in performance.
Buffer Gets is also the criterion for classifying whether there was an improvement. If no alternative reduces Buffer Gets by 1% or more compared with the original SQL, the result is marked "No improvement." Here, "No improvement" means that no alternative met the Buffer Gets reduction criterion, and the tuning list counts it separately from tuning completed, failed, and canceled.
While alternatives are being generated and measured, the job slot shows what is currently running. It reports progress with messages such as "Generating an improved version with adjusted indexes and join order." When the job finishes, the reviewer checks the result in the tuning list and selects the tuning proposal to review in the next step.
2. 3 grounds for approval: result match, measured performance, index impact
A recommended alternative does not go straight to production. It was chosen by the Buffer Gets measured on the verification DB, so the reviewer has to look at result match, the other measured metrics, and the impact on related SQL before deciding whether to apply it to production. The review screen puts everything needed for that decision in one place: the Before/After SQL, the execution plans, the measured results, whether the results match, and the AI's explanation of why it made the change. So even when the requester and the approver are different people, they review the same evidence.
2-1. Result match and measured performance: Before/After comparison

First, check how the target SQL changed. When you open a tuning proposal, the recommended alternative and the other alternatives appear as separate tabs, and each alternative comes with an explanation of what was changed and why. The reviewer reads this explanation and the comparison results, then reviews the recommended alternative or picks a different one. There are two key things to review.
- Result match: ExTuner AI runs the SQL before and after tuning with the data and bind values used for verification and compares the entire result. An alternative whose result does not match is not shown as a tuning proposal.
- Measured performance: It compares Buffer Gets, Elapsed Time, and other metrics measured on the verification DB. The execution plans are also shown side by side as Before/After, so you can look at changes in join methods and access paths along with the measured metrics.
To see the change in detail, look at the color-highlighted lines in the Before/After SQL. You can find the modified parts without rereading the whole of a long SQL statement, and the Plan Diff button lets you compare the differences between execution plans as well.
2-2. Index impact: changes in the execution plans and performance of SQL that references the same table

Even after you have checked the result and performance of the target SQL, a proposal that adds an index needs more review. A new index can also affect the execution plans of other SQL that references the same table. From the SQL collected on the production DB, ExTuner AI finds the queries that reference the table and compares their estimated execution plans before and after the candidate index is applied. To do this, it temporarily creates the candidate index on the verification DB as an Invisible Index and checks how the execution plans change under different index usage settings.
A SELECT statement whose estimated execution plan changed is run once before and once after the index is applied, and the performance is compared. SQL whose estimated execution plan stays the same is classified as "No impact" without a comparison run. Here, "No impact" means that no change in the estimated execution plan was found. It does not mean that a comparison run confirmed there was no change in performance.
An Invisible Index is an index that the optimizer does not use by default. When the OPTIMIZER_USE_INVISIBLE_INDEXES setting is turned on during verification, the optimizer considers this index as well when it builds the execution plan. This makes it possible to see how the execution plan changes depending on whether the candidate index is used.
The analysis results are divided into "Degraded," "Not measurable," "Improved," "No change," and "No impact." SQL whose estimated execution plan changed is classified by the increase or decrease in Buffer Gets after the comparison run, and it is marked "Not measurable" when the run could not be completed.
The comparison run uses the most recently captured bind values. For SQL whose comparison run completed, Buffer Gets and Elapsed Time are measured values taken before and after the index was applied.
The reviewer can narrow down the SQL to review using the tab for each category, then look at the measured metrics and execution frequency of each SQL to judge the impact of the index. SQL classified as degraded in particular should be reviewed with its business importance in mind.
The index created for verification is dropped automatically when the analysis ends, and no DML that changes data is run during the analysis. This analysis checks changes in the execution plans and performance of the collected queries, so the processing overhead that the added index puts on INSERT, UPDATE, and DELETE and the storage space it takes must be reviewed separately before applying it to production.
2-3. Approval and history: the reviewer's decision and the recommendation document
After reviewing the verification evidence, the reviewer chooses one of three actions: approve, retune, or reject. If more verification or a different approach is needed, the reviewer requests a retune, and if the proposal does not suit the production environment, the reviewer can reject it. Permission to request tuning and permission to approve can be granted separately, so the request and the final decision can be assigned to different people.
ExTuner AI provides a recommendation document so that a reviewed tuning proposal can be used in your existing change management process. It can be downloaded from the recommendation screen as a Markdown .md file, and it puts the SQL and execution plans before and after tuning, the performance comparison, the cause analysis, and the index information needed to apply the change in one document. The reviewer can attach this document to the change management record or share it with the team. Approving a proposal in the product does not apply it to the production DB automatically. An approved tuning proposal is applied through your existing production release process.
Approval and rejection results are recorded along with who handled them. Tuning run results are also kept as a per-SQL history, and each entry records the SQL, execution plan, and performance figures at that time, and the requester. This lets you check later when and how many times the same SQL was tuned, how performance changed in each round, and the approval and rejection records.
3. Protecting the production DB: a separate verification environment and in-house data processing
To run and compare multiple tuning alternatives and related SQL, where the verification work runs also matters. If you measure directly on the production DB, the repeated SQL runs and the creation of candidate indexes can put load on the service.
ExTuner AI recommends a configuration in which collecting information from the production DB and running and measuring tuning proposals happen on different DBs. In this configuration, it queries the production DB for the information needed to select and analyze tuning targets, and it runs the SQL of the tuning alternatives and creates candidate indexes on a development or staging DB that the customer designates. The dedicated account that connects to the production DB is not granted object creation privileges such as index creation.
At the top of the result comparison screen, the target instance and the execution instance are shown separately. The reviewer can see which DB the SQL was collected from and which DB it was verified on. The query timeout value and whether Invisible Index creation is allowed are also shown, so the measured results can be read together with the verification conditions.

A timeout is applied to verification SQL, and module tagging is used to identify and manage verification work. For the verification results to be useful in deciding on a production change, it is best to keep the verification DB's data volume and distribution, statistics, and main execution conditions close to those of the production environment.
Besides where the verification runs, where the AI processes information also matters. ExTuner AI installs every component, including the AI model, on-premises inside the customer's environment. AI inference and SQL verification also run inside that environment, and the SQL, execution plans, statistics, bind values, and other data used in the process are not sent outside.
4. The basis for tuning proposals: EXEM consulting cases and stage-by-stage review
The measurement and impact analysis described above are steps for verifying a tuning proposal once it has been created. So what knowledge and criteria does the AI use to analyze bottlenecks and create alternatives in the first place?
ExTuner AI uses the tuning cases that EXEM's DB performance consulting organization has built up over more than 20 years in finance, the public sector, and telecom for analysis and for generating alternatives. These cases are organized into a knowledge base together with DBMS knowledge and execution plan patterns, and the AI refers to it to analyze bottlenecks and work out a tuning direction. The results of tuning done at a customer site are also accumulated in that customer's internal knowledge base and serve as reference for later tuning.
Consulting experience is also built into the review of how alternatives are created. Review criteria defined by consultants are applied at the analysis, SQL tuning, and tuning review stages, and the output of each stage has to pass those criteria before the process moves on to the next stage.
The whole process has 7 stages: tuning request intake → information collection → analysis → SQL tuning → tuning review → execution verification → recommendation review and approval. The system performs everything from request intake to execution verification automatically, and within that, LLM agents handle analysis, SQL tuning, and tuning review. The final stage, recommendation review and approval, belongs to the reviewer.

Alternatives that pass review during generation then go on to verification by actual execution. Consulting knowledge and stage-by-stage review are the basis for creating alternatives, and the decision to apply a change to production also needs verification evidence confirmed by actual execution.
5. How tuning operations change: from reactive response to regular management
As we have seen, approving an AI-generated tuning proposal takes both the proposal itself and the verification evidence that backs it up. ExTuner AI delivers the verification results for result match, measured performance, and index impact together with the tuning proposal. It automates the repetitive analysis and verification work, and the reviewer looks at the verification conditions and results to decide whether to apply the change to production.
With less repetitive work, tuning targets can be managed more consistently. In addition to responding to SQL that has caused a problem, you collect and review top-load SQL on a regular basis. The same procedure can be applied to new SQL scheduled for deployment, so its execution plan and measured metrics can be checked before it goes to production.
For regular management, keeping a record of the grounds for each decision matters too. The tuning history and recommendation documents keep the proposed changes and verification results for each round. The approval and rejection records are available as well. If you manage these together with the record of what was actually applied to production, you can go back to the changes and the grounds for the decision when performance shifts later.
ExTuner AI connects alternative generation, verification, review and approval, and history management into a single flow. The reviewer can review and approve a tuning proposal based on what change was proposed, under what conditions result match and measured performance were verified, and what impact there was on other SQL.
FAQ
Q1. Which environments are supported?
ExTuner AI supports single-instance and RAC environments on Oracle Database 11gR2 or later, Enterprise Edition. Every component, including the AI model, is installed on-premises inside the customer's environment, and it can also be installed in air-gapped networks.
Q2. How is load on the production DB reduced?
We recommend a configuration in which information collection and the running and measuring of tuning proposals happen on different DBs. In this configuration, ExTuner AI queries the production DB for the information needed for analysis, and runs tuning proposals and creates candidate indexes on a development or staging DB that the customer designates.
The dedicated account that connects to the production DB is not granted object creation privileges such as index creation. The scheduled information collection can be moved to hours when the business load is low.
Q3. Does the AI apply tuning proposals to production automatically?
No, it does not. The reviewer looks at the verification conditions and results and decides whether to approve, and the production change follows your existing change management process. The tuning proposal and verification results can be downloaded as a Markdown .md recommendation document.
Q4. How does it tune, and how is the recommended alternative chosen?
It combines index additions, hints, and SQL rewrites to create alternatives that take different approaches. It runs each alternative on the verification DB and marks the one with the lowest measured Buffer Gets as recommended. The reviewer also looks at other measured metrics such as Elapsed Time to judge the change in performance.
Q5. What does "No improvement" mean?
It means that no alternative reduced Buffer Gets by 1% or more compared with the original SQL. Even if Elapsed Time went down, a result can be classified as "No improvement" if it does not meet this criterion. Failed or canceled jobs are shown in the tuning list with their own status.
Adopt ExTuner AI and apply tuning proposals to production after result match, measured performance, and the scope of impact have been checked.
👉🏻 Contact us about ExTuner AI
Sources
2026 State of the Database Landscape - Redgate AI trust - 2026 Stack Overflow Developer Survey GitHub Copilot Agent Mode in SQL Server Management Studio - Microsoft Learn Managing Indexes - Oracle Database Administrator's Guide 19c Spending a Whole Day Tuning a Slow Query? When You Need AI SQL Optimization - EXEM (2026.03.13) (Korean)
Related articles

