INLINESTATS is executed in 2 phases, first a STATS based on the query upstream from the INLINESTATS, then a second phase with the full query where the INLINESTATS is replaced by an InlineJoin that joins with the results of the previous STATS.
In between those two phases, we do not keep the index readers open; this means that the data the two phases use can be inconsistent; this could also affect performance.
Let's consider an approach where we keep the index readers open between the two phases, and let's double check what this means for performance - esp. taking into account CCQ.
INLINESTATS is executed in 2 phases, first a STATS based on the query upstream from the INLINESTATS, then a second phase with the full query where the INLINESTATS is replaced by an InlineJoin that joins with the results of the previous STATS.
In between those two phases, we do not keep the index readers open; this means that the data the two phases use can be inconsistent; this could also affect performance.
Let's consider an approach where we keep the index readers open between the two phases, and let's double check what this means for performance - esp. taking into account CCQ.