Skip to main content

AI database optimizer for Aiven for PostgreSQL®

Use Aiven AI Database Optimizer to receive optimization suggestions to your databases and queries.

Aiven's artificial intelligence considers various aspects to suggest optimizations, for example query structure, table size, existing indexes and their cardinality, column types and sizes, and the connections between the tables and columns in the query.

To optimize a query automatically:

  1. In the Aiven Console, open your Aiven for PostgreSQL® service.

  2. Click AI insights.

  3. For the query of your choice, click Optimize.

  4. In the Query optimization report window, see the optimization suggestion and apply the suggestion by running the provided SQL queries.

    • To display potential alternative optimization recommendations, click Advanced options.
    • To display the diff view, click Query diff.
    • To display explanations about the optimization, click Optimization details.
note

The quality of the optimization suggestions is proportional to the amount of data collected about the performance of your database.

Frequently asked questions

Does Aiven AI Optimizer mask/obfuscate my queries?

Yes, Aiven AI Optimizer provides a non-intrusive solution to optimize your database performance without compromising sensitive data access. It achieves this by gathering information on schema structure, database statistics, and other signals to detect potential performance problems and offer optimization recommendations, without requiring credentials or access to the actual data in the database.

To address the possibility of slow query logs containing sensitive data, Aiven offers data masking capabilities that replace sensitive parameters within queries with question marks (?). Data masking is enabled by default.

note

The masking option is not available for the Standalone SQL query optimizer yet.

For one-time query optimizations when you do not run an Aiven for PostgreSQL® service, use the standalone SQL query optimizer.