Skip to main content

Query and analyze data in Aiven for MySQL®

Create databases and tables, tune queries, and use AI-powered tools to work with data in your Aiven for MySQL® service.

How data management fits together

Primary key requirements and foreign key checks are both schema-level defaults that you can turn off for a single session, rather than changing the setting for the whole service. Slow query logging and the AI database optimizer also read from the same underlying log destination setting, so turning one on doesn't require a separate, unrelated step to turn on the other.

Things to know

  • The requirement isn't retroactive: mysql.sql_require_primary_key blocks you from creating a new table without a primary key, but tables that existed before you turned it on can still be missing one. Add a primary key to a table that predates the requirement rather than assuming the setting already covers it.
  • Choose where slow query data lands: the mysql.log_output parameter decides the destination. Set it to TABLE for the mysql.slow_log table, INSIGHTS for the AI database optimizer, or INSIGHTS,TABLE to send data to both at once.
  • Cap execution time proactively: instead of relying only on manually stopping a long-running query, you can set mysql.max_execution_time in the advanced parameters so read-only SELECT statements stop automatically once they run too long.

Related pages