SQL query which is fetching data from five tables in Oracle 22.214.171.124.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.
What about statistics on indexes?
Originally Posted by younusdba
Then follow PAVB's instructions....