Optimize appending rows