On Saturday 04 August 2007 18:39:12 Benjamin Montgomery wrote:
> Anyone have any code or pointers on how to clean up the tables used by
> identity?  I was looking at the database for a turbogears app I have and
> the identity tables are several times the size of the actual data used
> by the application.  I hope there is some way that I can do some
> housekeeping.  The specific tables I'm curious about are:
> tg_visit_identity and visit.

I have a PostgreSQL plpgsql function that cleans that up and also collects 
some information on a table for statistics.  This way, I can know how long 
lasted the longest and shortest sessions and when a user last accessed the 
system.  It also adds a row count so that I have some basis for other kinds 
of statistics.

My "statistics" table has the following columns:

        - id   (to be used with SQL Object)
        - user id  (to correlate with the user's table)
        - date when the user first accessed the system
        - date of his / her last access
        - duration of shortest access
        - duration of longest access
        - row count so that I know how many rows where analyzed and led to some 
          update for that particular user

This function is called from crontab every day to update statistics.

If you're interested in it, I can share...  It was just something that I came 
up with to study some access patterns...  Nothing too elaborated, as you 
could see.

-- 
Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to