maxrows should be at least 1.