Log deletion problem

I have a log deletion problem after importing 2 years worth of logs with import_logs.

The database purge runs with a limit

DELETE FROM piwik_log_link_visit_action WHERE idvisit < ‘6085418’ LIMIT 100000;

here is the appropriate line of code

core/PluginsFunctions/Sql.php: static public function deleteAllRows( $table, $where, $maxRowsPerQuery = 100000, $parameters = array() )

there doesn’t appear to be a way of configuring this limit but maybe I am wrong.

select count(*) from piwik_log_link_visit_action WHERE idvisit < ‘6085418’;
returns '159492548’
so at the rate of 100000 deletions per day this will never catch up, I am adding ~ 300000 lines per day

does anyone have an idea?

the code is:

			$rowsDeleted = self::query($sql, $parameters)->rowCount();
			$totalRowsDeleted += $rowsDeleted;
		} while ($rowsDeleted >= $maxRowsPerQuery)

so it should delete continuously until all are deleted?

ahh yes, I should have looked a little deeper sorry.

I think that my php process was being killed by fcgid or php before the SQL had a chance to finish removing records as the select was still showing 156 million after several days of attempted purges. I had extended the allowed runtime to several mintues but it obviously wasn’t sufficient.

I ran the SQL manually without the limit and everything is fine now. Hopefully it will run quickly enough from now on.