| Query Optimization Report (original query)
Optimize these views for optimal performance ...
The following views are used in this query. Optimizing the internals of the views is crucial for this query's optimal performance. Click on the view names to optimize them.
The optimal indexes for this query are ...
By default, the database cannot use indexes on columns used as function parameters, e.g. MONTH(date) = 5.
You can index the these statements by creating and indexing virtual columns:
Please create these indexes before executing the optimized query:
The following indexes already exist in your database and were found as useful for optimal query performance:
You're out of optimization credits
Upgrade now to get database super powers.
Query rewriting Optimal indexing AI-powered insights
Advanced capabilities for Plus and Enterprise customers
Our advanced capabilities and insights are available for Plus and Enterprise subscribers.
Please consider upgrading to unlock these advanced capabilities.
Advanced capabilities for Plus and Enterprise customers
Our advanced capabilities and insights are available for Plus and Enterprise subscribers.
Please consider upgrading to unlock these advanced capabilities.
Advanced capabilities for Enterprise customers
360° indexing insights are available for Enterprise subscribers.
Please consider upgrading to unlock this advanced capability.
Optimizing a SQL query
Tell us about your database:
Please submit the query you would like to optimize:
Our AI-powered optimizer is far more accurate when provided with the database schema & statistics. Please export the metadata and submit the output file below.
* The information you provide is encrypted and protected. Learn more on our security page.
For optimal recommendations, please submit the schema's structure and statistics. Retrieve them easily by executing this query in your database:
Copy SQL query to fetch schema structure & statistics (no data)Execute the query in your DB and paste the output here, or upload as a file.
You're missing out! Users who submit their schema & statistics get up to 60% better recommendations.
Query Performance Trend
Database Performance Trend
Resubmit a query for optimization
Please adjust the query's syntax and re-submit it for optimization:
Installing EverSQL Performance Sensor
EverSQL performance sensor will track your databases slow query logs on an on-going basis and generate personalized optimization insights for you automatically. You can use the performance sensor with MySQL, MariaDB and Percona databases.
Step 1: Enable the slow query log
The performance sensor requires slow query logs to be enabled.
Click here for instructions if you don't have them enabled.
To enable slow query logs, please add the following parameters to MySQL's configuration file. By default, the configuration file is at /etc/my.cnf, or at /etc/mysql/my.cnf.
[mysqld]
slow_query_log=1
long_query_time=1 # Logs queries longer than 1 second
log_output=FILE
slow_query_log_file=/var/lib/mysql/slow.log
To apply the changes, please restart the database (requires short downtime):
sudo /etc/init.d/mysql restart
Step 2: Install the performance sensor
To install the performance sensor, please run the following commands.
If your slow query log file is not at /var/lib/mysql/slow.log, please modify the path below.
curl https://www.eversql.com/install/ubuntu_18_04 > install_sensor
sudo bash -x install_sensor /var/lib/mysql/slow.log
Once installed, the sensor will start collecting slow queries within up to 30 minutes.
EverSQL performance sensor will track your databases slow query logs on an on-going basis and generate personalized optimization insights for you automatically. You can find more information here.
You can use the performance sensor with Amazon RDS MySQL / RDS MariaDB / Aurora MySQL databases.
Step 1: Enable the slow query log
To enable slow query logs on your database instances, please follow the 'Enable slow query log' section here.
Once you're done editing the parameter group and assigning it to your instance, please make sure you restart the database to apply the changes (may require downtime).
Step 2: Install the performance sensor
You can now deploy the performance sensor from the Amazon Serverless Application repository.
Your personal API key (required as part of the installation):
Once installed, the sensor will start collecting slow queries within up to 30 minutes.
EverSQL performance sensor will track your databases slow query logs on an on-going basis and generate personalized optimization insights for you automatically.
You can use the performance sensor with Cloud SQL MySQL / Cloud SQL PostgreSQL databases.
Step 1: Enable the slow query log
To enable slow query logs on your Cloud SQL instances and redirect them to a Cloud Storage Bucket, please follow the instructions here.
Once you're done editing the parameter group and assigning it to your instance, please make sure you restart the database to apply the changes (may require downtime).
Step 2: Install the performance sensor
To install the performance sensor, please run the following commands in your GCloud CLI.
Please make sure to configure the following in the commands before executing them:
* GCP_FUNCTION_NAME: Name the sensor (alphanumeric and dashes allowed).
* GCP_REGION: The region where your Cloud SQL instance is located (example: us-central1).
* GCP_PROJECT_ID: Your GCP project ID.
* GCP_BUCKET_NAME: The name of the bucket you created in step #1 above.
* SERVER_NAME: The name of this instance as will be shown on EverSQL.
curl -sSL -o eversql_gcp_sensor_installation.zip https://www.eversql.com/install/eversql_gcp_sensor_installation.zip
unzip eversql_gcp_sensor_installation.zip -d eversql_gcp_sensor_installation/
gcloud functions deploy GCP_FUNCTION_NAME --project=GCP_PROJECT_ID --region=GCP_REGION --trigger-resource=GCP_BUCKET_NAME --set-env-vars="server_name=SERVER_NAME,api_key=" --runtime=python39 --memory=1024MB --timeout=600s --entry-point=main_func --source=eversql_gcp_sensor_installation --trigger-event=google.storage.object.finalize
Once installed, the sensor will start collecting slow queries within up to 30 minutes.
Visualize & optimize queries from slow query logs
EverSQL Slow Log Analyzer will analyze your MySQL and PostgreSQL slow query log files and visualize them in a timeline, to allow you to quickly locate the queries to optimize.
Which server did this log file originated from?
Please submit a MySQL or PostgreSQL slow query log (How?):
Hide | Query Fingerprint | Duration Sum (Sec.) | Duration Avg (Sec.) | Count | Trend | Trend | Tags (Automate ) | Last Seen | Status | Actions |
---|
Best practices for optimal performance
The slow query:
Hi, what would you like to do today?
Amazon RDS
Amazon EC2
GCP Compute
GCP SQL
Azure VM
Azure DB
Aiven
Self-hosted / Other
Jammy (v22.04) - beta
Focal (v20.04)
Bionic (v18.04)
Xenial (v16.04)
Bullseye (v11)
Buster (v10)
Stretch (v9)
Redhat
Ubuntu
Centos
Debian
Fedora
Amazon Linux
Windows
Other OS
Native SQL
TypeORM (Node.js)
Primsa (Node.js)
Sequelize (Node.js)
Bookshelf (Node.js)
Django (Python)
SQLAlchemy (Python)
GORM (golang)
Hibernate (Java)
JOOQ (Java)
MyBatis (Java)
EntityFramework (.NET)
Doctrine (PHP)
Eloquent (PHP)
I don't know
Other ORM framework
Optimize a single SQL query
Analyze why my database is slow