phpLD directories 3.05 and above... `PLD_HITS` table...

Discussion in 'Directories' started by an0n, Sep 11, 2006.

  1. #1
    I don't know how many of you guys actually check your `PLD_HITS` table for your 3.05+ directories, but these past few days, google and yahoo have both wreeked havoc on one of my directories, accumulating over 150,000 hits in two days.
    The constant hammering rendered my directory unviewable at times, and while the aftermath does not appear to be over, i wanted to clean up a little, because with so many rows to look up on the `PLD_HITS` table, and with over 32,000 categories, the directory seemed to be taking a slight hit on performance.

    So here is a nice SQL command to clear up some of the older rows on your `PLD_HITS` table.

    The 30 represents the exact amount of days you would like to go back as far as deleting, so if you wanted to delete everything from day 1 up to 15 days before today, just change it to 15 instead of 30.. etc etc

    DELETE FROM `PLD_HITS` WHERE (TO_DAYS(NOW()) - TO_DAYS(`LAST_HIT`))>30

    Anywho, I just thought I'd post to try and help out anyone else who's been through this.

    Rob
     
    an0n, Sep 11, 2006 IP
    Alvin and Professional Dude like this.
  2. praveen

    praveen Notable Member

    Messages:
    1,249
    Likes Received:
    122
    Best Answers:
    0
    Trophy Points:
    205
    #2
    You must spread some reputation before giving it to an0n again :D
     
    praveen, Sep 11, 2006 IP
  3. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #3
    hahah np praveen ;)

    I hope it's useful to whomever needs to do a little pld_hits table maintenance, whether it be now or later ;)

    side note* - was funny when i ran the query with 1 instead of 30 and i still had over 70,000 rows

    Rob
     
    an0n, Sep 11, 2006 IP
    EveryQuery likes this.
  4. Alvin

    Alvin Notable Member

    Messages:
    2,076
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    210
    #4
    do i need to run query for this?
     
    Alvin, Sep 11, 2006 IP
  5. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #5
    you don't have to. i just figure i post it to help clean up the hits table for phpld 3.05 and higher if you'd prefer to.
    i mean 150,000 rows is actually quite a lot for a table that only holds the hits info.

    I will probably set it up as a cronjob to run every day, or maybe run a select to first check to see if i am over xx,xxx rows, and if so then run the query. I just like a clean backend(haha pun intended :p)
     
    an0n, Sep 11, 2006 IP
  6. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #6
    jeuss christ!!! these fk'n robots aren't following my robots.txt ....
    the IP's are confirmed they are inktomi/yahoo slurp/google

    1 day later after cleaning *everything* out (because i still had 70+ rows on my hits table, i look again today and....

    PLD_HITS Browse Structure Search Insert Empty Drop 80,494 MyISAM latin1_swedish_ci

    in one day. wtf man! should i ban the robots altogether?

    bandwidth Total so far
    13988.1 MB

    granted i have 1307 GB to play with, but still ....
     
    an0n, Sep 12, 2006 IP
  7. praveen

    praveen Notable Member

    Messages:
    1,249
    Likes Received:
    122
    Best Answers:
    0
    Trophy Points:
    205
    #7
    looks like they like you ;) :D
     
    praveen, Sep 12, 2006 IP