Iterating through database resultset in Pandas

Viewed 48

I just hoped you could help me understand this:

In the below, does chunk size submit lots of queries to the database? Or does it one run query & just process the chunks one by one?

I have a super slow database with lots of data. So, ideally, I want to query once, but handle it in chunks to avoid memory overload on the EC2 instance

Thanks

for data in pd.read_sql('SELECT * FROM TABLE ', iconn,  chunksize=10000000)
0 Answers
Related