SQL query which is fetching data from five tables in Oracle 18.104.22.168.0 on Linux 5 , taking double of the time to fetch the data before it used to take, i have gathered statistics of all tables by seeing the view dba_tab_statistics under that column stale_statistics , but no affect or impact of that, so could any one suggest me how to tune the SQL query step by step. i would appreciate a lot.
Thanks & Regards.
Obtain an explain plan of the query and save if for future reference. Check how tables are accessed and filtered, compare in your mind whit what you expected in terms of index utilization - if there is an index that "you know better it should be used" then run the query with a hint that forces the use of the index... check execution time and get a new explain plan to be sure index is in use.
Trace the query - check wait event looking for where is that most time is spent then depending on the wait event you have to fine tune either your query or your indexing strategy.
In general terms what you have to accomplish is to get buffer_gets number down as much as possible.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
What about statistics on indexes?
Originally Posted by younusdba
Then follow PAVB's instructions....
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Tags for this Thread
Click Here to Expand Forum to Full Width