mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
feature #509 summarize history more often
Every 1000 log entry inserted, Piwigo performs an history summarize. The summarize process has also been optimized: no longer used column history.summarized (no longer need to update it, which took a lot in time), we now save the history_id_from and history_id_to in history_summary table. This way we know from where to start on next summarize. For now, for a simple performance reason, we keep column history.summarized, because removing it may take a long time on huge tables. Once we will have automatic purge on history, it will be safer to drop this column.
This commit is contained in:
@@ -495,6 +495,13 @@ INSERT INTO '.HISTORY_TABLE.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
$history_id = pwg_db_insert_id(HISTORY_TABLE);
|
||||
if ($history_id % 1000 == 0)
|
||||
{
|
||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions_history.inc.php');
|
||||
history_summarize(50000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user