[Feature Proposal] Implement QueryMethods on CollectionProxy to improve performance

I was wondering if it would make sense to implement (some) query methods (mostly where) on CollectionProxy to take advantage of already loaded associations.

Take this (contrived) example:

parent = Parent.first.includes(:children)
parent.children.load # first query
old_children = parent.children.where(created_at: (...2.years_ago)) # second query
young_children = parent.children.where(created_at: (2.years_ago..)) # third query

The second and third query happen because CollectionProxy forwards all QueryMethods to @scope. If instead it would check if the collection is already loaded and in case it is, perform the query methods on the collection (.where.filter), DB queries and object instantiations could be saved, resulting in better performance.

parent = Parent.first.includes(:children)
parent.children.load # first query
old_children = parent.children.where(created_at: (...2.years_ago)) # is actually a .filter{}
young_children = parent.children.where(created_at: (2.years_ago..)) # same

If that’s too much magic and not enough control, one could also throw in an .opportunistic to enable this behaviour.

The example is super simplistic and glosses over many details and challenges. As a first step I just want to get your opinion if it’s worth thinking about further.