getAllRowsForColumns and improvements