I’m not sure how parallelism and concurrency in DBMS work. Here are the gaps in my understanding:
I understand that a transaction is made up of multiple instructions. And in my head, it makes sense that intra-transaction operations are parallelizable. I can imagine a quite a number of elementary situations where certain parts of the transaction do not depend on earlier parts, but I’m not sure that’s how it works.
So my first question would be: Is intra-transaction concurrency possible?
Can you write a transaction in such a way that some instructions within the transaction are processed in parallel with other instructions within the same transaction?
Follow-up question: If the answer to that question is yes and transactions are not necessarily executed by a single thread, in the context of DBMS, what does parallelism mean and what does Concurrency Control do?
Is parallel execution:
a.) splitting the instructions of many transactions among multiple threads, or
b.) having a single thread execute each transaction operation in sequence and multiple threads handle their own transaction?
For ease of understanding, let’s assume it’s an embarrassingly parallel set of transactions.
Follow-up-follow-up question: From my understanding, I’m inclined to say b is the answer. But if that’s the case, my question is is it more efficient or do we avoid a because scheduling (a) is a nightmare.
I feel like there’s a possibility for efficiency gains in a) if transactions are broken down into their individual operations and then SIMD instructions are used.
Lastly, I acknowledge that it may be different for OCC and PCC systems. From what I’ve read, it makes sense that because the read/write sets of PCC systems are known in advance, it’s possible to break them down for intra-transaction parallelism, but I don’t know if that’s feasible in OCC systems.
I know this is a lot; I just wanted to explain my thought process in case I missed something fundamental. And for ease, here are my questions restated:
- What is parallelism in the context of DBMSs?
- Is intra-transaction parallelism possible in the context of DBMSs? Is the answer different for OCC and PCC systems?
- If yes, how exactly does intra-transaction parallelism work in DBMSs? Is it different for OCC and PCC systems?
Thank you in anticipation!