I would strongly consider doing this within the DB. With proper indexing, it'd be a lot more efficient to let the DB do the calculations rather than have your app do it.
On Wed, Sep 9, 2009 at 2:22 AM, Jas <mciver.ja...@gmail.com> wrote: > > If I have a table with a price field and these prices change very > frequently, also rows are added and subtracted frequently. > I need to make an element that shows the total of all these prices, > what is the most efficient way to minimise load on the database. > Keep in mind there might be anywhere between 2,000 and 500,000 rows. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---