Index range query and test