[PR #1569] Add EAGER_BATCHED fetchmode to OneToMany association #9628

Open
opened 2026-01-22 16:04:54 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/1569

State: closed
Merged: No


In regular EAGER mode, doctrine adds a JOIN for a OneToMany association
forcing the database to load more data in memory than essentially
needed. In a classic Article => Tag concept, each article would be
loaded one extra time for every addition tag.

LAZY mode issues a query for every article to load all associated tags,
also adding more overhead to the database than needed.

This new fetchmode addreses this issue by loading all tags associated to
an article into one additional query.

**Original Pull Request:** https://github.com/doctrine/orm/pull/1569 **State:** closed **Merged:** No --- In regular EAGER mode, doctrine adds a JOIN for a OneToMany association forcing the database to load more data in memory than essentially needed. In a classic Article => Tag concept, each article would be loaded one extra time for every addition tag. LAZY mode issues a query for every article to load all associated tags, also adding more overhead to the database than needed. This new fetchmode addreses this issue by loading all tags associated to an article into one additional query.
admin added the pull-request label 2026-01-22 16:04:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9628