Our DBA just came back with a long running query against our SQL server database. He thought we should review that query and see if we could optimize.
The problem is that the query doesn’t come from our application code. It is loading a number of records from a single table by their primary key, nine to be exact, and we NEVER have any queries to that table by primary key from our application. It is also definitely a hibernate query by the name mangling that hibernate does and the loading of all of the properties.
So I’m wondering if hibernate does some predictive caching, like pulling records it thinks I might want later. Any input on this?
Thanks.
This is probably a query that is executed due to batch fetching: