Discussion Forums  >  Self Hosted Control Panels

Replies: 3    Views: 308

Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
12/23/15 12:25 AM (8 years ago)

purging data

The self host maintenance section states the following "The bt_api_requests table in the mySQL database can grow to extraordinary numbers. It's not unheard of for this tables to hold many millions of rows. Depending on your hardware and other server variables, this may or may not pose a problem. However, low-cost, low-performance webservers may experience a performance hit if the size of the table grows too large. In this case, you'll want to consider purging this data ocassionally. Before purging the data, you'll want to carefully consider it's usefullness. Do you need to keep a copy for later reference? Reporting? Analytics?" My DB has exactly this. over 1000000 records in the api request table. Can someone help me in knowing how to purge some of this data please? i assume i will have run a sql script in my SQLadmin panel on my hosting? what would the script be? THanks Steve
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
12/23/15 12:39 AM (8 years ago)
i think i got it: i did this...... DELETE FROM bt_api_requests WHERE `dateStampUTC` < '2015-01-01 00:00:01'
 
Bonzo
Apple Fan
Profile
Posts: 783
Reg: Jan 30, 2012
Basingstoke
13,530
like
12/23/15 12:42 AM (8 years ago)
i take that back......didnt seem to delete anything :(
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
12/23/15 11:31 PM (8 years ago)
I think if you ran the same query, but removed the time portion of it, it should work: DELETE FROM bt_api_requests WHERE `dateStampUTC` < '2015-01-01' That would delete everything before January 1, 2015. Also...not sure if this is an issue, but your single quotes are different in dateStampUTC than in the date portion. Mark
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.