3 ms·
How about this: 21 million primary keys are easily kept in memory. Sort them. Then do "SELECT id FROM five_billion_rows ORDER BY id" and iterate over that wit
by bhaak 7y ago
How about this:
21 million primary keys are easily kept in memory. Sort them.
Then do "SELECT id FROM five_billion_rows ORDER BY id" and iterate over that with the CSV ids in lockstep.
Cursor management is pretty good in Oracle, this is likely much better than your own paging with 1k of IN values. I would assume that it would be IO bound regarding the index of the id column.
This also might be an interesting question for "Ask HN".