Skip to content

Commit

Permalink
readme: improve comparision text description (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTvrdik authored Oct 14, 2024
1 parent 3d39954 commit fee4037
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@
| [ManyToOneDeep](tests/EntityPreloadBlogManyHasOneDeepTest.php) | :red_circle: 1 + n + n | :green_circle: 3 | :orange_circle: 1, but<br>duplicate rows | :red_circle: 2 + n | :green_circle: 3 |
| [ManyToMany](tests/EntityPreloadBlogManyHasManyTest.php) | :red_circle: 1 + n | :green_circle: 2 | :orange_circle: 1, but<br>duplicate rows | :red_circle: 1 + n | :green_circle: 2 |

Unlike manual preload does not require writing custom queries for each association.

### Comparison vs. Manual Preload

Unlike manual preload, the EntityPreloader does not require writing custom queries for each association.

### Comparison vs. Fetch Join

Unlike fetch joins, the EntityPreloader does not fetches duplicate data, which slows down both the query and the hydration process, except when necessary to prevent additional queries fired by Doctrine during hydration process.

The fetch join scales poorly with the number of associations. With every preloaded association, the number of duplicate rows grows. The EntityPreloader does not have this problem.

### Comparison vs. setFetchMode

Unlike `Doctrine\ORM\AbstractQuery::setFetchMode` it can

* preload nested associations
Expand Down

0 comments on commit fee4037

Please sign in to comment.