Skip to content
Extraits de code Groupes Projets
Valider 0bbfce9c rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

fixing #3657 NEW config setting

; By default Piwik runs OPTIMIZE TABLE SQL queries to free spaces after deleting some data.
; If your Piwik tracks millions of pages, the OPTIMIZE TABLE queries might run for hours (seen in "SHOW FULL PROCESSLIST \g")
; so you can disable these special queries here:
enable_sql_optimize_queries = 1


git-svn-id: http://dev.piwik.org/svn/trunk@7738 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 47a9c1f0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -147,6 +147,11 @@ enable_browser_archiving_triggering = 1 ...@@ -147,6 +147,11 @@ enable_browser_archiving_triggering = 1
; At the moment, this is not needed in core but it can be handy for plugins ; At the moment, this is not needed in core but it can be handy for plugins
enable_archive_parents_of_datatable = 0 enable_archive_parents_of_datatable = 0
; By default Piwik runs OPTIMIZE TABLE SQL queries to free spaces after deleting some data.
; If your Piwik tracks millions of pages, the OPTIMIZE TABLE queries might run for hours (seen in "SHOW FULL PROCESSLIST \g")
; so you can disable these special queries here:
enable_sql_optimize_queries = 1
; MySQL minimum required version ; MySQL minimum required version
; note: timezone support added in 4.1.3 ; note: timezone support added in 4.1.3
minimum_mysql_version = 4.1 minimum_mysql_version = 4.1
......
...@@ -150,6 +150,11 @@ class Piwik_Sql ...@@ -150,6 +150,11 @@ class Piwik_Sql
*/ */
static public function optimizeTables( $tables ) static public function optimizeTables( $tables )
{ {
$optimize = Piwik_Config::getInstance()->General->enable_sql_optimize_queries;
if(empty($optimize)) {
return;
}
if(empty($tables)) if(empty($tables))
{ {
return false; return false;
...@@ -163,7 +168,8 @@ class Piwik_Sql ...@@ -163,7 +168,8 @@ class Piwik_Sql
$nonInnoDbTables = array(); $nonInnoDbTables = array();
foreach (Piwik_FetchAll("SHOW TABLE STATUS") as $row) foreach (Piwik_FetchAll("SHOW TABLE STATUS") as $row)
{ {
if (strtolower($row['Engine']) != 'innodb' && in_array($row['Name'], $tables)) if (strtolower($row['Engine']) != 'innodb'
&& in_array($row['Name'], $tables))
{ {
$nonInnoDbTables[] = $row['Name']; $nonInnoDbTables[] = $row['Name'];
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter