Printable Version of Topic

Click here to view this topic in its original format

Ventrino Forum for Walker Scripts _ Ventrino FAQ _ How Do I Keep The Size Of My Database Down Automatically?

Posted by: Martyn Jun 14 2006, 07:07 PM

SYMPTOMS

My database is extremely large, is there a way to reduce the size automatically rather than running the optimizer regularly?

CAUSE

There are a number of tables in your database with the postfix _tracking, these tables store temporary information that is used for performance processing and statistics.

SOLUTION

None of this data is required for more than 8 days and can safely be removed via a cron job or other similar process. Run following SQL daily to remove the old data from your tables:

traffic exchange + text exchange + banner exchange

SQL
DELETE FROM vtp_tracking WHERE action_date < DATE_SUB(CURDATE(),INTERVAL 14 DAY)

SQL
DELETE FROM vtp_text_tracking WHERE action_date < DATE_SUB(CURDATE(),INTERVAL 14 DAY)

SQL
DELETE FROM vtp_bnr_tracking WHERE action_date < DATE_SUB(CURDATE(),INTERVAL 14 DAY)


text exchange:
SQL
DELETE FROM vte_tracking WHERE action_date < DATE_SUB(CURDATE(),INTERVAL 14 DAY)


banner exchange:
SQL
DELETE FROM vbe_tracking WHERE action_date < DATE_SUB(CURDATE(),INTERVAL 14 DAY)


link tracking exchange:
SQL
DELETE FROM vtl_tracking WHERE action_date < DATE_SUB(CURDATE(),INTERVAL 14 DAY)

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)