Skip to content


Do not run OPTIMIZE queries on innodb tables #3289

mattab opened this Issue · 3 comments

2 participants

Piwik Open Source Analytics member

Reported in forums

Innodb does not work well with OPTIMIZE statements, esp. on large tables. I suggest we do not run the OPTIMIZE statement when the table is Innodb.

Could we detect that the table is using Innodb?

The code is in optimizeTables() in /trunk/core/PluginsFunctions/Sql.php

Piwik Open Source Analytics member

let's add a new config option

; set to 0 when using Innodb tables in your database, because OPTIMIZE queries can take hours to run on very large Innodb tables
mysql_enable_optimize_tables = 1

Piwik Open Source Analytics member

(In [7096]) Fixes #3289, don't optimize InnoDB tables.

Piwik Open Source Analytics member

(In [7098]) Refs #3289, change test name + filename.

@mattab mattab added this to the 1.9 -- Piwik 1.9 milestone
@diosmosis diosmosis was assigned by mattab
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.