webNeat / sql-single-vs-multiple-queries

14 stars 4 forks source link

Add scenarios that are more challenging for single-query solutions #5

Open wickning1 opened 4 months ago

wickning1 commented 4 months ago

This article from .NET's Entity Framework documentation is really good at explaining why single queries are not always the answer.

https://learn.microsoft.com/en-us/ef/core/querying/single-split-queries

A cartesian explosion benchmark would be great.

lroal commented 2 months ago

I agree. The test case is too basic. It should test nested one-to-many relations. Now it is only testing join from comments to post and user. So a better test would be to to fetch users with posts with comments. Most ORMs struggle with perfomance on this.

Also, why the LIMIT 1 ? It should be a larger number like 50 or 100. I don't think it is neccessary to have so big database. It is more important to fetch more than 1 row.