DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: analyze tables

  1. #1
    Join Date
    Aug 2000
    Location
    NJ
    Posts
    54

    Angry

    for the stats to be proper, does the anlyse table compute statistics be run by system or by the schema owner ?

    Please help.
    How do i check for the stats ?


    Geo

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    If you are the owner of the table/indexes then you can run it, if you are not the owner and do not have the write permissions, then you use sys/system to analyze.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Aug 2000
    Location
    NJ
    Posts
    54
    Thanks,

    is there any way to see if the stats are proper ?

    Geo

  4. #4
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Yes you can check it form the user_tables, user_indexes, dba_tables, dba_indexes. They all use the same table like all_tables and all_indexes in the back to query the information for you.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  5. #5
    Join Date
    Mar 2001
    Posts
    188
    Is there an advantage to analyze a table estimate or compute.
    I know the different. At compute the hole table will be analyze. So it is exacter and by estimate there will be used the first 1024 rows of a table to analyze.

    And i know if the lengths of the rows are shaking then it is more better to use the compute statistics.

    Is there more advantages or points to know.
    Best Regards
    Thomas Schmidt

    Thomas_Schmidt@eplus-online.de
    If you have no aims, you will never reach a goal !!!

  6. #6
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    well, first of all when you estimate stats, you specify the number of lines that is used. I often use estimate on 30000 lines, so small tables are computed (and not estimated), and you don't spend too much time calculating stats on big tables. Furthermore, my experience has shown that 30000 lines gives quite reliable stats

    to know when stats were last computed, just check last_analyzed in [user/all/dba]_tab_columns

  7. #7
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Analyze command may not produce accurate result. It is better to use DBMS_STATS package for computing statistics.

  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by tamilselvan
    Analyze command may not produce accurate result. It is better to use DBMS_STATS package for computing statistics.
    I've found that DBMS_STATS takes longer (at least twice as long in my case) to analyze your database than DBMS_UTILITY. Anybody else find this?

    Jeff Hunter

  9. #9
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    Just thought I'd add my .02 here.

    Compute vs. Estimate - I *always* use compute. Sorry, but I've never trusted estimating statistics, and after the 8.1.6.2 upgrade debacle, it's going to take an awful lot to convince me otherwise.

    As for the packages - never use them. I don't see the advantage since they provide no additional functionality or performance.

    As for speed, the problem is that almost *every* place I've gone to has done serial ANALYZE statement. *No wonder* they take forever. For example, the last project I was just on was doing an Estimate of 30% in 8.1.6.0, where it was *actually* only doing 1-3% (that was the bug), and it still took something like 3 hours to perform. Once 8.1.6.2 was installed and it actually started doing 30%, it climbed to over 6 hours.

    When I propsed using COMPUTE on all the tables, they naturally balked and said "We don't have that kind of time". A simple procedure later and I was running 8 of them in parallel and cut the time back down to 3 hours. They are in Stress Testing again and are going to try running more in parallel (they have 24 procs), so I expect that will get even shorter.

    So IMHO, COMPUTE is far better than ESTIMATE, and it is simple enough to fix the 'time' issue.

    - Chris

  10. #10
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    I think DBMS_STATS analyze in parallel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width