Solved

analyze tables

Posted on 2009-05-07
13
933 Views
Last Modified: 2013-12-19
For analyzing tables analyze table table_name estimate sample 10 percent.WHat is best value for givng sample percent. All my tbales have million records. The reason for this asking this let me explain my case. We will run conversion run job which we will insert 7 million records from staging to targert tables. This will take 1.5 days to complete(as we have many rules to load data into target tables).In between for every 5 hrs i need to stop job and analyze tables and restart again so that job runs faster.we have 40 tables to analyze.I dont want tto waste more time (sat 30-60mmin) for analyzing these tables.Appreciate your help regartding this.
0
Comment
Question by:vamsibat
[X]
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
  • 4
  • 4
  • 2
  • +1
13 Comments
 
LVL 18

Expert Comment

by:sventhan
ID: 24330326
Is it 10g or 9i?
0
 

Author Comment

by:vamsibat
ID: 24330423
its 10G
0
 
LVL 18

Expert Comment

by:sventhan
ID: 24330692
what is your statistics_level set to?
sql> show parameter statistics_level
If its typical or ALL then you're already analyzing those tables.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:vamsibat
ID: 24330817
statistics_level  is typical
0
 
LVL 18

Accepted Solution

by:
sventhan earned 250 total points
ID: 24330896
> i need to stop job and analyze tables and restart again so that job runs faster
Why do you analyze those tables in between the job runs? Is there anychanges to the schema causing you to do that?
Check with your last analyzed column on those tables in dba_tables view. You'll find the recent dates the table got analyzed.
0
 

Author Comment

by:vamsibat
ID: 24331134
The reason for analyzing tables in between is this job populates those tables i.e. before starting those tables will have 0 records.after job starts say after 4 hrs those tables will be populated with some laks records so statistics changes so proc is running slow.for that reson i am analyzing tables in between.

I posted a differrnt questiona and you are taking me to some other route.my question what sholud be best number for giving sample percent.
0
 
LVL 18

Expert Comment

by:sventhan
ID: 24331238
I know.
I've seen estimates as low as 5% - 10% be effective.  
Its all depends upon your data in that particular table and how much time you want to save. In order to  estimate the table's percentage is how much of the actual table should be looked intto collect the statistics, the common sense is being the larger the sample the more accurate the statistics should be. Overall, the estimate is smaller the statstics generation should be faster so there's a tradeoff between how fast and how through the estimates are. Computed statistics (use 100% of the rows) are probably best but usually take too much time to generate.




0
 
LVL 32

Expert Comment

by:awking00
ID: 24339298
Are you analyzing the staging or target tables?
0
 

Author Comment

by:vamsibat
ID: 24339326
I am analyzing both staging and target
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 250 total points
ID: 24346517
The reason you're having trouble getting the answer you want to hear is there is no single "best" number.  If there was, then Oracle wouldn't have it be a parameter at all, it would simply be a fixed number built into the process.

You can try using the automatic sampling and let Oracle determine how many rows to estimate.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 24567366
I recommend split 24330896 and 24346517
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

717 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