Using AI to Optimize Your SQL Code
If enabled for your account, you can use LiveRamp Clean Room's AI features to generate suggested improvements to your SQL code. This can help improve the performance of your queries in the context of distributed in-memory processing via Spark. This can help to reduce the processing time of your Question runs.
The recommendations are displayed in your run report once you run your query. The "Query Plan" shows which parts of your code could be optimized for platform efficiency and technical alignment, such as SQL functions, JOIN operations, resource sizing, and overall query structure.
Note
LiveRamp Clean Room's AI tool bases its recommendations on historical run performance data and code characteristics. It does not use your SQL code as training data.
These AI-generated suggestions are intended as guidance, not definitive solutions. LiveRamp has attempted to restrict the advice to supported optimizations. However, AI can make mistakes and some suggestions may not be supported by LiveRamp Clean Room's Spark implementation.
On the Questions page, select Report → View Reports for the question.

The Question Runs page displays the recent question runs.
In the row for the question run that you want to analyze, click .

The report run page displays the question's runtime parameters and a table of its results.
Click .

The Query Plan page summarizes the steps that Spark SQL took to run the question.
In the Optimization Strategies section, click .

After analyzing your query, the following sections are displayed:
Analysis Summary: A high-level summary of the subsequent sections
Performance Bottlenecks: Describes any significant limitations inherent in the logical structure of your query.
Optimization Strategy: Describes the proposed strategy, such as structural simplifications.
Optimized Query: A code block with an optimized version of your query.
Implementation Risks: Lists any possible impacts, such as resource utilization.

Consider the suggestions and copy them if you need to refer back to them. Depending on the context, the AI helper might also provide code to copy and paste into your question builder editor for further testing.
Note
For more information and best practices, see "SQL Guidelines".