Edit an SQL query without having to run it


I’m a bit stuck at the moment, basically one of our analyst unearthed a very old SQL, that was running fine 2 years ago, when our database was 1% of the number of rows it is today, which is not the case now…

Basically it blew up the CPU usage of our database which means that we were not able to do any tasks where we needed to request this database.

When I caught which request was making a mess I promptly killed it.

With a few modifications the problematic request can be running fine, however opening it directly in Metabase causes it to run automatically, triggering the same mess I just fixed.

My question is: is there a straightforward way to edit queries without having to run them from inside metabase ?

My alternative solution, which I don’t really prefer is to directly connect to the metabase db, and edit the corresponding question there

Thanks in advance, let me know if I need to be more precise on certain points !

Edit: I did not specify, Metabase is requesting a MySQL database. Metabase version is running on 0.33.3

I don’t know if there’s a clever way, but you could create a 2nd smaller version of your MySQL database. Change the connection in Metabase, edit the query (now running against a small database), then change the connection back to the live database.

1 Like