Repository navigation
Conversation
|
Yeah, looks like a reasonable fix - needs api docs and regression tests though :) |
|
I most admit I'm not 100% sure why we actually remove the includes, other than for performance (which is in itself a valid reason, I just don't remember if there is a deeper reason :D) |
|
I'm not totally happy with the approach here. |
|
I was also thinking, since the only place where we do this removal of includes is findAndCount, so we might just introduce an option to not do that? |
|
I believe this is a reasonable fix as the includes are indeed required. And the requirement is unambiguous as to its purpose. But I am not familiar with the insides of sequelize. |
|
@janmeier @mickhansen Either way, I would be happy to have an option to avoid the optimisation. This way seemed to be the most flexible without adding any new keywords. But I could have a new keyword (i.e. |
|
@janmeier @mickhansen apparently the forced removal of includes from queries generates other bugs as well for example #4200. Could it be possible to turn it off during some queries. While I appreciate the importance of speed optimisation I am currently working on a tool used internally by a few people and my primary objective is reliability not performance at this point. Is there a way to switch those optimisations off entirely in the project? |
|
@slawo #4200 is not directly related to this. In the case of limit we have to remove the includes, because we use a subquery. We need a subquery without joins in order to limit, otherwise the limit is wrong (in that case we would be limiting the number of joined rows, instead of the number of parent rows) |
|
Ouch! Why is the query not simply wrapped in a |
fixes: findAndCountAll crashes with a query which runs in findAll #4194