• There isn't a good way here. You need to move that much data, and it will block things.

    I still question this is really needed. No one can use 5mm rows at once, and if you are summarizing, why aren't you using SQL to do some summaries? Display smaller chunks of data, or pull back smaller chunks at a time.