Unless I've misunderstood, wouldn't it be easy to just create a table to hold visits (by user and date) and then when you want to know how many visits there have been (by user or by date range) you just select them and count them.
That way as you're just adding rows to a table, there's no problem with races. If you start getting millions of visits, then you can start optimising it then, and you'll be so happy to be getting millions of visits that you won't mind. Ed On 3/14/07, tml <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm using SA and have a visit counter for user profiles and some other > pages. I have a visit_counter column in User object, and usually do > User.get(id).visit_counter+=1 > > But I realize this is a race if all the threads are serving the same > page. Can someone tell how to do this right? > > thanks. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

