Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

dbms_stats

Posted on 2011-03-19
10
366 Views
Last Modified: 2012-05-11
Hi, can anybody tell me, by taking out statistics for any table, does we see the performance increase while we perform update, insert or select statement over that table.
0
Comment
Question by:irukulla
  • 3
  • 2
  • 2
  • +1
10 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35173531
Removing statistics on a table basically makes the optimizer revert to rule based.  It will change performance but better or worse depends.

I would only do this in rare situations.  Let the cost based optimizer do its job.
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 167 total points
ID: 35173538
Whenever the statistics can help to process the where clause better, you should see an improvement if they are there. Without stats assumptions need to be made, like "comparing on equal on a non-unique column will result in 10% rows". Totally misaligned stats however are worse than no stats, so if you have stats you need to refresh them regularly.
Stats have most impact on SELECT statements. DML statements (insert, update) might not make good use of stats because the corresponding data and index pages need to be changed anyway, leading to a less "optimal" execution path then with a SELECT, but that's inevitable.
0
 

Author Comment

by:irukulla
ID: 35173547
@slightwv

i had seen an issue in my awr report where it shows an update statement is taking total of 49% of db time and is it due to indexing and stale stats for that table?

think there are no stats on that table and i take out stats, will i able to see the performance gain?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 167 total points
ID: 35173558
To fix 'stale' just update the stats and retry the update.

I suppose you can try removing stats.  It can help in limited situations but 'limited'.
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 35173564
As said, stale stats are (usually) worse then no stats. You can always update, remove, add stats at any time, and monitor the outcome. And that is the only way to "know" for sure. There is no all-purpose answer, because it depends on so many factors, all related to your data and table/index structure.
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 166 total points
ID: 35174073
statistics have no peformance impact at all on execution of a query , be it insert, update, select, delete or merge.

statistics help give the optimizer information about how to generate a plan of execution, but they don't actually affect how that plan performs.

to use an analogy...

statistics will help you give directions to someone, for instance Street X has heavy traffic so use Street Y instead.  

When I actually use your directions, I might encounter unusual traffic on Y so, even though it was the preferred plan, I get to the destination slowly
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 35326641
Objection: The question has been answered by several experts in depth - why do want to delete it? In particular "old posting" isn't anything I can consider appropriate as reason for deletion here.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 35332980
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I rollback insert statements after commit in oracle? 7 227
Can i Import Access Table Into Oracle Using Toad 36 220
PL SQL Search Across Columns 4 52
use lov values 2 61
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question