I have some problems with two massive related tables. First one has about 100 columns, second one about 300. The foreign key is on 5 columns. 100 million rows is nothing special in these tables.
My task is to download all the rows, process them and then upload. I need to download these tables in packs (10000 rows from parent table + all related to them rows from second table).
What would be the fastest way to do it?
Simplest solution would be downloading 10000 rows from parent table and then iterating through them to download related rows. Simple but I don't think it will be fast.
Other solution could be download with joining those two tables. Problem is that then I have to separate row in two parts, eliminate duplicates, etc. I also don't really know how fast this download would be.
So, my question is the same as in the title. What is the fastest way to download massive ammount of data from related tables in packs?