The AI slow query advisor reviews a slow MySQL or MariaDB query and explains why it is slow and how to fix it. Add the EXPLAIN output and the table definition for the best answer: the advisor reads the access type, chosen key and row estimates and proposes exact ALTER TABLE statements with the column order explained.
AI answers can be wrong. Read every command before you run it, and test on a non-production server first. Your input is sent to our AI provider (srvScripts AI) to write the answer. srvScripts does not log your input; the answer, which can quote it, is cached for 24 hours so a repeat question is answered instantly. See the privacy policy.
Table of Contents
Typical wins are WordPress postmeta lookups, WooCommerce order searches, reporting queries that sort large tables and joins missing a composite index.
How to use the AI slow query advisor
- Pick MariaDB or MySQL 8.
- Paste the query from the slow log.
- Optionally paste EXPLAIN (or ANALYZE FORMAT=JSON) and SHOW CREATE TABLE output.
- Press Analyze query, test the index on a copy or off-peak, and compare EXPLAIN before and after.
What you get
- A diagnosis citing the EXPLAIN rows, type and key.
- Exact index statements with reasoning and a warning about write cost and online DDL on large tables.
- A rewritten query when that helps more than an index.
- How to verify the improvement.
Worked example
Example: a WooCommerce product search filters wp_postmeta on meta_key and a numeric meta_value and takes eight seconds. With EXPLAIN pasted, the advisor points out the full scan on meta_value, suggests a composite index on (meta_key, meta_value(32)), notes the write cost on a large table and shows the EXPLAIN change to expect.
Tips for better answers
- Remove customer data from literal values if you prefer — the structure is what matters.
- Find slow queries first: see slow queries in MariaDB 11 and 12.
Related guides: InnoDB tuning for shared hosting and fixing too many connections on cPanel.
Privacy and limits
Before anything is sent, srvScripts removes private keys, passwords, tokens and API keys it recognises. With the box ticked it also swaps public IP addresses and e-mail addresses for placeholders, which lowers the risk when you paste real logs. The masking is automatic and best effort: it can miss names, hostnames, keys or other customer details, so remove anything confidential before you paste. Your text goes to our AI provider only to write the answer. srvScripts does not save your input as a record of its own, but the masked input is sent to the AI provider to produce the answer, and the answer, which can quote parts of your input, is cached on our server for 24 hours so a repeat question is answered instantly, and is then deleted. The provider’s own API data terms apply to what it receives. Without an account you get 5 runs a day, a free account gets 15 and srvScripts Pro 200, with larger inputs.
At a glance


Official documentation: MariaDB slow query log, MySQL EXPLAIN output format.
Frequently asked questions
Is it safe to add the indexes the AI slow query advisor suggests?
Indexes speed up reads but slow writes and take time to build on big tables. Add them off-peak, ideally with online DDL, and test first.
Does it need my data?
No. The query, EXPLAIN output and table definition are enough.
Does it work for PostgreSQL?
It is tuned for MySQL and MariaDB; PostgreSQL answers may be less precise.