The platform is optimized that when you only use a database retrieve to do an aggregate function that it will do the aggregate in the database without loading the list.
This drastically improves performance of the retrieve and count. However when you use the list on another place besides the aggregate the platform will simply retrieve the original list and use that in the microflow.
I'm pretty sure this behavior works fine in the most recent versions, and as Ronald mentions he is not able to reproduce. I do see in your screenshots that your modeler version is 5.6.0 not 5.14 as in your post, the 5.6.0 release is an old release from june 2014. There might be a issue in that functionality that has been resolved in a later version.
I just created a test project, but I can not reproduce this. Did you try it with a different object? Otherwise file a bug report with your test project with the steps on how to reproduce this. And I do not know any reason for this behaviour. Strange.
Regards,
Ronald
Interesting. it seems indeed a good thing when it does this optimization IF the list is not used again. But in this case, the list is used as the returnvalue, so it shouldn't do this optimization.
The screenshots are indeed 5.6, but I also tried 5.14, with the same result.
I was also able to reproduce the problem with a new blank testproject in 5.13.1, so it seems this is a bug...
I will try this weekend if I'm also able to reproduce it with 5.14 and then file a bug report..
thanks for your answers!