Statistical optimization of octree searches