Professional Documents
Culture Documents
31.01
EXISTS no semi-join but with index
6.83
EXISTS - merge semi-join
6.69
IN-based subquery
Star_transformation
Star
0.24
Concatenated index
0.01
0 1 2 3 4 5 6 7 8 9 10
60
50
40
Elapsed time
30
20
10
0
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300
Array size
Hint #10: Consider PL/SQL for
“tricky” SQL
With SQL you specify the data you want, not how to
get it. Sometime you need to specifically dictate your
retrieval algorithms.
For example:
– Getting the second highest value
– Doing lookups on a low-high lookup table
– Correlated updates
– SQL with multiple complex correlated subqueries
– SQL that seems to hard to optimize unless it is broken into
multiple queries linked in PL/SQL
Oracle8i PL/SQL Improvements
– Array processing
– NOCOPY
– Temporary tables
– The profiler
– Dynamic SQL