Académique Documents
Professionnel Documents
Culture Documents
Overview
Whalen, Garcia, Patel, Misner, Isakov, Microsoft SQL Server 2005 Administrators Companion (Microsoft Press, 2007)
Buffers
Location of BLOB data types
storage in buffer not BLOB
DT_WSTR
50
DT_I4
4
100
DT_WSTR
25
50
DT_BOOL DT_BOOL
+ 1
+ 1
DT_WSTR
15
+ 30
+ 2
DT_I2
2
DT_I2
2
DT_CY
8
+ 2
+ 8
10,000
DefaultMaxBufferRows
= 2MB
DT_CY
8
+ 8
= 201
bytes
Buffers
Row 1
x
x
x
x
.
.
.
x
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
x
x
x
x
.
.
.
x
x
x
x
x
.
.
.
x
xxxxx
xxxxx
xxxxx
xxxxx
.
.
.
xxxxx
xxx
xxx
xxx
xxx
.
.
.
xxx
xxx
xxx
xxx
xxx
.
.
.
xxx
xxx
xxx
xxx
xxx
.
.
.
xxx
xxxx
xxxx
xxxx
xxxx
.
.
.
xxxx
x
x
x
x
.
.
.
Row
100,000 x
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
x
x
x
x
.
.
.
x
x
x
x
x
.
.
.
x
xxxxx
xxxxx
xxxxx
xxxxx
.
.
.
xxxxx
xxx
xxx
xxx
xxx
.
.
.
xxx
xxx
xxx
xxx
xxx
.
.
.
xxx
xxx
xxx
xxx
xxx
.
.
.
xxx
xxxx
xxxx
xxxx
xxxx
.
.
.
xxxx
Row
50,000
Row
50,001
Audit
Character Map
Conditional Split
Copy Column
Data Conversion
Derived Column
x
x
x
x
.
.
.
x
xxxxxxx
ccccccc
xxxxxxx
ccccccc
ccccccc
xxxxxxx
ccccccc
xxxxxxx
.
.
.
xxxxxxx
ccccccc
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
x
x
x
x
.
.
.
x
x
x
x
x
.
.
.
x
These transforms
operate on the same buffer
from start to finish
Export Column
Import Column
Lookup (no cache or partial cache)
Lookup
Col A
x
x
x
x
.
.
.
x
Col B
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
Col C
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
Col D
c
c
c
c
.
.
.
c
OLE DB
Command
Col E
x
x
x
x
.
.
.
x
These transforms
operate row by row
but cant work on same
buffer simultaneously
Partially-Blocking Transformations
Term Lookup
Unpivot
Union All
Col B
Col C
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
Col A
Col
Col E
x
x
x
x
.
.
.
x
x
x
x
x
.
.
.
x
x
x
x
x
.
.
.
x
Merge Join
Col A
x
x
x
x
.
.
.
x
Col B
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
Col C
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
Col D
x
x
x
x
.
.
.
x
Col E
x
x
x
x
.
.
.
x
Partially-blocking
transforms
might wait on other
inputs and always
produce new buffer
Blocking Transformations
Sort
Term Extraction
Script Component (if code must read all rows)
Aggregate
Fuzzy Grouping
Fuzzy Lookup
Row Sampling
Col A
D
x
x
x
x
.
.
.
x
Col B
Col C
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
.
.
.
xxxxxxx
Col
x
x
x
x
.
.
.
x
Aggregate
Col A
x
x
Col D
x
x
These transforms
stop pipeline until all rows read
and always produce new buffer
Synchronous
Operate
on
Same buffer
Asynchronous
Buffer 0
Partially blocking
Blocking
Output into
Buffer 1 New buffer
Buffer 0
Buffer 2
Input rows
=
Output rows
Buffer 0
Buffer 1
Input rows
<>
Output rows
(usually)
Execution Trees
Tree 2
Tree 3
Tree 1
Tree 0
Execution Trees
Tree 1
Buffer size =
greatest number of columns x data length
at any point in execution tree
Execution Threads
Tree 2
Tree 3
Tree 1
Tree 0
Thread 0
Thread 1
Thread 2
Thread 3
Thread 4
Thread 5
Estimated
Max
Buffer
=
Buffer
Size
Rows
(EBS)
Yes
Yes
No
Is EBS
> DefaultBufferSize?
No
Is EBS
< 65,536 bytes?
Yes
Reduce the number of columns and use smallest data types possible
User:BufferSizeTuning
DFT Transform-Load
Rows in buffer type 5 would cause a buffer size greater than the configured
maximum.
There will be only 15065 rows in buffers of this type.
-1 = Number of processors +2
Audit
Character Map
Conditional Split
Copy Column
Data Conversion
Derived Column
Uses sp_executesql
(faster than OPENROWSET)
Clustered index?
Set rows per batch for faster inserts
Or
Drop the index, load rows, and rebuild index
Summary
Pipeline Buffers
Performance Monitoring
Resources
Top 10 SQL Server Integration Services Best Practices
http://tinyurl.com/7hasrbm
http://tinyurl.com/lzaeszr
http://tinyurl.com/lk57stq