See what tags history queries are looking at

Is there a way to tell which tags history queries are looking at? I’m continuously filling up the database connections on one of my gateways and I’m not sure where all of these history queries are coming from. If I could see that I could probably track it down in the project easier.