DCookie, OMG, and APC get +1 for their responses. I was on the side of Hibernate DBA applications, and, as Tom Kit says, there is no “fast = true” parameter that can lead to inefficient SQL and speed up its work. From time to time, I managed to collect the problematic Hibernate query and use the Oracle SQL parser to create an SQL profile for this statement, which improves performance. This profile is a set of hints that “intercept” the creation of the optimizer of the execution plan and make it (without changes in the application) for the better, which for some reason is usually ignored by the optimizer. However, this data is the exception rather than the rule for poorly executed SQL.
One thing you can do as a developer who apparently understands the data better than the ORM layer is to write effective views to solve specific query problems and present those views in Hibernate.
Of particular note are the Oracle DATE (not TIMESTAMP) columns that fall into queries generated by Hibernate and are compared with bind variables in the WHERE clause - a type mismatch with the Java timestamp data type prevents the use of indexes on these columns.
dpbradley
source share