Oracle Performance Firefighting
by Craig Shallahamer

Get the book here



Craig Shallahamer's Blog

You were brought to this page based on an internet search and as a free service to Oracle DBAs.

The text below is an except from the book, Oracle Performance Firefighting, written by Craig Shallahamer of OraPub, Inc. Figures and tables are not included on this page, only their reference.
To order the book in either print or PDF form, click here.


©2009, 2010 by Craig Shallahamer. This is copyrighted material.
Please—Out of respect for those involved in the creation of the book and also for their familes, we ask you to respect the copyright both in intent and deed. Thank you.

-------------------------------

Figure 7-8. Shown is an example of a text hashing and bucket assignment function written in Perl. The hash function is the modulus (%) operator.

Figure 7-9 shows multiple runs of the hash_text.pl script. Look very closely at the differences in the SQL text. While each statement is syntactically identical, there is a single character difference in each statement. The second statement has a capital T, and the third statement simply has an additional space after the select. Based on this hash value function and the hash function, this seemingly insignificant difference was enough to produce different hash values and also different hash bucket assignments. This is why Oracle SQL must be textually exact, or a new cursor will be created for each textually unique statement. This is important for developers to understand, because unless they are told, it is highly unlikely they would assume even the statement spacing must be the same.

Figure 7-9. Shown is the result of three syntactically exact SQL statements, which yield different hash values and also hash bucket assignments.

©2009, 2010 by Craig Shallahamer. This is copyrighted material.
Please—Out of respect for those involved in the creation of the book and also for their familes, we ask you to respect the copyright both in intent and deed. Thank you.


Know what's important before it's too late!

OraPub's
Performance Training

is like no other...





More Class Pics...
Get student testimonials!