Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Database administrators perform a wide variety of taskssome exciting, and others more
routine. On the down side, not too many DBAs get really excited about setting up
backups, monitoring disk space, or checking to see if the exports ran okay last night. For
most DBAs, these tasks are not especially challenging, nor do they call for much creativity.
In stark contrast to these more mundane tasks, performance tuning is actually a very fascinating
part of database work; however, many DBAs do not realize how rewarding it can be. This
is unfortunate, because performance tuning is one of the DBAs greatest challenges, with
both tangible and intangible rewards. A truly competent performance-tuning specialist at
times looks like a magician performing the impossible, or helping a client through some
emergency.
How many jobs provide the opportunity to be an instant hero who saves the day by fixing
critical systems for a large corporation? Yet that is exactly what a skilled performance
expert can accomplish.
Let me share an example that illustrates the dynamics of performance tuning.
The Otrace performance problem was quickly solved, not because I was so smart, or knew some
clever tricks, but because I was aware of some fundamental problems with the database,
-1-
4/13/2015
Magicians Trick #1
Nothing can substitute for a solid understanding of
database principles.
Throughout the book, we will be providing Magicians Tricks that emphasize critical points in
performance tuningpoints that are frequently overlooked or misunderstood. Some of
these axioms might seem obvious at first, but many of these common sense tips are not
so commonly practiced.
Magicians Trick #1 might appear to be obvious, but experience indicates the opposite. Perhaps
it is just ignorance, but many analysts seem to dread the hard work necessary to truly
understand how an Oracle database operates. Instead, these misguided analysts continually
look for the silver bullet that will magically solve the tough performance problem.
-2-
4/13/2015
Magicians Trick #2
The key to successful performance tuning is not
technical sophistry, but rather, a sound approach
based on good understanding of basic principles.
In other words, the successful performance analyst is no smarter than other DBAs; he has just
learned an overall process that has proven successful.
Since my experience with solving the Otrace problem during the interview, I give other DBAs the chance to do the
same. When I interview prospective DBAs, I sometimes include a perplexing performance problem that I have been
unable to solve. So far, no candidate has ever provided a quick solution, but I keep trying.
-3-
4/13/2015
4/13/2015
Magicians Trick #3
The principles of sound performance tuning do not
change from version to version.
To illustrate Trick #3, consider how the Oracle optimizer joins two tables. The way of
performing table joins has stayed nearly constant, even as database horns and whistles
have been added. This means that, regardless of database version, the performance
specialist must understand the difference between a nested loop and sort/merge join.
Armed with this understanding, a large number of Sql performance problems can be
solved, regardless of the exact database version.
-5-
4/13/2015
Art or Science?
Some specialists have argued that performance tuning is purely a sciencesimply the
application of sound mathematics to a given problem. This notion is very appealing,
because it suggests a nice, clean, deterministic way to solve any problem. Attractive as this
idea is, does it really match reality?
In reality, performance tuning is rarely 100% pure science. Rarely are performance problems
handed to the DBA on an index card. In practice, performance problems take place in
complex, even whacky organizations, filled with misinformation and human egos.
Even when the root cause of a performance problem can be determined through a heuristic, the
solution often calls for creative thinking. For instance, creative thinking (and tact) is often
needed when the root cause of a performance difficulty is traced to the application. The
designers may resist calls for changing their code, or argue that certain changes are too
expensive, or simply not feasible. The professional performance expert cannot walk away
at this point, but has an obligation to work with the designers to synthesize an acceptable
solution. At this point, the DBA is more of an artist than a scientist.
Thus, solving serious performance problems is not merely a mechanistic process, such as solving
an equation in a school textbook. There are frequently other points to consider, such as
determining what problem to solve, wading through misinformation, or dealing with the
human factor. Of course, good analytic skills are necessary, but so are good creative skills.
To ignore either aspect is to misunderstand how technical problems are solved in practice.
In the next chapter, we will go backstage to explore the steps followed by performance tuning
experts. We will see that the ideal performance analyst is not just a scientist, but a man or woman
who wears many hats, depending on the occasion.
-6-
4/13/2015