| 
    
        
            
          
        | 
                    
                        | Question about deleting some data through cron  1 Year, 8 Months ago | Karma: 0 |  
                        | Hi, a long time ago I asked you a question about my DB becoming big because of wp_asq_quiz_sessions. And you gave me this code, so I can put it in my cron. And it works:
 "DELETE FROM wp_asq_quiz_sessions WHERE created < DATE_ADD(CURDATE(), INTERVAL -2 DAY)"
 
 However, I have this cron working once every 7 days. And now too many people are passing quizzes, so the db becomes heavy very quickly.
 
 My question is: if I'll make the cronjob to work once a day (every day), then the code above will work normally? Or should I choose bigger interval? If yes, then what is a minimal interval?
 |  |  |  | 
		 |  |  
    
        
            
          
        | 
                    
                        | Re:Question about deleting some data through cron  1 Year, 8 Months ago | Karma: 765 |  
                        | Hello,
 This query deletes records older than 2 days. You can increase "2" in the query If it is not enough.
 
 Regards,
 ARI Soft
 |  |  |  | 
		 |  |  
    
        
            
          
        | 
                    
                        | Re:Question about deleting some data through cron  1 Year, 8 Months ago | Karma: 0 |  
                        | No, I am asking "if I'll make the cronjob to work once a day (every day), then the code above will work normally?". I don't need these records at all, because I don't collect any data from users, that pass my quizzes.
 Tbh, I don't understand, what records are making the db grow, if I don't collect any data. And it would be useful, if you add autodeletion of this records in your plugin's settings.
 |  |  |  | 
		 |  |  
    
        
            
          
        | 
                    
                        | Re:Question about deleting some data through cron  1 Year, 8 Months ago | Karma: 765 |  
                        | Yes, the code will work fine if run query once a day. It seems in some cases (depend on plugin/quiz configuration) don't need add a record to "session" DB table. We will investigate it.
 Regards,
 ARI Soft
 |  |  |  | 
		 |  |  |