Update refcount when cloning
Add file_id index to document