Hibernate: Mapping Strategies and Their Database Performance Impact
summary
Compares Hibernate mapping choices by showing actual SQL and costs: sequence vs identity (default sequence cache 50 causes nextval calls; identity avoids nextval but prevents batching), batch size and Postgres driver rewriting inserts (rewriteBatchedInserts turns many single INSERTs into a multi‑row INSERT), random UUIDs fragment B‑tree indexes while time/ordered UUIDs or DB‑side IDs reduce IO, OFFSET pagination reads and skips rows while key‑based pagination jumps to the index, and dynamic update limits UPDATE to changed columns to cut redo/undo and index maintenance.
AI-written summary · about
chapters (9)
- 0:00Introduction to ORM mapping
- 2:47Data ingestion strategies
- 11:55Batching and driver behavior
- 17:47Mapping design considerations
- 20:23Fetching and query efficiency
- 28:49Optimizing index usage
- 30:51Pagination and data models
- 34:25Dynamic updates in ORMs
- 38:54Conclusion and Q&A
related talks
50mHibernate and Performance: Take Back Control
52mBulk data processing and PostgreSQL thingy
52mHibernate performance tuning
52mJava Persistence and Hibernate Tips that can boost up your application performance
58mCause of Death: Hibernate.
24mFun With UUIDs
44mORM Insights - How not to hurt yourself?
53mHibernate you know it… but actually you don’t
