Eager loading of reverse related elements? Is it possible to load reverse related elements? I mean if the elements I’m querying are the target elements?

Example:

I’m setting up a criteria model to get some categories and I also want to load the entries related to each category. I’m using a Categories field, so my categories are the target elements of those relations.

{% for category in craft.categories.group('news').all() %}
    {% set query = craft.entries.relatedTo({
        targetElement: category,
        field: 'myCategoriesField',
    }) %}

    {# Oh no, a N+1 query problem... #}
    {% set entries = query.all() %}
{% endfor %}


I could probably do it the other way around, query for the entries and eager load the categories. Then use the group filter to order everything by category. But that approach is awkward and has limitations, e.g. doesn’t play well with pagination.
Isn't eager loading the wrong idea here, since categories do not have a property anyway, which automatically points to entries assign to this category?

Let's take 2 samples:

Sample #1: behavior like lazy loading (one entry query per category)

{% for category in categories %}
{% set entries = craft.entries...relatedTo(category)
{% endfor %}


Sample #2: behavior like eager loading (one entry query for all categories)

{% set entries = craft.entries...relatedTo(categories)


Now the only trick is to sort the entries in a way that they are easy accessible from each category in the {% for category in categories %} loop.

Or should't Craft automatically cache the loaded categories and therefor make accessing them from the entry fast after having executed the Sample #2 query?

What I mean is that it would not become faster, only more comfortable if this eager loading was possible.

Only ideas...