delete from horde_sessionhandler where session_lastmodified < now() - 10800;
It turned out that the biggest problem I had was old session data not being
cleaned up. It seems that the PHP GC doesn't seem to work as it should.
Running the above command freed 3.6G of space.
On Mon, 22 Aug 2011, Arjen Lentz <arjen(a)lentz.com.au> wrote:
You can do cross-database joins (dbs in mysql are just
a namespace thing),
and also multi-table deletes which is an SQL extension (although you can
then only delete from one table specified in the join).
delete from horde.horde_prefs,isp.users where horde.horde_prefs.pref_uid =
isp.users.uid and bluebottle.users.inactive=1 and isp.users.inactive_time <
now() -365*24*3600 limit 10;
Would the above delete the matching rows from horde.horde_prefs without
deleting from isp.users?
A select with the same where clauses gets the data I want.
The horde schema is monstrous though, often the
references from other
tables comprise of 3-part varchar fields - so be sure you grab the right
(and all) the relevant fields for your joins. Check with a select before
you do delete.
The Horde database has 5 tables. horde_categories, horde_vfs_seq, and
horde_vfs have 0, 1, and 6 rows respectively. The other two are the
horde_sessionhandler table (which is only needed while I have active-active
servers for the web space, I plan to go to active-passive and remove this) and
the horde_prefs table.
What are the inter-table references that you refer to?
Thanks for your suggestions.
--
My Main Blog
http://etbe.coker.com.au/
My Documents Blog
http://doc.coker.com.au/