OCI Versus Thin Drivers
Oracle’s documentation states that you should use the OCI driver for maximum performance and the Thin driver for maximum portability. However, I recommend using the Thin driver all the time. Let’s take a look at some numbers from Windows 2000. Table 19-9 lists all the statistics we’ve covered in this chapter.
Table 19-9. OCI versus Thin driver timings (in milliseconds)
|
Metric |
OCI |
Thin |
|---|---|---|
|
1,000 inserts with auto-commit |
3,712 |
3,675 |
|
1,000 inserts with manual commit |
2,613 |
2,594 |
|
1 insert with |
10 |
10 |
|
1,000 inserts with |
2,804 |
2,583 |
|
1 insert with |
113 |
113 |
|
1,000 inserts batched |
1,482 |
367 |
|
SELECT |
10 |
10 |
|
Predefined SELECT |
10 |
10 |
|
1 insert with |
113 |
117 |
|
1,000 inserts with |
1,723 |
1,752 |
|
Totals |
12,590 |
11,231 |
As you can see from Table 19-9, the Thin driver
clearly outperforms the OCI driver for every type of operation except
executions of CallableStatement objects. On a Unix
platform, my experience has been that the
CallableStatement numbers are tilted even more in
favor of the OCI driver. Nonetheless, you can feel completely
comfortable using the Thin driver in almost any setting. The Thin
driver has been well-tuned by Oracle’s JDBC development team to
perform better than its OCI counterpart.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access