diff --git a/db_structure.xml b/db_structure.xml
index 5eef44d8e845a3bf589d3fc4869b7924aba0045e..82d2a731d4c51c514f093382367f1230120f51f1 100644
--- a/db_structure.xml
+++ b/db_structure.xml
@@ -64,6 +64,15 @@
     <length>512</length>
    </field>
 
+   <field>
+	   <name>path_hash</name>
+	   <type>text</type>
+	   <default>
+	   </default>
+	   <notnull>true</notnull>
+	   <length>32</length>
+   </field>
+
    <field>
 	   <name>parent</name>
 	   <type>integer</type>
@@ -79,7 +88,7 @@
 	   <default>
 	   </default>
 	   <notnull>true</notnull>
-	   <length>512</length>
+	   <length>300</length>
    </field>
 
    <field>
@@ -159,14 +168,13 @@
 	   <length>1</length>
    </field>
 
-   <!--<index>
-	   <name>fscache_path_index</name>
-	<unique>true</unique>
+   <index>
+	   <name>fscache_path_hash_index</name>
     <field>
-     <name>path</name>
+     <name>path_hash</name>
      <sorting>ascending</sorting>
     </field>
-   </index>-->
+   </index>
 
    <index>
 	   <name>parent_index</name>
@@ -176,6 +184,14 @@
 	   </field>
    </index>
 
+   <index>
+	   <name>name_index</name>
+	   <field>
+		   <name>name</name>
+		   <sorting>ascending</sorting>
+	   </field>
+   </index>
+
    <index>
 	   <name>parent_name_index</name>
 	   <field>
diff --git a/lib/filecache.php b/lib/filecache.php
index 280a9929db0407af12c4897f716a5ef5ba5ad420..a8c48e3f1440435c71f64081bafd464f89fd0ff9 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -59,8 +59,8 @@ class OC_FileCache{
 			$root='';
 		}
 		$path=$root.$path;
-		$query=OC_DB::prepare('SELECT ctime,mtime,mimetype,size,encrypted,versioned,writable FROM *PREFIX*fscache WHERE path=?');
-		$result=$query->execute(array($path))->fetchRow();
+		$query=OC_DB::prepare('SELECT ctime,mtime,mimetype,size,encrypted,versioned,writable FROM *PREFIX*fscache WHERE path_hash=?');
+		$result=$query->execute(array(md5($path)))->fetchRow();
 		if(is_array($result)){
 			return $result;
 		}else{
@@ -111,8 +111,8 @@ class OC_FileCache{
 		}
 		$mimePart=dirname($data['mimetype']);
 		$user=OC_User::getUser();
-		$query=OC_DB::prepare('INSERT INTO *PREFIX*fscache(parent, name, path, size, mtime, ctime, mimetype, mimepart,user,writable,encrypted,versioned) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)');
-		$result=$query->execute(array($parent,basename($path),$path,$data['size'],$data['mtime'],$data['ctime'],$data['mimetype'],$mimePart,$user,$data['writable'],$data['encrypted'],$data['versioned']));
+		$query=OC_DB::prepare('INSERT INTO *PREFIX*fscache(parent, name, path, path_hash, size, mtime, ctime, mimetype, mimepart,user,writable,encrypted,versioned) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)');
+		$result=$query->execute(array($parent,basename($path),$path,md5($path),$data['size'],$data['mtime'],$data['ctime'],$data['mimetype'],$mimePart,$user,$data['writable'],$data['encrypted'],$data['versioned']));
 		if(OC_DB::isError($result)){
 			OC_Log::write('files','error while writing file('.$path.') to cache',OC_Log::ERROR);
 		}
@@ -162,8 +162,8 @@ class OC_FileCache{
 		$oldPath=$root.$oldPath;
 		$newPath=$root.$newPath;
 		$newParent=self::getParentId($newPath);
-		$query=OC_DB::prepare('UPDATE *PREFIX*fscache SET parent=? ,name=?, path=? WHERE path=?');
-		$query->execute(array($newParent,basename($newPath),$newPath,$oldPath));
+		$query=OC_DB::prepare('UPDATE *PREFIX*fscache SET parent=? ,name=?, path=?, path_hash=? WHERE path_hash=?');
+		$query->execute(array($newParent,basename($newPath),$newPath,md5($newPath),md5($oldPath)));
 	}
 
 	/**
@@ -285,12 +285,12 @@ class OC_FileCache{
 	 * @return int
 	 */
 	private static function getFileId($path){
-		$query=OC_DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path=?');
+		$query=OC_DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path_hash=?');
 		if(OC_DB::isError($query)){
 			OC_Log::write('files','error while getting file id of '.$path,OC_Log::ERROR);
 			return -1;
 		}
-		$result=$query->execute(array($path));
+		$result=$query->execute(array(md5($path)));
 		if(OC_DB::isError($result)){
 			OC_Log::write('files','error while getting file id of '.$path,OC_Log::ERROR);
 			return -1;
@@ -367,8 +367,8 @@ class OC_FileCache{
 			}
 		}
 		$path=$root.$path;
-		$query=OC_DB::prepare('SELECT ctime,mtime,mimetype,size,encrypted,versioned,writable FROM *PREFIX*fscache WHERE path=?');
-		$result=$query->execute(array($path))->fetchRow();
+		$query=OC_DB::prepare('SELECT ctime,mtime,mimetype,size,encrypted,versioned,writable FROM *PREFIX*fscache WHERE path_hash=?');
+		$result=$query->execute(array(md5($path)))->fetchRow();
 		if(is_array($result)){
 			if(isset(self::$savedData[$path])){
 				$result=array_merge($result,self::$savedData[$path]);
@@ -389,8 +389,8 @@ class OC_FileCache{
 			}
 		}
 		$path=$root.$path;
-		$query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE path=?');
-		$result=$query->execute(array($path));
+		$query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE path_hash=?');
+		$result=$query->execute(array(md5($path)));
 		if($row=$result->fetchRow()){
 			return $row['size'];
 		}else{//file not in cache
@@ -579,8 +579,8 @@ class OC_FileCache{
 		$mtime=$view->filemtime($path);
 		$isDir=$view->is_dir($path);
 		$path=$root.$path;
-		$query=OC_DB::prepare('SELECT mtime FROM *PREFIX*fscache WHERE path=?');
-		$result=$query->execute(array($path));
+		$query=OC_DB::prepare('SELECT mtime FROM *PREFIX*fscache WHERE path_hash=?');
+		$result=$query->execute(array(md5($path)));
 		if($row=$result->fetchRow()){
 			$cachedMTime=$row['mtime'];
 			return ($mtime>$cachedMTime);
diff --git a/lib/util.php b/lib/util.php
index fa5b3daaab6ccaf788dffc593e64e28215a9d227..529b6d958fbcd0c8718d3472c9e2a7ac53a4d484 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -66,7 +66,7 @@ class OC_Util {
 	 * @return array
 	 */
 	public static function getVersion(){
-		return array(3,00,3);
+		return array(3,00,4);
 	}
 
 	/**