We had a problem in our production environment where the Prometheus `auto_increment` schema queries that run once a minute in PMM bogged down during heavy load so that they were taking longer than a minute to run. They eventually swamped the database with more and more sessions running the query.
This problem of this query running very slowly has happened to others, as described here:
We found that this query can run about 100X faster in our environment if we put the `columns` table first, `STRAIGHT JOIN`ed to the `tables` table. [Our environment has 7 schemas, 840 tables, 41,000 columns.]
I'd like to submit a Pull Request to make this standard in PMM, but I couldn't find where in the project this Prometheus query lives? If this looks reasonable, perhaps can you point me to that and I'll make a PR? (I can find the query in the native `prometheus` repo here, but it's slightly different, with `USING` on the join.
So I'm wondering if there is a copy with this slight variation included in PMM?)