Added fetch size optimization and test for it.