This is new to me and I have never met with it if the query I build has the expected behaviour .
I have about 2000 entries in section 'x' in 2 sites and I paginate them.
Here is the query:
{% set query = craft.entries().siteId(siteIds).section('x').status(null) %}
{% if query|length %}
{% paginate query as pageInfo, matchedEntries %}
{% for e in matchedEntries %}
....
{% endfor %}
{% endif %}
That gives me expected result of about 2000 entries.
But when I try this:
{% set query = craft.entries().siteId(siteIds).section('x').status(null) %}
{% set someStats = query.after('2021-02-01').limit(null).all() %}
{% if query|length %}
{% paginate query as pageInfo, matchedEntries %}
{% for e in matchedEntries %}
....
{% endfor %}
{% endif %}
I get unexpected result of entries dated after the date.
Either I don't see something that I'm doing wrong or there is something wrong.
This is the expected behavior as per https://craftcms.com/docs/3.x/upgrade.html#cloning-element-queries
You should be doing {% set someStats = clone(query).after('2021-02-01').limit(null).all() %} instead and everything should be working as you expect.
Ohh glad to know it! Thanks @andris-sevcenko