Oracle Statistics what does it do? [message #53274] |
Tue, 10 September 2002 12:44 |
Lena
Messages: 17 Registered: August 2002
|
Junior Member |
|
|
Hi there
I have a dummy question
We run almost everyday a script after we drop and recreate tables, indexes PK etc. This script updates statistics, can someone please tell me what exactly is doing to database the statists, its very slow, do I need to do it all the time? were does it write? etc
thanks for any help
Lena
|
|
|
Re: Oracle Statistics what does it do? [message #53275 is a reply to message #53274] |
Tue, 10 September 2002 13:39 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
If you are using the cost based optimizer, then you need to have stats on your tables and indexes. The stats guide oracle in sdetermining the best execution plan for SQL statements. If you have no stats then Oracle uses rule based optimizer (CBO came in with 7.x).
You only need to gather stats on tables/objects which have had "large" amounts of insert/update/delete (or truncate) since they were last analyzed. If you are using "compute" in the scripts, you could replace it "estimate" which uses a smaller sample of data to read through, so is faster but not 100% accurate. estimate is normally just fine.
|
|
|