Best way

Hello, I wanted to know what the best thing to do.
Better recover all the records from the DB and then in SC make sum and group, or do everything in the DB?

Thank you

In terms of performance, it is best to prepare as much as possible and work with database views or use the power of SC?

Always is best to do it all on DB level. And please, be more specific on topic title in your doubts.