Issue #23162:improve performance of getlocationid with index