Hi.
I know that yii2 ActiveRecord is using two queries instead of one join, there was some topics about it from people that could not agree with this.
If i remember correctly someone from the yii team had an argument that this greatly simplifies the ActiveRecord design and could beside other things make it a lot easier to use cache.
I have some complex page to optimize and this could be a great way to speed it up if that statement was true.
My question is how can i use the eager loading with cache and if it is even possible, haven’t found anything, maybe its not the term i’m looking for.
The second query in eager loading generates a select WHERE IN (ids), now is there i way i could intercept those ids before the query gets executed, get them from cache and return to the eager loading code? So that it will not do that query anymore but use data i provide.
Of course i could just not use the eager loading at all and get those ids myself from the results, but it would be nice if there is a way to just "plug and play" into the eager loading.
Any advice?