[FLOW3-general] How to aggregate data?

Daniel Felix d.felix at codeworkz.net
Wed Feb 8 06:12:38 CET 2012


Hi Mario,

Maybe this is helpful for you:
http://www.doctrine-project.org/blog/implementing-aggregate-fields

By the way, I'm speaking at the point of a db developer, I would always prefer calculations on the db server itself. He has a better and faster logic system and is quite faster in mass operations like your iteration about those data rows.

Regards,
Daniel

Am 07.02.2012 um 23:22 schrieb Mario Rimann <typo3-coding at rimann.org>:

> Hi
> 
> I'm playing around with a little package that shows an entry form to
> collect data and the next step should show a result page, which compares
> the entered data to the average values of the already previously entered
> data.
> 
> For now, I can use $fooRepository->findAll(), iterate over the single
> objects and aggregate the data in PHP - but this seems to be the wrong
> approach when I expect hundreds or even thousands of elements to be in
> the database.
> 
> What's the best way to get e.g. an average value of a property from
> several objects? (data is available in the database, so the operation
> could happen there, no calculations needed within the model object at
> the time of reading/calculating).
> 
> Cheers,
> Mario
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general


More information about the FLOW3-general mailing list