I am using Room with coroutines to store/retrieve data. From another post I saw that you could technically have unlimited number of retrievals from the database at the same time. Currently, I am working with a very large dataset that I want to retrieve. This is on the order of 10,000,000 rows. I split this up into smaller reads say by 4 (2,500,000), that all occur in parallel. This decreases my retrieval time by 30-40% which is what I want (this is relative to a single DB read). What bothers me is that when I increase this split value past 4, it actually slows down. I would think adding more parallel coroutines would keep splitting the time down.
I verified that all coroutines that are working in parallel are all unique threads so they are not clashing that way.
Does anyone have any idea why this is happening? I was thinking maybe Room/SQL has a limit of the number of concurrent connections, however this should not be the case based on (5) in this link:
SQlite Frequently Asked Questions
Any help would be appreciated!