From 2718c8150f614e6d5c76f91d46f4ebb28e440124 Mon Sep 17 00:00:00 2001
From: Michael Vogel <icarus@dabo.de>
Date: Fri, 11 Mar 2016 20:32:22 +0100
Subject: [PATCH] The table optimisation level calculation is now using the
 index size as well

---
 include/cron.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/cron.php b/include/cron.php
index d68bd7f084..db7d44be0b 100644
--- a/include/cron.php
+++ b/include/cron.php
@@ -357,7 +357,7 @@ function cron_clear_cache(&$a) {
 			continue;
 
 		// Calculate fragmentation
-		$fragmentation = $table["Data_free"] / $table["Data_length"];
+		$fragmentation = $table["Data_free"] / ($table["Data_length"] + $table["Index_length"]);
 
 		logger("Table ".$table["Name"]." - Fragmentation level: ".round($fragmentation * 100, 2), LOGGER_DEBUG);
 
-- 
2.39.5