When do I really need to create indexes for a table?

Once I was talking to a dba in a conference.
He told me that not always I have to create indexes for a single table, it depends of its size.
He said that Oracle read registers in blocks, and for a small table Oracle can read it fully, in a single operation, so in those cases I don't need indexes and statistcs.
So I would like to know how to calculate it.
When do I really need to create indexes for a table?
If someone know any documment that explain that, or have some tips, I'd aprecciate.
Thanks.
P.S.: The version that I'm using is Oracle 9.2.0.4.0.

Hi Vin
You mentioned so many mistakes here, I don't know where to begin ...
vprabhu_2000 wrote:
There are different kinds of Index. B-tree Index is by default. Bit map index, function based index,index organized table.
B-tree index if the table is large This is incorrect. Small tables, even those consisting of rows within just one block, can benefit from an index. There is no table size too small in which an index might not be benefical. William Robertson in his post references links to my blog where I discuss this.
and if you want to retrieve 10 % or less of data then B-tree index is good. This is all wrong as well. A FTS on a (say) million row table could very well be more efficient when retrieving (say) just 1% of data. An index could very well be more efficient when retrieving 100% of data. There's nothing special about 10% and there is no such magic number ...
>
Bit Map Index - On low cardinality columns like Sex for eg which could have values Male,Female create a bit map index. Completely and utterly wrong. A bitmap index might be the perfect type of index, better than a B-Tree, even if there are (say) 100,000 distinct values in the table. That a bitmap index is only suitable for low cardinality columns is just not true. And what if it's an OLTP application, with lot's of concurrent DML on the underlining table, do you really think a bitmap index would be a good idea ?
>
You can also create an Index organized table if there are less rows to be stored so data is stored only once in index and not in table. Not sure what you mean here but an IOT can potentially be useful if you have very large numbers of rows in the table. The number of rows has nothing to do with whether an IOT is suitable or not.
>
Hope this info helps. Considering most of it is wrong, I'm not sure it really helps at all :(
Cheers
Richard Foote
http://richardfoote.wordpress.com/

