We're updating the issue view to help you get more done. 

Duplicate queries during startup

Description

During startup phase, Hibernate relies on "SHOW FULL TABLES" to discover the schema.
It executes the same command multiple times for the same table. As the execution time can vary between 100 and 200 ms on a loaded server, this can lead to very long startup times in the range of minutes. The duplication can be observed both in 4.3.11 and 5.2.3 however in the later one, it's more severe. Below is an example of number of queries observed for a complex schema with around 120 tables.
Hibernate 4.3.11: 232 x SHOW FULL TABLES FROM
Hibernate 5.2.3: 591 x SHOW FULL TABLES FROM
In 5.2.3, the number of queries executed for same table varies. We have one table for which we see the same query 19 times!

All the queries can be easily observed by enabling general log in Mysql. The issue might be related to

Environment

Ubuntu Server 14.04 LTS, Percona Server 5.6

Status

Assignee

Andrea Boriero

Reporter

Sergiu Hlihor

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.3
4.3.11

Priority

Major