Method R is a commonsense method for optimizing a system. It is the straightforward process of answering the four natural questions about performance: How long? Why? What if? and What else?
To answer these questions, Method R prescribes four steps:
Method R was first documented in the book Optimizing Oracle Performance, for which Cary Millsap and Jeff Holt were named Oracle Magazine 2004 Authors of the Year. An updated and more detailed version is available in Cary Millsap’s The Method R Guide to Mastering Oracle Trace Data, 2nd Edition.
Method R has been used with tremendous success at Oracle sites since the mid-1990s. Although Method R was first documented in an Oracle context, its usefulness extends far beyond Oracle. In fact, the definition of Method R does not refer specifically to Oracle, databases, or even computers.
The four “magic” questions about performance of course aren’t really magic. They’re actually just four simple questions you naturally ask when something takes too long.
On the first pass through the four questions, you eliminate the waste you see. On the second pass, the waste that before was overshadowed by bigger problems is now prominent. After another pass or two, there’s no more wasted time left to eliminate, and your job is done.
These four questions about performance are how we tune our everyday lives. The questions aren’t magic; you’ve just stopped asking them at work because your tools don’t help you answer them.
“If I give you the budget for that upgrade you want, then how many hours will you be able to trim off that fourteen-hour report?” It’s the obvious question. But can you answer it by looking at an AWR report? Would you stake your career on it? Of course not. That’s why a debate breaks out every time there’s a conversation about performance.
The four “magic” questions. They’re how you make things go faster. And with Method R, they’re how you make Oracle go faster, too.
One of the biggest problems with Oracle Database tuning is that non-technical people (and even a lot of technical ones as well) can’t understand it. Although we invented Method R in an Oracle context, it’s easy to explain our method in everyday terms, because Method R is probably already the method you use to tune everyday things.
Imagine that your performance problem is this: every time you send your son on a shopping errand, it takes him an hour, and it’s really bothering you that it takes him this long. How can you optimize the process?
You’ve already executed step 1 of Method R by identifying the task that’s important to you: shopping for groceries. Step 2 says to measure that hour in detail. The best way to do that is by creating a profile, which is a spanning, non-overlapping account of your time. Think of a pie chart that explains where all your time has gone.
The pie chart is a good guide, but you can do more with the numbers behind the chart. Imagine that your profile looks like this:
|Talk with friends||37||62%||3|
|Walk to/from store||8||13%||2|
Now you can see exactly where your time has gone, and exactly how much time you can save. From this profile, it’s easy to begin imagining solutions, which is step 3. For example, you could reduce the shopping time by 62% (from 60 to 23 minutes) if your boy didn’t stop to chat. The profile also tells you what not to do: buying that car he wants is going to save only some fraction of 8 minutes; a car is certainly not where your performance leverage is here.
Step 4 says to stop your analysis when the cost of further optimization exceeds the benefit. It pays to be clever: the smartest optimizations are the ones that produce tremendous benefit at low cost.
We use the same general procedure to optimize computer software performance. The real tricks are learning how to create the profile, and then learning how to attack the problems that your profile reveals. That’s where our software, education, and consulting services enter the picture.
Oracle’s and Method R’s performance tools are not mutually exclusive. Just about every Method R customer in the world uses ASH (Active Session History), AWR (Automatic Workload Repository), and OEM (Oracle Enterprise Manager), too.
People use Method R software in conjunction with these other tools because Method R provides important additional value. Two examples:
Method R software saves you time by doing that hard work for you. We make it easy for developers and DBAs of all experience levels to learn exactly why your software consumes the time it does.
Sometimes, people with slow systems say that step 1 of Method R is difficult because every task is important, and every task is slow. Method R was designed in exactly these situations. Even when everything is slow, you see, something is the business’s most important thing to fix first.
Often, fixing one task collaterally fixes others as well. Regardless of whether you’re lucky enough for that to happen, Method R is designed so that the most important tasks get fixed first.
An experience doesn’t have to be broken to be important. Companies that routinely measure the performance of their important user experiences in the Method R way have a much better chance of preventing performance problems so that their users will never even see them.
For a lot more information, see chapter 18 in The Method R Guide to Mastering Oracle Trace Data, 2nd edition.