That’s a good thing that you could reproduce the slow query behavior.
In my case, however, the behavior is a little different. I have no slowdown to access the Media Librairy. And I tried to restart strapi but it doesn’t solve the slowness in requests.