• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 380
  • Last Modified:

dbms_stats

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
irukulla
Asked:
irukulla
  • 3
  • 2
  • 2
  • +1
3 Solutions
 
slightwv (䄆 Netminder) Commented:
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
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
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
 
irukullaAuthor Commented:
@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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
slightwv (䄆 Netminder) Commented:
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
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
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
 
sdstuberCommented:
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
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
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
 
sdstuberCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now