What is COMPUTE STATISTICS in index

Hi,
I need the explanations of compute statistics in index.
what is compute statistics?
Regards,
B.Prakash

Hi,
Compute statistics tells Oracle to collect statistics during the creation of the index. The statistics are then used by the optimizer to choose a "plan of execution" when SQL statements are executed.
Thanks

Similar Messages

  • COMPUTE STATISTICS caluse for database 10g with compatible parameter 9.2.0

    Hello,
    We have to use COMPUTE STATISTICS clause for index in oracle 9i and eariler.
    But from oracle 10g we do not need to compute statistics after index creation.
    I am using databse of oracle 10g R2 but my compatible paramtere is 9.2.0 then should I use COMPUTE STATISTICS for my index?
    Can anyone explain?
    Edited by: user10540254 on Dec 23, 2011 12:44 AM

    use this :
    using analyze table <table_name> compute statistics;

  • Compute Statistics after create a index

    Good night, I tryed it before and got no help.
    So I'll try it again, because I didn't find it yet.
    I have to create some indexes in a production database.
    I have a doubt.
    Do I need to Compute Statistics after creating indexes?
    Or when I create they automatically are computed?
    Thanks for any help.
    The version I'm using is:
    Oracle Database 10g Release 10.2.0.5.0 - 64bit Production
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production

    Petri BR wrote:
    Good night, I tryed it before and got no help.
    So I'll try it again, because I didn't find it yet.
    I have to create some indexes in a production database.
    I have a doubt.
    Do I need to Compute Statistics after creating indexes?after CREATE INDEX what are the values for the index statistics?
    Or when I create they automatically are computed?Just look at the statistics values after issuing CREATE INDEX & answer the question yourself!

  • Compute Statistics after creating indexes

    Hi, I have to create some indexes in a production database.
    I have a doubt.
    Do I need to Compute Statistics after creating indexes?
    Or when I create they automatically are computed?
    Thanks for any help.
    Edited by: Petri BR on May 14, 2013 3:39 PM

    Petri BR wrote:
    Hi, I have to create some indexes in a production database.
    I have a doubt.
    Do I need to Compute Statistics after creating indexes?answer is version dependeent.
    Or when I create they automatically are computed?answer depends upon which version of Oracle.
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ
    you should ALWAYS provide Oracle version to FOUR decimal places.
    below is even better
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionHandle:     Petri BR
    Status Level:     Newbie
    Registered:     Dec 10, 2007
    Total Posts:     119
    Total Questions:     29 (18 unresolved)
    I extend to you my condolences; since you rarely get your questions answered here.

  • Compute statistics

    Hi,
    I have several tables containing indexes on some columns.
    Do I need to execute the "compute statistics" or "estimate statistic" after the index creation?
    What's the difference between them?
    Thanks
    dyahav

    Hi,
    This thread could be useful [Index Rebuild and analyze|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6601312252730].
    Regards,

  • Same query, different results depending on compute statistics!!!

    This one is really weird, you would think I am making this up but I am not...
    We have one really long query that uses several large inline views and usually returns a few rows. All of a sudden the query stopped working -- i.e. it returned no rows. We tried rebuilding indexes; this didn't help. We tried computing full statistics and this fixed the problem. Has anyone heard of compute statistics affecting the output of a query????
    About a week later, the problem happened again. Computing estimate statistics didn't help. Only computing full statistics fixed the problem.
    The only thing I can note, is that this database was recently upgraded from 9.2.0.6 to 9.2.0.7, but I checked the install log files and there are no errors.
    Luckily this is just a development database but we are a little worried that it might re-occur in production. We have a few other development databases that have also been upgraded to 9.2.0.7 and none of these have the problem.
    We have compared the init.ora files, no real differences. Any other ideas? Maybe a full export import?

    Thanks, will do, but I am a little doubtful it is
    fixed by 9.2.0.8 because it works on one of our
    9.2.0.7 environments... Although if it is a statistics issue, it's likely a corner case, so you have to have a number of things in alignment. It's quite possible that, for example, two systems have identical structures and identical data but slightly different query plans because the data in one table is physically ordered differently on one system than in another which slightly changes the clustering_factor of an index which causes the CBO to use that index on one system and not on another. You may also end up with slightly different statistics because you have histograms on a column in one system and not in another.
    Looks like we are going to 9.2.0.8 anyway because of
    the end-of-life service support forcing us to go to
    9.2.0.8 anyway.If it reproduces on 9.2.0.8 (and I'd tend to suspect it will), it's certainly worth raising an issue. Unless you have an extended support contract, though, I wouldn't hold out a lot of hope for a patch if this isn't already fixed, since 9.2 leaves Premier Support at the end of the month...
    Justin

  • What is exactly STATISTICS in SQL Server

    hi all,
      What is exactly STATISTICS in SQL server query optimiser ?
    Thanks
    Selva

    Some good content with proper example can help you for sure.
    Link:
    http://blog.idera.com/sql-server/understanding-sql-server-statistics/
    Some part of text may give you idea
    If there’s an upcoming election and you are running for office and getting ready to go from town to town city to city with your flyers, you will want to know approximately how many flyers you’re going to bring.
    If you’re the coach of a sports team, you will want to know your players’ stats before you decide who to play when, and against who. You will often play a matchup game, even if you have 20 players, you might be allowed to play just 5 at a time, and you will
    want to know which of your players will best match up to the other team’s roster. And you don’t want to interview them one by one at game time (table scan), you want to know, based on their statistics, who your best bets are.
    Just like the election candidate or the sports coach, SQL Server tries to use statistics to “react intelligently” in its query optimization. Knowing number of records, density of pages, histogram, or available indexes help the SQL Server optimizer “guess”
    more accurately how it can best retrieve data. A common misnomer is that if you have indexes, SQL Server will use those indexes to retrieve records in your query.
    Not necessarily. If you create, let’s say, an index to a column City and <90% of the values are ‘Vancouver’, SQL Server will most likely opt for a table scan instead of using the index if it knows these stats......
    Santosh Singh

  • EAR4 - Gathering Statistics, unusable indexes and more

    Hi,
    Some feedback on statistics:
    1. When choosing a table -> Statistics -> gather Statistics, the minimum is to have a CASCADE option (so all the indexes will be analyzed too). I think it should be the deafult! This way there is a chance that the developers will have good statistics...
    As a bonus, an advanced tab with the rest of the options might be nice, when you have time.
    2. When choosing to gather statistics on an index, you should you dbms_stats and not ALTER INDEX... COMPUTE STATISTICS which is a deprecated syntax.
    And about indexes:
    1. When looking at the index tab of a table, unusable indexes should be visibly different - maybe just color the status column. Well, any color-coding can help to gain more infomation very fast (index types and index status). Well, I guess the same goes for disabled triggers, disabled constraints etc...
    2. When right-clicking an index in an index tab of a table, the only option is export, which makes no sense. Could you replace it with the six relevant index options, just like when we right click an index in the side bar (drop, rebuild, rename, make unusable...)
    Well, same goes for the triggers tab of a table - when right-clicking a trigger give us the trigger actions(enable/disable, drop...), not export.
    my two cents,
    Ofir

    When Choose a partitioned table from the tables list (tree view on the left), I have many tabs with details (Columns, data, indexes,etc).
    1. The last tab, SQL, doesn't generate any CREATE TABLE sql at all for the simple partition table I created (10g Release 2 on windows 2000, raptor 4.1, a table with a single partition).
    2. There is no way to see the partitions definitions - for example, the list of partitions and their ranges (or list values). I would like to have another tab for partitioned table with that information (from all_tab_partitions). Also, how can I easily see the type of partitioning and the partition key of the table?
    3. Also in the builtin reports, there is no way to get that data. The only report about partitioned tables that I see is Table -> Organization -> Partitioned -> Partitioned Tables, that only provide owner, table_name, maybe tablespace and logging (blank in my case).. I think:
    a. You should rewrite the report to use dba/all_part_tables - with columns like partitioning_type, subpartitioning_type, partition_count etc.
    b. add a report about the partition key columns per partitioned table from dba_part_key_columns.
    4. When adding an index to a partitioned table, I can't choose local/global index. The index is always created as a global index. For example, can't create bitmap index on partitioned tables because they must be local.
    Ofir

  • Compute statistics  in OEM tool (let me know the report going to where)

    Compute statistics in OEM tool
    OS: windows server
    Database oracle10g
    I am compute the statics about the 50 users thro OEM tool
    please let me know the report going to which folder
    Thanks in advance

    Hi,
    please let me know the report going to which folder The report is going to the Concepts Manual and/or Admin Handbook. Database table statistics are not what you believe they are.
    Regards,
    Yoann.

  • DB Statistics & BI Indexes

    Hi All,
    I have been going through a lot of threads related to DB Statistics & BI Indexes and I am confused.
    1) How do I come to know that the DB Statistics and BI Indexes for a cube are active or created?
        Is it through RSDDSTAT where the status is X means stats are active? Is there another way to find out?
        What about BI Indexes?
    2) How do I create DB Statistics?
    3) Does creatting DB statistics for query help the query performance or creating DB statistics on cube helps the Query performance or is it both?
    4) I understand primary indexes are created while creating the cube.However, when we try to create secondary indexes through performance tab in which table the details are stored? Can it be deleted later?
    5) Is there another way to create BI Indexes other than performance tab?

    P.S: the formatting went nuts... I added *** before each of my replies... COME ON SAP!! Cant you fix this???
    Hi.
    1) How do I come to know that the DB Statistics and BI Indexes for a cube are active or created?
    Is it through RSDDSTAT where the status is X means stats are active? Is there another way to find out?
    What about BI Indexes?
    In addition to the performance tab where you got the traffic lights, you can check the indexes through tcode SE11. Just input the table name and on the next sceen click the button reading "Indexes...". A popup will show you the indexes that exist for the table you are looking at. Doubleclicking any of the indexes will take you to the details.
    You can also define a new, secondary index here. You might have to go to DB02->missing indexes to have it created on the database, even though it says it exists and is active in se11... get your basis guy in on all of this.
    2) How do I create DB Statistics?
    Through Performance tab or step in process chain, but you should schedule db stats at least once a week in that DB-maintenance-calendar-thingy you can get to with a tcode I cannot remember... DBxx where xx is two numbers...ask your basis guy.
    3) Does creatting DB statistics for query help the query performance or creating DB statistics on cube helps the Query performance or is it both?
    You cannot create statistics for a query. You can collect statistics about the query use. This is the statistics stuff you can activate from bct; the "statistics-cubes" and all that. They store the info you collect and this is then called BI Statistics. It is of absolutely no use whatsoever with regards to performance. You can learn a lot about your system by analysing this, but starting to collect the BI Statistics wont help your slow running queries.
    You can create statistics for cubes. This is the DB Stats and the effect of creating it is that the system will know how the data is distributed in the cube and because of that, it will have a better chance of reading data according to your selections faster. Much faster in some cases! This goes for both queries and loads (a load is just a special kind of query, where results are not put on the screen but in another table). Try to keep your DB Stats as up to date as you can - I always update the stats after each load and compression... It is especially important on transactional cubes, because data is more volatile here than when you only load every second day or so.
    4) I understand primary indexes are created while creating the cube.However, when we try to create secondary indexes through performance tab in which table the details are stored? Can it be deleted later?
    I dont know the tables this is stored in, but you can delete any index using SE11as mentioned above. Secondary indexes will need to be re-defined in SE11 when your system has been taken down... or if you activate the cube. In that case, only the hardwired primary indexes are created.
    5) Is there another way to create BI Indexes other than performance tab?
    I think you can only create/define an index in SE11, but you can refresh it from the Performance tab or in a process chain.
    Regards,
    Jacob
    Edited by: Jacob Jansen on Aug 10, 2010 9:56 PM

  • Difference between dbms_stats and COMPUTE STATISTICS

    Hello everyone,
    Can anyone tell me what is the difference between:
    dbms_stats.gather_table_stats(
        ownname => 'me',
        tabname => 'ORGANISATIONS',
        estimate_percent => dbms_stats.auto_sample_size
      );and
    ANALYZE TABLE ORGANISATIONS COMPUTE STATISTICS;I guess both method are valid to compute statistics, but when I run the first method, the num_rows in USER_TABLES is wrong.
    But when I execute the second method, I get the correct num_rows.
    So, what is exactly the difference and which one is best?
    Thanks,

    Hello,
    It's not recommended to use ANALYZE statement to collect Optimizer statistics. So you should use DBMS_STATS.
    Else, about the number of rows, as you used an Estimate method, you may have a number of row which is not accurate.
    What is the result if you choose this:
    estimate_percent => NULL
    NB: Here, NULL means COMPUTE.
    You may have more detail on the following link:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#PFGRF003
    This Note from My Oracle Support may give you many useful advices:
    Recommendations for Gathering Optimizer Statistics on 10g [ID 605439.1]Hope this help.
    Best regards,
    Jean-Valentin

  • What is Estimate Statistics ?

    Hi everybody,
    I wanna know what is analyzing the table ... ???
    What is estimate statistics ... ???
    How they contribute to performance ... ???

    hi
    kindly check this out
    http://www.oracle-base.com/articles/8i/CostBasedOptimizerAndDatabaseStatistics.php
    and why they are used for .....its the information about the table ,indexes we get from it ...and how they are analyzed or not...frequently we can see it ........
    CHeers

  • AVG_ROW_LEN not update , even I analyze the table in compute statistics

    I execute DBMS_STATS.GATHER_SCHEMA_STATS on my old table , but the statistics doesn't update the row length.
    After that , I give up the gather_schema_stats stored proc and use sql statement -> ANALYZE TABLE COMPUTE STATISTICS.
    The statistics still is stale .
    Is there anything I have missed ?

    San KTN wrote:
    Hi Banka,
    I suggest you to perform followings :-
    1. Delete the table statistics first.
    2. Create another table as select from this target table , in same schema and same tablespace.
    3. exec dbms_stat.gather_table_stats with METHOD_OPT parameter value as
    FOR ALL INDEXED COLUMNS SIZE n ( n is any number )
    or FOR COLUMNS (Column list ... even if all columns in the list)
    or NULL
    on new and old table respectively.
    4. Compare the results.
    You better paste the results here for investigation.It's strange. The new table could be updated. AVG_ROW_LEN and AVG_COL_LEN both make change.
    The old table only partial be updated. AVG_COL_LEN is ok but not AVG_ROW_LEN.

  • Compute Statistics for Repository 9.02

    Finally I have a repository up and running. I also computed the statistics (as the repository owner).
    When other users want to use the repository, they get the message that they have to run the compute statistics first.
    I think this is a privilege problems (that the developer-users can't select on the statistic tables). But what privileges should the other users have?
    Bastiaan

    Bastiaan,
    This was an known issue that is now fixed in the latest versions. It is just a warning and
    can be ignored by the subordinate repository user.
    regards,
    David

  • What is difference between sy-index and sy-tabix and where both are using ?

    what is difference between sy-index and sy-tabix and where both are using ?

    hi nagaraju
    sy-tabix is in Internal table, current line index. So it can only be used while looping at the internal table.
    sy-index is in Loops, number of current pass. This you can use in other loop statements also (like do-enddo loop, while-endwhile)
    SY-INDEX is a counter for following loops: do...enddo, while..endwhile
    SY-TABIX is a counter for LOOP...ENDLOOP, READ TABLE...
    Here is an example from which you can understand the difference between sy-tabix and sy-index.
    Itab is an internal table with the following data in it.
    id Name
    198 XYZ
    475 ABC
    545 PQR.
    loop at itab where id > 300.
    write :/ itab-id, itab-name , sy-tabix, sy-index.
    endloop.
    My output will be :
    475 ABC 2 1
    545 PQR 3 2
    Sy-tabix is the index of the record in internal table.
    sy-index gives the no of times of loop passes.
    So, for the first record in the output (475 ABC), 2 is the index of the record in internal table and as it is first time loop pass occured, sy-index value is 1.
    Regards,
    navjot
    award points

Maybe you are looking for

  • Preview takes forever to open, much slower than on my old MacBook. It has been like this since I bought the computer last January. Why is Lion so much slower?

    Preview takes forever to open, much slower than on my old MacBook running Snow Leopard. It has been like this since I bought the computer last January. Any ideas?

  • Error message when syncing iPod

    I have a 2nd Generation iTouch and just recently when I go to plug my iTouch into sync, an error message comes up. It says "This iPod cannot be used because the required software is not installed. Run iTunes installer to remove iTunes, then install i

  • How to parse xml in sap abap

    Hello, Can anyone help me to know how to parse xml in sap abap. I have a xml file which i want to parse and store it in internal table. <?xml version="1.0" encoding="UTF-8"?>##<data><name>menaka<name></data> Regards, Menaka.H.B

  • How to deal with xcode indexing?

    I upgraded to XCode 4 for my cpp project, but I can no more use my macbook pro since the new XCode always uses all the CPU for indexing!! In my project I'm include Boost quite often, is there a way to avoid indexing libraries? Or to index Boost only

  • Running in 64-bit mode

    Will running my MBP in 64-bit mode (holding 6 & 4 during boot) give me less battery life on a charge? If so, approximately by how much? I'm considering running my Mac Pro in 64-nit mode permanently but can't decide on my MBP based on this question. T