Speed up SQL NOT IN query MySQL
If your goal is to look at every row in A and do something with it, there is a much more efficient way.  (It seems that B is merely there to see what you have already processed.)

The reason for it getting slower is that it has to do more work as it gets farther into A -- namely skipping over the rows it has processed.  A processed flag might suffer the same malady.

So...

Walk through A processing chunks as you go.  Then remember where you left off so that the next 10000 will be right there, no searching.  I discuss that in more detail with an eye to DELETEing, but it can be adapted for other purposes:  http://mysql.rjweb.org/doc.php/deletebig#deleting_in_chunks  With that, B is unnecessary.

Partitioning

If you are thinking about partitioning the data by months, I have to ask you "Why?".  Here are some answers:


For performance?  You won't get any.
For rapid deletion of "old" data?  This is a good use case, but be sure to use PARTITION BY RANGE(...) and include the year, too.  More:  http://mysql.rjweb.org/doc.php/partitionmaint