Databases Reference
In-Depth Information
Table 2-1
Fastest to Slowest Processing of Data Types
Data Type
Processing
binary
Transfer of raw bytes from database to application buffers.
int, smallint, float
Transfer of fixed formats from database to application buffers.
decimal
Transfer of proprietary data from database to database driver. Driver
must decode, which uses CPU, and then typically has to convert to a
string. (Note: All Oracle numeric types are actually decimals.)
timestamp
Transfer of proprietary data from database to database driver. Driver
must decode, which uses CPU, and then typically has to convert to a
multipart structure or to a string. The difference between timestamp
processing and decimal is that this conversion requires conversion
into multiple parts (year, month, day, second, and so on).
char
Typically, transfer of larger amounts of data that must be converted
from one code page to another, which is CPU intensive, not because
of the difficulty, but because of the amount of data that must be con-
verted.
Figure 2-8 shows a comparison of how many rows per second are returned
when a column is defined as a 64-bit integer data type versus a decimal(20) data
type. The same values are returned in each case. As you can see in this figure,
many more rows per second are returned when the data is returned as an integer.
400000
350000
300000
250000
200000
150000
100000
50000
0
1
2
3
4
5
6
7
8
9
10
Threads
Decimal(20)
64-bit Integer
Figure 2-8
Comparison of different data types
Search WWH ::




Custom Search