Skip to content
Home » Inter and Intra operation Parallelism

Inter and Intra operation Parallelism


INTER-OPERATION & INTRA-OPERATION PARALLELISM

(Parallel Databases – Detailed Discussion)

Parallel databases achieve high performance by dividing tasks among multiple processors.
Two fundamental types of intra-query parallelism are:

  1. Intra-Operation Parallelism
  2. Inter-Operation Parallelism

These techniques improve the response time of a single large query by executing different parts in parallel.


1. INTRA-OPERATION PARALLELISM

Definition

Intra-Operation Parallelism means performing a single database operation (such as scan, join, sort, aggregation) in parallel using multiple processors.

Here, one operation of the query is broken into smaller tasks, each handled by different CPUs/disks.


Why Use Intra-Operation Parallelism?

✔ Greatly speeds up heavy operations on large datasets
✔ Speeds up table scans, joins, sorting, grouping
✔ Necessary for OLAP, Data Warehousing, Big Data
✔ Utilizes multiple processors efficiently


Types of Intra-Operation Parallelism

There are three main types:


A. Partitioned (Parallel) Scanning

A table is divided horizontally into partitions across multiple disks or nodes.

Each processor scans one partition:

CPU1 → Partition 1  
CPU2 → Partition 2  
CPU3 → Partition 3  
CPU4 → Partition 4

Result: Faster table scan (4× speedup for 4 CPUs)


B. Parallel Sorting

Sorting large data is time-consuming, so DBMS divides:

  1. Break data into chunks
  2. Each CPU sorts its chunk
  3. Sorted chunks merged in parallel

Used in parallel merge sort and external sorting algorithms.


C. Parallel Join

Joins are among the most expensive operations.
Parallel joins include:

  1. Parallel Hash Join
    • Build hash table on partitions
    • Probe in parallel
  2. Parallel Nested Loop Join
    • Blocks distributed among processors
  3. Parallel Merge Join
    • Sort partitions
    • Merge simultaneously

D. Parallel Aggregation

Aggregation functions (SUM, AVG, COUNT, GROUP BY) can be executed locally:

CPU1 → SUM on Partition 1  
CPU2 → SUM on Partition 2  
CPU3 → SUM on Partition 3  

Final result = merge of local aggregates.


Benefits of Intra-Operation Parallelism

  • Speeds up operations on large tables
  • Balances load across processors
  • Achieves almost linear scale with more CPUs
  • Reduces total query response time

2. INTER-OPERATION PARALLELISM

(Also called Pipeline Parallelism)

Definition

Inter-Operation Parallelism means executing different operations of the same query plan simultaneously.

Each operator of the query (scan, join, sort) runs in a pipeline, producing output tuples as soon as they are available, without waiting for the previous operation to finish completely.


How It Works?

A query execution plan consists of multiple operators:

Example:

σ (Salary > 50000)
         |
     Hash Join
         |
     Table Scan

With pipeline parallelism:

  • Table Scan starts reading rows
  • Hash Join starts processing these rows immediately
  • Selection starts filtering as soon as join outputs tuples

All three operators overlap in time.


Types of Inter-Operation Parallelism

There are two levels:


A. Independent Parallelism

Two operations that do not depend on each other run simultaneously.

Example:

  • Query 1: Scan Table A
  • Query 2: Scan Table B

Both scans can run in parallel.


B. Pipeline (Producer–Consumer) Parallelism

The output of one operator is streamed directly into the next operator.

This reduces the total execution time significantly.


Benefits of Inter-Operation Parallelism

✔ Reduces overall execution time of a query
✔ Improves throughput
✔ Allows pipeline execution (continuous flow of data)
✔ Efficient for multi-step queries (scan → join → sort → aggregate)


Difference Between Intra-Operation & Inter-Operation Parallelism

FeatureIntra-Operation ParallelismInter-Operation Parallelism
What is parallelized?A single operationMultiple operators of a query
ExampleParallel join, parallel scanScan, join, sort processed together
GoalSpeed up heavy operationsReduce total query time
TypePartition-levelPipeline-level
Used inOLAP, large table operationsComplex query plans
ComplexityHighMedium

Example (MCA Exam Style)

Query:

SELECT Dept, AVG(Salary)
FROM Employees
GROUP BY Dept;

Using Intra-Operation Parallelism:

  • Table partitioned into 4 parts
  • Each CPU calculates local averages
  • Results merged into global average

Using Inter-Operation Parallelism:

  • Scan → handle tuples
  • GroupBy → starts processing early
  • Merge results in a pipeline

Result: Faster execution


Perfect 5–6 Mark Short Answer

Intra-Operation Parallelism breaks a single database operation (such as scan, join, sort) into parallel tasks executed on multiple processors. It speeds up heavy operations and supports large analytical queries.

Inter-Operation Parallelism (pipeline parallelism) executes different operations of a query plan simultaneously. Operators such as scan, join, and selection run in a pipeline, reducing total execution time.

Both help improve query performance in parallel database systems.