[Koha-devel] Koha sessions table is ridiculously huge

Chris Cormack chris at bigballofwax.co.nz
Wed Feb 17 21:02:11 CET 2010


2010/2/18 Clay Fouts <clay.fouts at liblime.com>:
> You can also use "truncate sessions" to do the job if you just want to clear
> out the contents of the table. It's faster and simpler than using mysqldump.
>
> This issue arises from the fact that the way Koha is written, if a user just
> walks away from a session without logging out, their session data will hang
> out in the the sessions table forever. A proper solution would involve
> adding a timestamp column to the sessions table, enabling one to cull only
> expired sessions entirely within SQL statements. With the current schema,
> you'd have to parse the contents of each row within a user program, then
> cull based on the expiry contained within the session data itself.
> Cheers,
> Clay
>
I suggested drop and recreate, because for a table that huge, truncate
will take a lot lot longer.
But as a cron job, definitely truncate, followed by optimize

Chris



More information about the Koha-devel mailing list