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.

Similar Messages

  • 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!

  • After Creating Index ???

    We creating a New Custom Index on MSEG and transported to production?
    What are the followup activites to make the usage of created index immediately ??
    Rdgs
    PR

    Hi,
    Oracle use index after it have been created based on table statistics (CBO)
    I suggest you create statistics for this index and update the statistics for the table MSEG.
    Use the report RSANAORA, or the transaction DB20.
    Best Regards,
    Itamar Marioto

  • After creating index query is taking more

    Hello all,
    I am trying the following..and not getting why the query is taking more time after creating the index
    SQL> SELECT distinct version_no
    2 FROM iefloa_data_anal
    3 WHERE datetime_inserted > to_date('17-02-2004','dd-mm-yyyy');
    VERSION_NO
    999
    Elapsed: 00:00:22.16
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=15 Card=1 Bytes=22)
    1 0 SORT (UNIQUE) (Cost=15 Card=1 Bytes=22)
    2 1 TABLE ACCESS (FULL) OF 'IEFLOA_DATA_ANAL' (Cost=2 Card=1
    Bytes=22)
    /*******************Here I am creating the Index************/
    SQL> create index t_ind_date on iefloa_data_anal(datetime_inserted);
    Index created.
    Elapsed: 00:07:427.38
    SQL> SELECT distinct version_no
    2 FROM iefloa_data_anal
    3 WHERE datetime_inserted > to_date('17-02-2004','dd-mm-yyyy');
    VERSION_NO
    999
    Elapsed: 00:00:40.10
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=14 Card=1 Bytes=22)
    1 0 SORT (UNIQUE) (Cost=14 Card=1 Bytes=22)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'IEFLOA_DATA_ANAL' (Cos
    t=1 Card=1 Bytes=22)
    3 2 INDEX (RANGE SCAN) OF 'T_IND_DATE' (NON-UNIQUE) (Cost=
    1 Card=1)
    can anybody explains whats the reason...
    the table is having around 1.5 crore records
    regards

    The execution plan clearly shows that Oracle thinks only one row is going to match that condition on the index ("Card=1"). Is that a true statement? If not, you should make sure your stats are accurate. If the data is highly skewed, you may need to put a histogram on that column.
    Another possibility is that the index is on much slower disks than the table. Although, I can't imagine any range scan on an index that has only one matching value taking that long. How about doing a full trace (SET AUTOTRACE ON) and posting the logical and physical i/o information?

  • Unable to search documents after creating Index

    hi all,
             i've created index and assigned datasources to that index.but when i try to search that documents it is showing tht "No matches have been found "
    where as in applicaiton log it is displauing follwing message
    Error  11/29/05 6:30:03 PM  XCrawlerService  Failed to create crawler task SubscriptionCrawler - com.sapportals.wcm.service.xcrawler.XCrawlerException: The SQL statement "SELECT "XCRW_TASK_INDEX" FROM "KMC_XCRW_TASKS" WHERE "XCRW_TASK_ID" = ?" contains the semantics error[s]: type check error: the e 
    so, can any body help me to solve above problem
    regards
    gnana

    Hi Gnana,
    You  may try searching on http://service.sap.com/patches
    You will have to search for ur requrired patches. You would also find pdfs, giving details on the same.
    All the best.
    Awaiting Reply.
    Warm Regards,
    Ritu R Hunjan
    Message was edited by: Ritu  Hunjan

  • Part of imported image remain on computer screen after creating Page doc

    This is strange. I imported a cartoon picture to a Page document. I deleted the document but part of the image (six little dots) remains on my screen. At first I thought it was actually dirt on my screen but it is from the cartoon and it does not go away even after I restart my computer. It shows up whether I am on Page application or on the Internet. I have deleted the picture from my computer, deleted the document and emptied the Trash and restarted computer and the six little dots remain. Any thoughts? It as if I imported a portion of the image as a permanent mark. The dots do not print out and do not show up in a Screen shot picture. So not horrible but irritating. It was part of a Yogi Bear cartoon photo - so make fun of me all you want but I would love to get these dots gone.
    IMac Mac OS X (10.4.6)

    The picture has nothing to do with the little spots on your screen.
    Run a google search on stuck screen pixels.
    S.

  • 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;

  • I can not create index

    Hello,
    I am using 8.1.7
    I'd like to create index on clob column, but after:
    create index news_ctx_ind on news(news_description) indextype is CTXSYS.CONTEXT parameters ('DATASTORE CTXSYS.DEFAULT_DATASTORE')
    i get:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-11422: linguistic initialization failed
    DRG-00100: internal error, arguments : [52100],[drxs.c],[553],[gxtopen],[1]
    DRG-11432: file error while accessing interMedia Text knowledge base
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 78
    ORA-06512: at line 1
    please help me.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Omar Alonso ([email protected]):
    Do you have russian content in the documents?
    What's the db version and character set?
    You may try to disable the theme indexing:
    begin
    ctx_ddl.create_preference('mylex','BASIC_LEXER');
    ctx_ddl.set_attribute('mylex','index_themes','NO');
    ctx_ddl.set_attribute('mylex','index_text','YES');
    end;
    create index myindex on mytable(docs) indextype is ctxsys.context parameters('LEXER lmylex');<HR></BLOCKQUOTE>
    Hi,
    I am also facing the same problem. my character set is default and i am using oracle 8.1.6. I can create index if my database is dedicated but it will not work for mts for same table and data using intermedia.
    Suppose i dont want to disable theme indexing and though i want to create index then what i have to do.
    null

  • Is it required to update statistics once new index is created

    Hi,
    oracle version: 8i
    i had created new index(size 0f 10g) on one table is it Required to update statistics immediately for the better execution plan.
    bash-2.05$ sqlplus "/as sysdba"
    SQL*Plus: Release 8.1.7.0.0 - Production on Sun Jan 4 19:00:26 2009
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - 64bit Production
    SQL> select last_analyzed from dba_indexes where owner='PIN' and index_name='I_EVENT_SESSION_OBJ_ID0';
    LAST_ANAL
    SQL> show parameter optimizer_mode
    NAME TYPE VALUE
    optimizer_mode string CHOOSE
    Thanks
    Prakash
    Edited by: user612485 on Jan 4, 2009 5:34 AM

    It should be possible to add the "compute statistics" clause to the create index statement so that statistics do not need to be collected on the entire object (table and indexes) immediately after adding a new index. However, if you fail to generate statistics for the new index you may find that the index is not used where you expect it to be.
    HTH -- Mark D Powell --

  • DSO activation problem after creating the secondary indexes

    Hi,
        I am facing the problem with DSO activation after creating the secondary indexes.
    •  Compared with Info Cubes there is no functionality available which allows dropping and recreating a secondary index before/after the data activation.
    As a workaround I can write a simple report which drops and creates the indexes on database level.
    By using a process chain, we can simply insert the drop index report before data activation and the create index report after the data activation process.
    Can any body help me step by step procedure or Material to write the programs for delete index and create index reports on DSO object?..
    Thanks in advance for your help.
    Thanks & Regards,
    Bala

    hi,
    in BI if you are using the dso for reporting then you can simply chk the settings of dso for SID generation.
    no need to create the indexes or delete it.
    if the dso is not used for report then no need to use indexes.
    Ramesh

  • Problem:  While creating a project in iDVD, it plays perfectly on the computer, but after burning the sound is off.  Video soundtrack is not in the right place.  HELP!

    Problem:  While creating a project in iDVD, it plays perfectly on the computer, but after burning the sound is off.  Video soundtrack is not in the right place.  HELP!

    Have you checked out the topics at the right in the More Like This section?
    OT

  • Why should we create index on  the table after inserting data ?

    Please tell me the Reason, why should we create index on the table after inserting data .
    while we can also create index on the table before insertion of the data.

    The choice depends on a number of factors, the main being how many rows are going to be inserted in the table as a percentage of the existing rows, or the percentage growth.
    Creating index after a table has been populated works better when the tables are large or the inserts are large for the following reasons
    1. The sort and creation of index is more efficient when done in batch and written in bulk. So works faster.
    2. When the index is being written blocks get acquired as more data gets written. So, when a large number of rows get inserted in a table that already has an index , the index data blocks start splitting / chaining. This increases the "depth" of the inverted b-tree makes and that makes the index less efficient on I/O. Creating index after data has been inserted allows Orale to create optical block distribution/ reduce splitting / chaining
    3. If an index exists then it too is routed through the undo / redo processes. Thats an overhead which is avoided when you create index after populating the table.
    Regards

  • 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

  • IDES system copy ..error during IMPORT_ABAP..unable to create indexes

    Hi all,
    I am doing a IDES system copy. I ran the report SMIGR_CREATE_DLL , the export activities have been completed successfully as well on the source system. Now on the target system, during the import, I am getting the following error in the log file SAPDFACT.log.
    (DB) ERROR: DDL statement failed
    (CREATE  INDEX "/BI0/E0RSTT_C06~P" ON "/BI0/E0RSTT_C06" ( "KEY_0RSTT_C06P" , "KEY_0RSTT_C06T" , "KEY_0RSTT_C06U" , "KEY_0RSTT_C061" , "KEY_0RSTT_C062" , "KEY_0RSTT_C063" , "KEY_0RSTT_C064" , "KEY_0RSTT_C065" , "KEY_0RSTT_C066" , "KEY_0RSTT_C067" , "KEY_0RSTT_C068"  ) TABLESPACE PSAPSR3 STORAGE (INITIAL 65536 NEXT 0000002560K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) NOLOGGING COMPUTE STATISTICS )
    DbSlExecute: rc = 99
      (SQL error 1408)
      error message returned by DbSl:
    ORA-01408: such column list already indexed
    (DB) INFO: disconnected from DB
    The owner for this table is SAPSR3. Some oracle forums suggested to drop the index before recreating it. But when i do "drop index SAPSR3."/BI0/E0RSTT_C06~P..it says.."the specified index does not exist". But when I go to recreate this index, it doesn get created successfully. After that when I re-run the import, it again fails. Suprisingly..now if i go to check if this index is present thru a sql querry:
    select owner, object_name, object_type from dba_objects where object_name='SAPSR3."/BI0/E0RSTT_C06~P"', it tells "no rows selected". This is happening everytime, I create an index, where it gets created successfully, and the import again fails with the same error in SAPDFACT.log.
    I found an SAP note 885441 named..common errors during migration..although mine isnt a migration..my both source and destination are Red hat 64 bit platform.
    The note 1st asks to download the latest R3load..which I did and extracted in the kernel directory of the source..then it also asked to edit the .TSK file..in my case..SAPDFACT.TSK..where the lines:
    I /BIC/E<Cubename>~<index> C err
    to  I /BIC/E<Cubename>~<index> C ign..
    I did that..this time..the import again fails..but in the SAPDFACT.log..it complains about some other index..n the same gets generated in the .TSK file as well..the earlier index error is not again generated.
    I am not sure..what is going wrong..my export went through successfully.i have done the prep steps for export as well..before that i ran the SMIGR_CREATE_DLL report as well..
    Any inputs are highly appreciated..
    Thanks,
    Akshay

    Hi,
    Check SAP  Note 1166589 - Table converter: DB error when creating secondary indexes
    Thanks
    Sunny

  • Dbms_metadata.get_ddl returns unusable create index statement

    Hello everybody,
    I'm trying to write a procdeure that automatically deletes all duplicate record and rebuild all table indexes after an sqlldr load with direct path.
    In short the procdeure indentifies the indexes, read them using dbms_metadata.get_ddl('INDEX', 'IDX_UNIQUE_TEST') drops them, deletes the duplicated records and then recreates the indexes.
    However after the sqlldr, get_ddl function returns the following result:
    CREATE UNIQUE INDEX "MYUSER"."IDX_UNIQUE_TEST" ON "EDWH"."FOREX_ORD_PRC_INTRADAY" "C_ORD_TYP", "C_ORD", "D_INI_VAL", "C_PRC_TYP")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "MYTABLESPACE"
    ALTER INDEX "MYUSER"."IDX_UNIQUE_TEST"  UNUSABLE
    As you can see there is an ALTER INDEX at the end that makes the whole statement invalid.
    Has anyone already seen that? I've tried to google it but with no chance. Help with this would really be appreciated.
    Thanks in advance
    Ross

    Mmh, yes it is unusable before the get_ddl, but how comes it returns both the create index and the alter index unusable statements?
    I've tried to make the index unusable with the alter index ... unusable statement but get_ddl still returned the create index only.
    I'm guessing that production server (10.2.0.4.0) is behaving differently from test machine (9.2.0.4.0). Any idea on that?
    Ross

Maybe you are looking for