system/Database/BaseUtils.php
public function optimizeTable(string $table_name)
	{
		if ($this->optimizeTable === false)
		{
			if ($this->db->DBDebug)
			{
				throw new DatabaseException('Unsupported feature of the database platform you are using.');
			}
			return false;
		}

		$query = $this->db->query(sprintf($this->optimizeTable, $this->db->escapeIdentifiers($table_name)));
		if ($query !== false)
		{
			$query = $query->getResultArray();
			return current($query);
		}

		return false;
	}
public function optimizeTable(string $table_name)
	{
		if ($this->optimizeTable === false)
		{
			if ($this->db->DBDebug)
			{
				throw new DatabaseException('Unsupported feature of the database platform you are using.');
			}
			return false;
		}

		$query = $this->db->query(sprintf($this->optimizeTable, $this->db->escapeIdentifiers($table_name)));
		if ($query !== false)
		{
			$query = $query->getResultArray();
			return current($query);
		}

		return false;
	}
Optimize Table

@param  string $table_name
@return mixed
@throws \CodeIgniter\Database\Exceptions\DatabaseException