How to do database cleanup?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Zugschlus
Regular
Posts: 139
Joined: Sun Feb 05, 2006 12:54 am
Location: St. Ilgen, Germany
Contact:

How to do database cleanup?

Post by Zugschlus »

Hi,

my spambloglog and visitors database are well beyond the 200 MB border by now.

What is the recommended way to expire old log entries?
--
Marc Haber, St. Ilgen, Germany
https://blog.zugschlus.de/ - nach langer Pause jetzt wieder online
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How to do database cleanup?

Post by garvinhicking »

Hi!

Simply TRUNCATE the spambloglog table. About visitors, I don't use that one - truncating it will of course remove the old visitor data.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Zugschlus
Regular
Posts: 139
Joined: Sun Feb 05, 2006 12:54 am
Location: St. Ilgen, Germany
Contact:

Re: How to do database cleanup?

Post by Zugschlus »

garvinhicking wrote:Simply TRUNCATE the spambloglog table. About visitors, I don't use that one - truncating it will of course remove the old visitor data.
Truncating seems to be a bit radical. Will s9y like it when I use the timestamp fields to delete anything older than three months?

Greetings
Marc
--
Marc Haber, St. Ilgen, Germany
https://blog.zugschlus.de/ - nach langer Pause jetzt wieder online
TKS
Regular
Posts: 199
Joined: Thu Nov 11, 2004 1:34 am
Location: VA, USA
Contact:

Post by TKS »

I clean mine this way...

I disabled statistics because it slowed my blog down to 20-30 second display times. I dropped the tables' content associated with statistics via phpmyadmin.

I signed up for google analytics and feedburner, added the code for analytics to my index page and feedflare via plugin to my blog entries...that way my stats are still tracked for me. Another good service is mapstats...I had that at one time but not anymore.

I then disabled spam being stored in the database and used phpadmin to clean the entire table for spam. I use flatfile now and I clean that file out with a cron job. The job ftp's in, downloads the spam file, then uploads a blank file over the top.

It works much better, I'm more informed, and I my blog displays in less than 8 seconds now.
Zugschlus
Regular
Posts: 139
Joined: Sun Feb 05, 2006 12:54 am
Location: St. Ilgen, Germany
Contact:

Post by Zugschlus »

TKS wrote:I disabled statistics because it slowed my blog down to 20-30 second display times.
This is most probably due to missing indexes. Activate MySQL's slow query log and liberally add indexes that might be helpful in optimizing the queries logged there.

Greetings
Marc
--
Marc Haber, St. Ilgen, Germany
https://blog.zugschlus.de/ - nach langer Pause jetzt wieder online
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How to do database cleanup?

Post by garvinhicking »

Hi Marc!

s9y only uses spamblocklog for writing. It nevers reads data from there, so you can truncate or remove anything you seem fit. s9y won't care. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Post by Fabien »

Hi,

Can I do the same thing with the referrers table?

Is there a clean way to disable writng in the referrers table? Or to have it purged regularly?

Thanks, Fabien
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, you can also delete entries from that table.

In the global s9y configuration you can disable referrer tracking.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply