Issue 331 optimizing index