Hello,
I'm just wondering if hbm2ddl could also include "advanced" indexes generation/validation. More specifically, queries with where-clauses on business columns should probably be executed against indexes on the RDBMS (if possible), since this can have a significant impact on performances.
On the one hand, I know that the @Index annotation exists, but it is not always used because it is not known or because it is not part of JPA either, which can be a portability issue.
On the other hand, each RDBMS has its own set of tools to detect slow queries or return the execution plan, but these tools are not always well mastered by developers who tend to focus on the code and the junit tests (that don't deal with performances).
Also, Hibernate core provides statistics on Session/EntityManager and/or SessionFactory/EntityManagerFactory, including the slowest query retrieval, but they do not give hints on how to improve performances (even if they give good information on how many operations where performed).
So, would hibernate tools benefit from such a feature ? Generating indexes when missing, or having some WARNINGs at startup if an index is missing, with ideally the SQL command to execute ? Would it be difficult to add such a feature ?
Regards, Xavier
|