#DevoxxFR
“More than half of application
performance bottlenecks originate
in the database”
AppDynamics - http://www.appdynamics.com/database/
#DevoxxFR
• Connection acquisition time
• Data access logic (e.g. entity state transitions)
• Statements submission time
• Statements execution time
• Result set fetching time
• Idle time prior to releasing the database connection
𝑇 = 𝑡 𝑎𝑐𝑞 + 𝑡 𝑑𝑎𝑙 + 𝑡 𝑟𝑒𝑞 + 𝑡 𝑒𝑥𝑒𝑐 + 𝑡 𝑟𝑒𝑠 + 𝑡𝑖𝑑𝑙𝑒
#DevoxxFR
• Default for Oracle and PostgreSQL when using AUTO
• May use roundtrip optimizers: hi/lo, pooled, pooled-lo
• Hibernate 5 uses the enhanced sequence generator by default
<property name="hibernate.id.new_generator_mappings" value="true"/>
#DevoxxFR
• Uses row-level locks and a separate transaction/connection
• May use roundtrip optimizers: hi/lo, pooled, pooled-lo
• Hibernate 5 uses the enhanced table generator by default
<property name="hibernate.id.new_generator_mappings" value="true"/>
#DevoxxFR
SELECT *
FROM post_comment pc
INNER JOIN post p ON p.id = pc.post_id
INNER JOIN post_details pd ON p.id = pd.id
SELECT pc.version
FROM post_comment pc
INNER JOIN post p ON p.id = pc.post_id
INNER JOIN post_details pd ON p.id = pd.id
• Selecting all columns vs selecting a custom projection