core icon indicating copy to clipboard operation
core copied to clipboard

perf(extension): Generate a subquery only if a where clause contains a one-to-many eager fetching

Open binxiaoff opened this issue 2 years ago • 3 comments

Q A
Branch? 2.6
Tickets #3267
License MIT
Doc PR api-platform/docs#...

Accoding to this issue #944, we need to generate a subquery to fetch all wanted entries, when the "where" clause contains a one-to-many relations. But the fix to this issue is too large for me : it checks all the relations (one-to-many, many-to-one, and many-to-many) of the target entity if there are some "eager fetching". This behaviour can cause performance issues due to the subquery.

My fix is to limits the subquery generation to the cases that the joined table

  • is also used in the where clause
  • and it has a one-to-many eager feching.

binxiaoff avatar Mar 12 '22 22:03 binxiaoff

Question: as it fixes a performance issue. If it's merged in 2.6, will it be merged in master ?

binxiaoff avatar Mar 14 '22 09:03 binxiaoff

The change is too deep to be included in a patch version. As it's not a bug fix stricto sensu but a performance optimization, we'll merge it in the next minor instead.

dunglas avatar Mar 20 '22 09:03 dunglas

The change is too deep to be included in a patch version. As it's not a bug fix stricto sensu but a performance optimization, we'll merge it in the next minor instead.

@dunglas It sounds great! Is there anything that I should do to make this happen ?

binxiaoff avatar Mar 20 '22 21:03 binxiaoff

Hello, is there any news about this MR ? If you want to re-target the branche to 2.7, just let me know.

binxiaoff avatar Oct 03 '22 08:10 binxiaoff

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 02 '22 08:12 stale[bot]

@soyuka @binxiaoff Hi! Any news here? That behavior causes performance issues, so it would be good to improve it. Is there something I can do to help?

voodooism avatar Feb 22 '23 13:02 voodooism