Hi!
We are using Metabase v0.45.3 deployed on AWS ELB. Metabase is connected to AWS RDS MySQL v8.0 database.
We've noticed issues with the display of visualisations as there's a long SQL query execution. From logs we see that "SQLTimeoutException" happens after 60s.
SQL query is quite simple and table fields are properly indexed.
Here's the query:
SELECT `order`.`country` AS `country`, count(*) AS `count`
FROM `order`
WHERE (`order`.`date_order_created_at` >= date(date_add(now(6), INTERVAL -30 day)) AND `order`.`date_order_created_at` < date(now(6)))
GROUP BY `order`.`country`
ORDER BY `order`.`country` ASC
We've found out that if we remove the ORDER BY part, query execution is like 20x times quicker. Execution finishes in few seconds instead of a minute and more.
As the visualisation is of a Map type, there's no need for order anyway.
Temporary we have set higher nginx timeouts so the query execution doesn't get terminated.
Why is ORDER BY now automatically added to those type of queries?
Regards,
Miha P.