Robby Russell wrote: > On Wed, Oct 1, 2008 at 4:01 PM, Anthony E. > <[EMAIL PROTECTED]> wrote: >> have to scan the entire 'prices' table. >> > > *sniff* I smell premature optimization. ;-) > > Seriously, with database indexes... this is doubtful to be an issue. > If it's ever an issue you can cache the current price in the book > model, but really... I wouldn't be concerned about that for a while. > >> I'd rather do it in such a way that it only saves the current price, >> year, edition, etc. to a "stats" whenever the book is updated (without >> any explicit association). > > This is the case either way. Just not convinced you need to cache this > in the Book model from the get-go, which is what you're leaning > toward. >
Thanks Robby, you may indeed be correct. Is it safe to say your recommendation is to create a model for each statistical attribute I want to archive? ie: Price Year Edition ...and associate them to the Book via: has_many and then use the most recent as the current price? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

