|
|
|
|
|
by wrwatson
1897 days ago
|
|
I am called apon to investigate database performance problems.
Teams using Hibernate sometimes send me the Hibernate query. This is not enough to understand the SQL which has been issued.
I would also need to see all the entity objects, and maybe some configuration parameters. Without the SQL, which nobody can exactly predict, it is difficult to performance tune. So they turn on logging, get the SQL, and email that unreadable mess. In most of the cases I have seen, the SQL is fetching much more from the database than what the code really needs. The first step when optimising SQL is to only ask for data that you actually need. Hibernate, as I have seen it used, defaults to fetching too many columns. I cut the SQL down, and come up with a performant statement. The developer has the challenge of translating the performant SQL back into Hibernate. Hibernate makes easy things easier and harder things harder. |
|