05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 14 ■ PARALLEL EXECUTION 639<br />

we can see that as we load more <strong>and</strong> more data into the table UNIFORM_TEST using parallel<br />

direct path operations, the space utilization gets worse over time. We would want to use a significantly<br />

smaller uniform extent size or use the AUTOALLOCATE. The AUTOALLOCATE may well<br />

generate more extents over time, but the space utilization is superior due to the extent trimming<br />

that takes place.<br />

Parallel Recovery<br />

Another form of parallel execution in <strong>Oracle</strong> is the ability to perform parallel recovery. Parallel<br />

recovery may be performed at the instance level, perhaps by increasing the speed of a recovery<br />

that needs to be performed after a software, operating system, or general system failure.<br />

Parallel recovery may also be applied during media recovery (e.g., restoration from backups).<br />

It is not my goal to cover recovery-related topics in this book, so I’ll just mention the existence<br />

of parallel recovery in passing. I recommend the following <strong>Oracle</strong> manuals for further reading<br />

on the topic:<br />

• <strong>Oracle</strong> Backup <strong>and</strong> Recovery Basics for information regarding parallel media recovery<br />

• <strong>Oracle</strong> Performance Tuning Guide for information regarding parallel instance recovery<br />

Procedural Parallelism<br />

I would like to discuss two types of procedural parallelism:<br />

• Parallel pipelined functions, which is a feature of <strong>Oracle</strong>.<br />

• “Do-it-yourself (DIY) parallelism,” which is the application to your own applications of<br />

the same techniques that <strong>Oracle</strong> applies to parallel full table scans. DIY parallelism is<br />

more of a development technique than anything built into <strong>Oracle</strong> directly.<br />

Many times you’ll find that applications—typically batch processes—designed to execute<br />

serially will look something like the following procedure:<br />

Create procedure process_data<br />

As<br />

Begin<br />

For x in ( select * from some_table )<br />

Perform complex process on X<br />

Update some other table, or insert the record somewhere else<br />

End loop<br />

end<br />

In this case, <strong>Oracle</strong>’s parallel query or PDML won’t help a bit (in fact, parallel execution of<br />

the SQL by <strong>Oracle</strong> here would likely only cause the database to consume more resources <strong>and</strong><br />

take longer). If <strong>Oracle</strong> were to execute the simple SELECT * FROM SOME_TABLE in parallel, it<br />

would provide this algorithm no apparent increase in speed whatsoever. If <strong>Oracle</strong> were to perform<br />

in parallel the UPDATE or INSERT after the complex process, it would have no positive<br />

affect (it is a single-row UPDATE/INSERT, after all).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!