function performance_prune_db in Performance Logging and Monitoring 6
Same name and namespace in other branches
- 7 performance.module \performance_prune_db()
Helper function to cleanup database data.
See also
File
- ./
performance.module, line 897 - Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com
Code
function performance_prune_db($timestamp = 0) {
// Remove rows which have not been accessed since a certain timestamp
db_query("DELETE FROM {performance_summary} WHERE last_access <= %d", $timestamp);
// Remove performance_detail rows on a daily basis
// TODO: check the comment with the SQL. Which one is wrong? Look back in the
// code history...
db_query("DELETE FROM {performance_detail} WHERE timestamp <= %d", $timestamp);
}