Similar Messages

  • How to create index for particular table in R3

    Hi
    My load is taking too much time and it leads to process over due error. Does creating indexes on table in r3 side will solve this issue? If so how can we find out on which table does this particular data source depend. I went to maintain extract structure and findout only one table is supplying data for this data source.
    Is there any other factors depend to solve this.
    Thanks
    kk

    Hi,
    it will depend on the table.... Having an index created will speed up the loading but slow down the insert therefore slowing some process perhaps...
    May I ask which table it is? And which fields would you need to index?
    Are you sure that bottleneck is located in R/3? Analyze your loading time in the monitor and see if this is really the case.
    Otherwise you can create index for a table in Tx SE11; first check if an index is not already created...
    hope this helps,
    Olivier.

  • Problem while creating index for temporary table...

    Hi,
    i have created index for a temporary table and this script should used by multiusers.So when second user connecting to it is giving index i mean object already exists.
    So what i need is when the second user connected the script should create one more index on temporary table.Will sql server provide any random way of creating indexes if the index exists already with that name??
    Thank You,

    Nope..
    SQL Server is cleaver enough to handel this situation.
    When you create a index or constraint on the Temp Table, eventhough the index name is duplicate it will allow.
    But it only possible on temp tables (prefixed with single #).
    To Test this,
    Open Two window,
    Execute the below window on the opened 2 window..
    create table #test
                id int
    Insert Into #test values(1);
    Insert Into #test values(2);
    Create clustered index testindex on #test(id)
    Now you wont get any error on any of the window. Rite?
    To fetch the created index details, execute the below code on any one of the window..
    select * from sysindexes where name like '%test%'
    Now you can see the 2 rows with same indexname but refereing with different table. Yes. all the temp tables (#) will be suffixed with unique number to avoid the object already found error while multiple users connects.
     

  • A query related to creating Indexes for a table

    Hi ,
    I am in a J2EE Banking Project using Oracle 10g as our Database .
    We have created Indexes on some tables .
    But this this is not called by any of our Java class .
    Could anybody please let me know how these Indexes will actually improve the Performance .
    Waiting for your replies .
    Thanks in advance .

    But in our safety database (huge & ofcourse Oracle), we use indexes just because to avoid duplicates, improve data retrieval and so on.As you pointed out indexes can do 2 things for you: enforce uniqueness and (hopefully) improve data retrieval. Enforcing uniqueness is pretty basic, but indexes don't always improve performance. Under the wrong condtions indexes can hurt performance. The ideas below refer to B-TREE indexes; other kinds of indexes have other considerations
    Indexes add overhead to insert, delete, and (hopefully not - updating index columns is a Bad Idea), enough so that if you're inserting a lot of rows into a large table it is sometimes helpful to drop the indexes, load the data, and recreate the indexes when done to help performance. The more indexes a table has the more overhead DML statements need to maintain them.
    Indexes help query performance under a couple of conditions. When using them as join keys to retrieve a small percentage of rows in a table (< 20% maybe; there is no firm number) indexes can help. When a query can read its columns from an index only (such as counts against a primary key index) index access can be faster than table access.
    Indexes can hurt performance by adding overhead for maintenance if the index is never actually used or if used to read most of the rows in a table when a full table scan would be more efficient (why go through the extra effort to read the index and then table when you'll have to read most of the rows in the table anyway?).

  • Do I need to create indexes on column name?

    Following queries have been shown as bad sql :          
    select * from t1 where name = 'FUNCTION'
    Count=     7     Avg Time=13     Min Time=0     Max Time=47
    select * from t2 where name = 'USER_TYPE'      
    Count=2     Avg Time=85     Min Time=0     Max Time=156
    select * from t3 where name = 'TEMPLATE'
    Count=7     Avg Time=19     Min Time=0     Max Time=32
    All these tables have less than 20 records and static tables.                    
    Do I need to create indexes on column name?

    A FTS even on very small tables can require more latches than accessing via an index. Also, a table access requires the segment header and data block to be accessed (2) whereas an index on a small index only requires access to the index root block and table block (2).
    True, it's unlikely to make much of a difference in most environments but if the table is really heavily accessed, indexing even very small tables can help to reduce the related latch overheads.
    Most of these small tables have PKs and are accessed via the PK so associated indexes usually exist anyways.
    Cheers
    Richard Foote
    http://richardfoote.wordpress.com/

  • Need a dump on indexes for a table

    RDBMS novice here asking what is probably an easy one.
    How, in SQLPlus, can I get a spill on all the indexes of a specific table. In Oracle Rdb, the statement "show table (indexes) foo;" did the job. Looking for something similar in RDBMS. I need to see the components of the index (in their right order). It would also be great to see some of the other stuff you specify when you create the index.
    Thanks in Advance

    You can get the indexes for a table by querying
    SELECT INDEX_NAME FROM USER_INDEXES WHERE TABLE_NAME='XXX'
    You can get the columns within the index (in order) by
    SELECT COLUMN_NAME FROM USER_IND_COLUMNS WHERE INDEX_NAME='XXX' ORDER BY COLUMN_POSITION

  • Not able to create index for organization

    in transaction ses_admin, i created an index for business object BAS_BUPA of type 1,ie individual account.
    However, i am not able to create index for BAS_BUPA of type 2
    It says "No entry in table SIC_INDEX_MAIN for index object BAS_BUPA and index 2"

    hi,
    The index is for Business Partner, so it includes both Persons and Organizations. So, only one index needs to be created for both.
    The functioning is correct, just that i missed it.

  • Do I need to create billing for FD (free delivery) sales order

    Hi
    I have a question. I created first a sales order (FD) in our sap system. but I don't know whether I need to create billing for the FD order. when I try to create billing for this FD order, SAP cannot to process it.
    I also research configuration. in VOV8, SAP not set billing function.
    thanks
    Henry

    Hi henry
    If you have created Free of charge delivery (FD) sales order then the item category will be KLN only.After PGI then stock level will reduce  and the effect of the stock is that you are issuing stock to  customer at free of charge.And as you have assigned cost center then the data will flow to the controlling area and the Financial document  after  PGI.
    Secondly if you assign TANN as a item category and do delivery and then PGI then if the reference document is different then it will have affect as the KMN and TANN item categories doesn't have same features
    Regards
    Srinath

  • Why do we create indexes for DSOs and Cubes.What is the use of it?

    Hi All,
    Can you please tell me why are indexes created for DSOs and Cubes.
    What is the use with the creation of indexes.
    Thanks,
    Sravani

    HI ,
    An index is a copy of a database table that is reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example, when using a binary search. A table has a primary index and a secondary index. The primary index consists of the key fields of the table and is automatically created in the database along with the table. You can also create further indexes on a table in the Java Dictionary. These are called secondary indexes. This is necessary if the table is frequently accessed in a way that does not take advantage of the primary index. Different indexes for the same table are distinguished from one another by a separate index name. The index name must be unique. Whether or not an index is used to access a particular table, is decided by the database system optimizer. This means that an index might improve performance only with certain database systems. You specify if the index should be used on certain database systems in the index definition. Indexes for a table are created when the table is created (provided that the table is not excluded for the database system in the index definition). If the index fields represent the primary keys of the table, that is, if they already uniquely identify each record of the table, the index is referred to as an unique index.
    they are created on DSO and cube for the performance purpose ..and reports created on them wil be also more efficent ..
    Regards,
    shikha

  • 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

  • Creating index for standard SAP tables

    Hi!
    What are the advantages and disadvantages of creating addtional indexes for tables with massive amount of data (BSEG, BKPF, COEP, etc...).
    If I create a new index it supposed to make the table access faster, for the cost of hard disk space.
    Am I right?
    Thank you
    Tamá

    Hi,
    Primary and secondary indexes
    Index: Technical key of a database table.
    Primary index: The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.
    Secondary index: Additional indexes could be created considering the most frequently accessed dimensions of the table.
    Structure of an Index
    An index can be used to speed up the selection of data records from a table.
    An index can be considered to be a copy of a database table reduced to certain fields. The data is stored in sorted form in this copy. This sorting permits fast access to the records of the table (for example using a binary search). Not all of the fields of the table are contained in the index. The index also contains a pointer from the index entry to the corresponding table entry to permit all the field contents to be read.
    When creating indexes, please note that:
    An index can only be used up to the last specified field in the selection! The fields which are specified in the WHERE clause for a large number of selections should be in the first position.
    Only those fields whose values significantly restrict the amount of data are meaningful in an index.
    When you change a data record of a table, you must adjust the index sorting. Tables whose contents are frequently changed therefore should not have too many indexes.
    Make sure that the indexes on a table are as disjunctive as possible.
    (That is they should contain as few fields in common as possible. If two indexes on a table have a large number of common fields, this could make it more difficult for the optimizer to choose the most selective index.)
    Accessing tables using Indexes
    The database optimizer decides which index on the table should be used by the database to access data records.
    You must distinguish between the primary index and secondary indexes of a table. The primary index contains the key fields of the table. The primary index is automatically created in the database when the table is activated. If a large table is frequently accessed such that it is not possible to apply primary index sorting, you should create secondary indexes for the table.
    The indexes on a table have a three-character index ID. '0' is reserved for the primary index. Customers can create their own indexes on SAP tables; their IDs must begin with Y or Z.
    If the index fields have key function, i.e. they already uniquely identify each record of the table, an index can be called a unique index. This ensures that there are no duplicate index fields in the database.
    When you define a secondary index in the ABAP Dictionary, you can specify whether it should be created on the database when it is activated. Some indexes only result in a gain in performance for certain database systems. You can therefore specify a list of database systems when you define an index. The index is then only created on the specified database systems when activated
    Thanks and Regards
    Arun Joseph

  • How to create  index for a column of a view

    Hi,
    I have created view for a table and then i am trying to create index for a column of that view. i am using the query "CREATE INDEX index_name ON view_name (col)". but Mysql is showing error like "view_name is not a base table".
    How can i do that......

    As mentioned this is a java forum not a mysql forum, but as I know the answer - you can't create an index directly on a view in mysql.

  • ABAP Routine for Deleting and creating index for ODS in Process chains

    Any pointers for the ABAP Routine code for deleting and creating index for ODS in Process chains.

    Hi Sachin,
    find the following ABAP code to delete ODS ondex.
    data : v_ods type RSDODSOBJECT.
    move 'ODSname' to v_ods .
    CALL FUNCTION 'RSSM_PROCESS_ODS_DROP_INDEXES'
      EXPORTING
        I_ODS = v_ods.
    To create index:
    data : v_ods type RSDODSOBJECT.
    move 'ODSname' to v_ods .
    CALL FUNCTION 'RSSM_PROCESS_ODS_CREA_INDEXES'
      EXPORTING
        I_ODS = v_ods.
    hope it helps....
    regards,
    Raju

  • Creating Indexes in Cluster Tables

    Hi,
       I want to  enable the index for the a cluster table..how is it possible..As we see for transparent tables like MSEG ,index tab is enabled but tables like BSEG the option is disabled..Please help me find a solution..
    Regards
    Maria

    You cannot create index on cluster table in SAP.
    BSEG is a cluster table, so no index, but hopefully there are "database indexes" on BSEG, which are actual database table : BSIS, BSAS, BSID, BSAS, and so on.
    BSEG Access
    BSAD Accounting: Secondary index for customers (cleared items)
    BSAK Accounting: Secondary index for vendors (cleared items)
    BSAS Accounting: Secondary index for G/L accounts (cleared items)
    BSID Accounting: Secondary index for customers
    BSIK Accounting: Secondary index for vendors
    BSIM Secondary Index, Documents for Material
    BSIS Accounting: Secondary index for G/L accounts
    Create index on these tables.
    Look also at
    Re: Selecting data from BSEG.
    Regards

  • Index for a table

    I would like to ask when it makes sense to create an index for a table, e.g. ONRVB at the moment it takes 3.006.358 ms to select one enntry.

    Hi Witold
    It is always better to optimize your where clause rather creating index. Before creating any index you should first check what is the frequency of its usage. Moreover many a times creating index ends up in having side effects as some times database engine may choose ur new index instead which could be not be valuable. Hence before creating any index we need to think twice and try to optimize what we have.
    Cheers
    Vaibhav

Maybe you are looking for

  • Help needed on Function module  COM_PROD_MATERIAL_MAINTAIN_API

    Hi Gurus, I am using <b>COM_PROD_MATERIAL_MAINTAIN_API  </b> to update the set type attributes for a product master. I tried but still i am not getting any solution. Can someone please help me out. Thanks in advance. Regards, Manoj Tiwari

  • Load xml data into table

    Hi all, I have an XML file (emp.xml) with below data: - <root> - <row> <lastname>steve</lastname> <Age>30</Age> </row> - <row> <lastname>Paul</lastname> <Age>26</Age> </row> </root> I'd like to create a stored procedure to store the xml data into EMP

  • Lion: Can't re-download from App store "newer version???"

    So I am trying to create a USB backup for booting/repair.  Apple has what I thought a great solution here... http://support.apple.com/kb/HT4718 towards bottom of page. It states you can re-download from the App store from the Purchased tab by using "

  • How to remove blueish theme in firefox (win7 basic)

    how do I get back the neutral theme of firefox 3 this looks so blue http://img835.imageshack.us/img835/6199/blaui.png

  • Pci express status test

    I ran PC-Doctor on my older HP Destop.  I got the message PCI Express Status Test #7 Failure.  I also was encouraged to update my graphics driver - which I did.  I still get the Test # 7 Failure message.  What could this mean?