While processing a large amount of data, you can use the cursor method in order to reduce memory usage.