I have a query which runs in about 6ms in DBeaver and I used the general log to extract the query that is being passed in which is the same database that my Tomcat server is connected to
select min(organizati0_.Downloaded) as col_0_0_ from oss_collection_history organizati0_
where organizati0_.AccountingSystem='SomeSystem'
and (organizati0_.Org in ('ID1' , 'ID2', ..., 'ID10' ))
On a JUnit test running Spring Data JPA against a Dockerized copy of the database, the query also runs quite fast 60ms, but on Tomcat it takes upwards of 8-10 seconds.
So not exactly sure what's going on.
I just do this to profile the function call using the same parameters.
var start = System.currentTimeMillis();
consolidatedDownloadSvc.getAvailableYearsOfDownloadedForAccountingSystem(...);
System.out.println(System.currentTimeMillis() - start);
It does not appear on slowlog even if I set global log_queries_not_using_indexes = 'ON';
so that would indicate to me that the query is indexed.
So I was wondering if there's some sort of log that will show me any extra things I may be missing in Spring-Data and Hibernate.