Testing performance tweaks [message #216022] |
Wed, 24 January 2007 12:52 |
sournote1
Messages: 3 Registered: January 2007
|
Junior Member |
|
|
I am new at this so bear with me. I have a slow query I would like to speed up, and have been reading up on performance and query tuning and have several ideas to try out. But when I try them, it is hard to measure their effect, since the query times vary so widely.
What I would like to do is run the original, then run a tweaked version, and compare the execution times. I'd really like to run them alternately for five or ten cycles, to control for varying DB load. But caching causes all test runs after the first to be dramatically faster. I'm having to wait 24 hours to get my next meaningful execution time. And when I do that with the original untweaked query, the results vary by a factor of two or three from one repetition to the next, presumably because of varying load. If a tweak improved performance by 50% I might never know it because the repeatability of the test is so poor.
Is there some other way to compare the performance of the original and tweaked query? I have looked at the execution plans, but I have read that the values there are relative and not absolute. Are they valid for comparisons between queries?
What gets cached? The indexes, the execution plan, the data?
Is there a way to clear the cache?
Is there a way to specify that the query be run without using the cache?
Any advice would be appreciated.
This is Oracle 9i Enterprise, Release 9.2.0.6.0
Thanks in advance.
|
|
|
|
|
|
Re: Testing performance tweaks [message #216345 is a reply to message #216022] |
Fri, 26 January 2007 13:25 |
sournote1
Messages: 3 Registered: January 2007
|
Junior Member |
|
|
Thanks for your help, everyone.
It turns out I do have ALTER SYSTEM privileges (Don't tell anyone or they'll revoke it), but clearing the BUFFER_CACHE and the SHARED_POOL did not clear the query caching mechanism. They still run about 50 times faster the second time than the first.
I'm still working on the privileges for runstats.sql.
Does anyone have any more thoughts in the meantime?
Thanks again.
|
|
|
|
Re: Testing performance tweaks [message #216368 is a reply to message #216022] |
Fri, 26 January 2007 16:16 |
sournote1
Messages: 3 Registered: January 2007
|
Junior Member |
|
|
I went poking around the web and found discussion of the same undocumented equivalent in 9i:
alter session set events = 'immediate trace name flush_cache';
Thanks for the tip, I'll read the link more thoroughly and see if I missed something.
|
|
|
|