Same Table minus the delete statement

Discussion in 'MySQL' started by protocol96, Sep 14, 2010.

  1. #1
    I got a table with over 300K entries on which lots mysql commands run. My problem is that I need to keep pruning this table for performance and other issues. But with a new problem at hand I need to retain those values so we decided to keep a seperate table.

    Not sure how about I go doing it, here's a little detailed requirement: I am looking for a table B which will be extra replica of table A. If the values are added to table A or updated it should update table B as well exception for deletion. Database type is preferably Innodb but no constraint.

    Any idea on how I go about doing so?
     
    protocol96, Sep 14, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Hi,I don't see the reason to keep replica of ~300k records. IMO table B should be the like table A and must be filled by trigger after delete on table A. So you can get all data using UNION ALL between A and B.
    Regards :)
     
    koko5, Sep 14, 2010 IP