0
0
DynamoDBquery~10 mins

Parallel scan in DynamoDB - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Parallel scan
Start Scan Request
Divide Table into Segments
Each Segment Scanned in Parallel
Collect Results from All Segments
Combine Results
Return Full Scan Output
Parallel scan splits the table into segments and scans each segment at the same time, then combines all results.
Execution Sample
DynamoDB
Scan with Segment=0, TotalSegments=2
Scan with Segment=1, TotalSegments=2
This example scans a table in 2 parallel segments, each scanning half the table.
Execution Table
StepSegmentScan RangeItems ScannedItems ReturnedAction
10First half of table5045Scan segment 0 starts
21Second half of table5048Scan segment 1 starts
30First half of table5045Segment 0 scan completes
41Second half of table5048Segment 1 scan completes
5--10093Combine results from both segments
6----Return combined scan results
💡 All segments scanned and results combined, scan completes.
Variable Tracker
VariableStartAfter Segment 0After Segment 1Final
ItemsScanned050100100
ItemsReturned0459393
SegmentsCompleted0122
Key Moments - 2 Insights
Why do we need to specify Segment and TotalSegments in a parallel scan?
Each scan worker must know which part of the table to scan (Segment) and how many total parts exist (TotalSegments) to avoid overlapping scans, as shown in execution_table rows 1 and 2.
Does parallel scan return results in order?
No, each segment scans independently and results are combined after all segments finish, so order is not guaranteed. See execution_table rows 3-6.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, how many items were scanned in total after both segments finished?
A93
B100
C50
D45
💡 Hint
Check the ItemsScanned column in rows 3 and 4 and the combined total in row 5.
At which step do both segments complete their scans?
AStep 2
BStep 3
CStep 4
DStep 5
💡 Hint
Look at the Action column for segment scan completions in rows 3 and 4.
If TotalSegments was increased to 4, how would the execution_table change?
AThere would be 4 segment scan rows instead of 2
BItemsScanned would double
CSegmentsCompleted would stay at 2
DScan results would be combined earlier
💡 Hint
Parallel scan divides the table into TotalSegments parts, so more segments mean more scan rows.
Concept Snapshot
Parallel scan splits a DynamoDB table into multiple segments.
Each segment is scanned independently and simultaneously.
Specify Segment and TotalSegments to control scanning.
Results from all segments are combined after all finish.
Improves scan speed by using parallel workers.
Full Transcript
Parallel scan in DynamoDB divides the table into segments. Each segment is scanned in parallel by separate workers. You specify which segment to scan and how many total segments exist. Each segment scans only its part of the table. After all segments finish scanning, their results are combined and returned as one complete scan output. This method speeds up scanning large tables by using multiple workers at once. The execution table shows two segments scanning halves of the table, then combining results. Variables track items scanned and returned per segment and overall. Key points include specifying segments correctly and understanding that results are combined after all segments finish. The visual quiz tests understanding of total items scanned, completion steps, and effect of changing total segments.