Removed optimizes (nonsense with innodb)

This commit is contained in:
Adolfo Gómez García 2019-02-26 12:27:41 +01:00
parent 6156f2c6f6
commit a288dd4df3
2 changed files with 2 additions and 9 deletions

View File

@ -71,9 +71,6 @@ class StatsManager(object):
# Newer Django versions (at least 1.7) does this deletions as it must (executes a DELETE FROM ... WHERE...)
model.objects.filter(stamp__lt=minTime).delete()
# Optimize mysql tables after deletions
optimizeTable(model._meta.db_table)
# Counter stats
def addCounter(self, owner_type, owner_id, counterType, counterValue, stamp=None):
'''

View File

@ -86,10 +86,6 @@ def getSqlDatetime(unix=False):
def optimizeTable(dbTable):
'''
Executes table optimization
Supported only on mysql right now
Legacy method, does nothing actually
'''
cursor = connection.cursor()
if connection.vendor == 'mysql':
cursor.execute('OPTIMIZE TABLE {0}'.format(dbTable))
pass