Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

analyze tables

Posted on 2009-05-07
13
Medium Priority
?
936 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
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

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

Accepted Solution

by:
sventhan earned 1000 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 1000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

916 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