On Thu, Dec 19, 2019 at 5:34 PM onlinejudge95 <onlinejudg...@gmail.com> wrote: > > Hi Devs, > > A quick question. I am using Django to schedule some commands to populate > my PostgreSQL(Apart from using it as a web framework). I am currently > fetching records from a particular table and for each of those records > doing some calculation and storing the processed data in some other > database. The skeleton code looks like this > > > I need to know whether the use of generators is correct here, in the sense > that would it have any performance issues. The point that I am having > trouble understanding is a comment on my code review.
Performance should be dominated by the database speed. Whether you use a generator or not should be insignificant compared to the time taken by Postgres itself to perform the transaction. This should be done as a single transaction for reliability, and that also means that it will be a single transaction for performance. ChrisA -- https://mail.python.org/mailman/listinfo/python-list