WHAT IS INDEXING IN DATABASE ?

WHAT IS INDEXING IN DATABASE ? HOW CAN WE USE IT ?
BEST REGARDS,
RYAN

Hi
Indexes can be defined in the ABAP Dictionary to speed up access to data in a table. These indexes are also created in the database.
<b>Performance during table access</b>
<u>Indexes</u>
Primary and secondary indexes
Structure of an index
Accessing tables using indexes
<b>Primary and secondary indexes</b>
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.
<b>Structure of an Index</b>
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.
<u>When creating indexes, please note that:</u>
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.)
<b>Accessing tables using Indexes</b>
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
<b>Database access using Buffer concept</b>
Buffering allows you to access data quicker by letting you
access it from the application server instead of the database.
<b>Advantages of buffering</b>
Table buffering increases the performance when the records of the table are read.
As records of a buffered table are read directly from the local buffer of the application server on which the accessing transaction is running, time required to access data is greatly reduced. The access improves by a factor of 10 to 100 depending on the structure of the table and on the exact system configuration.
If the storage requirements in the buffer increase due to further data, the data that has not been accessed for the longest time is displaced. This displacement takes place asynchronously at certain times which are defined dynamically based on the buffer accesses. Data is only displaced if the free space in  the buffer is less than a predefined value or the quality of the access is not satisfactory at this time.
Entering $TAB in the command field resets the table buffers on the corresponding application server. Only use this command if there are inconsistencies in the buffer. In large systems, it can take several hours to fill the buffers. The performance is considerably reduced during this time.
<b>Concept of buffering?</b>
The R/3 System manages and synchronizes the buffers on the individual application servers. If an application program accesses data of a table, the database interfaces determines whether this data lies in the buffer of the application server. If this is the case, the data is read directly from the buffer. If the data is not in the buffer of the application server, it is read from the database and loaded into the buffer. The buffer can therefore satisfy the next access to this data.
The buffering type determines which records of the table are loaded into the buffer of the application server when a record of the table is accessed. There are three different buffering types.
With full buffering, all the table records are loaded into the buffer when one record of the table is accessed.
With generic buffering, all the records whose left-justified part of the key is the same are loaded into the buffer when a table record is accessed.
With single-record buffering, only the record that was accessed is loaded into the buffer.
<b>Buffering types</b>
<u>With full buffering,</u> the table is either completely or not at all in the buffer. When a record of the table is accessed, all the records of the table are loaded into the buffer.
When you decide whether a table should be fully buffered, you must take the table size, the number of read accesses and the number of write accesses into consideration. The smaller the table is, the more frequently it is read and the less frequently it is written, the better it is to fully buffer the table.
Full buffering is also advisable for tables having frequent accesses to records that do not exist. Since all the records of the table reside in the buffer, it is already clear in the buffer whether or not a record exists.
The data records are stored in the buffer sorted by table key. When you access the data with SELECT, only fields up to the last specified key field can be used for the access. The left-justified part of the key should therefore be as large as possible for such accesses. For example, if the first key field is not defined, the entire table is scanned in the buffer. Under these circumstances, a direct access to the database could be more efficient if there is a suitable secondary index there.
<u>With generic buffering</u>, all the records whose generic key fields agree with this record are loaded into the buffer when one record of the table is accessed. The generic key is a left-justified part of the primary key of the table that must be defined when the buffering type is selected. The generic key should be selected so that the generic areas are not too small, which would result in too many generic areas. If there are only a few records for each generic area, full buffering is usually preferable for the table. If you choose too large a generic key, too much data will be invalidated if there are changes to table entries, which would have a negative effect on the performance.
A table should be generically buffered if only certain generic areas of the table are usually needed for processing.
Client-dependent, fully buffered tables are automatically generically buffered. The client field is the generic key. It is assumed that not all of the clients are being processed at the same time on one application server. Language-dependent tables are a further example of generic buffering. The generic key includes all the key fields up to and including the language field.
The generic areas are managed in the buffer as independent objects. The generic areas are managed analogously to fully buffered tables. You should therefore also read the information about full buffering.
<u>Single-record buffering</u> is recommended particularly for large tables in which only a few records are accessed repeatedly with SELECT SINGLE. All the accesses to the table that do not use SELECT SINGLE bypass the buffer and directly access the database.
If you access a record that was not yet buffered using SELECT SINGLE, there is a database access to load the record. If the table does not contain a record with the specified key, this record is recorded in the buffer as non-existent. This prevents a further database access if you make another access with the same key
You only need one database access to load a table with full buffering, but you need several database accesses with single-record buffering. Full buffering is therefore generally preferable for small tables that are frequently accessed.
<b>Synchronizing local buffers</b>
The table buffers reside locally on each application server in the system. However, this makes it necessary for the buffer administration to transfer all changes made to buffered objects to all the application servers of the system.
If a buffered table is modified, it is updated synchronously in the buffer of the application server from which the change was made. The buffers of the whole network, that is, the buffers of all the other application servers, are synchronized with an asynchronous procedure.
Entries are written in a central database table (DDLOG) after each table modification that could be buffered. Each application server reads these entries at fixed time intervals.
If entries are found that show a change to the data buffered by this server, this data is invalidated. If this data is accessed again, it is read directly from the database. In such an access, the table can then be loaded to the buffer again.
<b>REWARD IF USEFULL</b>

Similar Messages

  • What are indexs?

    Hi Experts,
    Could any body tell me what are indexes .
    What EXACTLY happens when we create the a indexs on a cube.?
    Regards,
    RG

    Hi Friend,
    Indices are used to locate needed records in a data-base table quickly.BW uses two types of indices, B-tree indices for regular database tables and bitmap indices for fact tables and aggregates tables.
    These Bitmap indices cannot able to handle any inserts, updates, deletion. Bcoz of that we have to delete the indices before loading and have to rebuild it after loading.
    But if u use the B-Tree indices there is no need for deletion of indices as B-tree can able to handle it very well.
    B-tree indices: B-tree indices are used when dealing with huge volume of data. Line Item dimensions use B-tree indices.
    Bitmap indices: for fact tables and aggregate tables: This is for regular database tables. Bitmap Indices can dramatically improve query performance when table columns contain few distinct values.  Except LID other dimensions use bitmap indices
    Thanks

  • What is index oragnized table

    hi can you tell me
    1.what is index oragnized table
    2. fragmentation of table
    3. what is cascading trigger mean

    Hi,
    For this points a good starting point are Oracle Manuals. For index organizated tables check this link [Overview of Index-Organized Tables|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#sthref1044].
    Cascading triggers should be avoided, see this link [Some Cautionary Notes about Triggers|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/triggers.htm#sthref3187]
    Regards,
    Edited by: Walter Fernández on Jan 28, 2009 4:21 PM - Adding information about cascading triggers

  • Missing Indexes in Database

    Hi,
    In tcode DB02, when seeing database statistics, i found that there were some missing indexes in database. ie., for some tables there are no indexes created.
    Please tell me whether we need to create indexes or not. Is there any serious effect of a table not having any index?
    Please suggest me a good solution for this.
    Thanks,
    Sailesh K

    Not necessarily.  You must decide if an index will assist in making a table scan faster. FULL table scans indicate that an index is not available.  Creating an index in this case, will improve preformance and prevent full table scans from occuring.
    Also, check oracle to see if the index exists.  Somestimes the Data Dictionary is unaware of the index due to how it ws created.
    In summary missing indexes are not a problem.  FULL table scans are problems and require new indexes to be created for performance reasons.
    Hope this helps.

  • What is indexing and why does it take 122 hours?

    What is indexing and why has it slowed my computer and why does it take 122 hours?

    Indexing allows Spotlght to know where everything is on your computer.  It won't take as long as it says, the times it gives are always vastly inflated.

  • How to know what vertex index is picked on a Geometry?

    I am trying to get the Texture coordinates which is picked on a geometry but I have got stuck to know what vertex index is picked.
    My code:
    pickCanvas.setShapeLocation((MouseEvent) event);
    PickResult pickResult = pickCanvas.pickClosest();
    Node node = pickResult.getObject();
    GeometryArray geoArr = (GeometryArray)((Shape3D)node).getGeometry();
    TexCoord2f texCoord = new TexCoord2f();
    geoArr.getTextureCoordinate(0, ?, texCoord);Java doc said:
    Class GeometryArray
    public void getTextureCoordinate(int texCoordSet, int index, TexCoord3f texCoord)
    Gets the texture coordinate associated with the vertex at the specified index in the specified texture coordinate set for this object.
    Parameters:
    texCoordSet - texture coordinate set in this geometry array
    index - source vertex index in this geometry array
    texCoord - the vector that will receive the texture coordinates
    Thanks in advance.

    I am trying to get the Texture coordinates which is picked on a geometry but I have got stuck to know what vertex index is picked.
    My code:
    pickCanvas.setShapeLocation((MouseEvent) event);
    PickResult pickResult = pickCanvas.pickClosest();
    Node node = pickResult.getObject();
    GeometryArray geoArr = (GeometryArray)((Shape3D)node).getGeometry();
    TexCoord2f texCoord = new TexCoord2f();
    geoArr.getTextureCoordinate(0, ?, texCoord);Java doc said:
    Class GeometryArray
    public void getTextureCoordinate(int texCoordSet, int index, TexCoord3f texCoord)
    Gets the texture coordinate associated with the vertex at the specified index in the specified texture coordinate set for this object.
    Parameters:
    texCoordSet - texture coordinate set in this geometry array
    index - source vertex index in this geometry array
    texCoord - the vector that will receive the texture coordinates
    Thanks in advance.

  • What are the logical databases belongs to HR module.

    Hi experts,
    Please explain What are the logical databases belongs to HR module.
    Thanks,
    Rashmi

    Hi Rashmi,
    There are three LDBs in HR.
    1. PNPCE or PNP
    2. PCH
    3. PAP
    Good Luck
    Om

  • What is a logical database

    Hi All,
    what is a logical database? what is the use of it.

    Hi again,
    1. To get a taste of it.
    2. create a new z program.
    3. while creating type PNP
       in logical database field.
    4. paste this code and execute.
      REPORT ABC.
    infotypes : 0001.
    TABLES : PERNR.
    GET PERNR.
    WRITE :/ PERNR-PERNR.
    5. The selection screen which u see
       is coming from logical database PNP program.
    6. Execute
    7. U will get a list of pernr.
    SAPDBPNP
    this is the main program of LDB PNP
    which does the main work.
    SAPDB + ldb name.
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • What file format Oracle Database 11g can spool data w chinese characters?

    Hi,
    I have a batch job that spools data into a text file for further processing but now I have data that contains chinese characters.
    From what I know text file (.txt) cannot support chinese characters.
    Anyone has any idea what file format Oracle Database 11g can spool data with chinese characters?
    Thank you!
    Regards,
    Fel

    I'm not sure this can work with SQL*Plus in character mode on Windows DOS mode. But this should work with SQL Developer: see Re: How to display Chinese characters in Oracle?
    I can also make this work with Linux:
    $ locale
    LANG=fr_FR.UTF-8
    LC_CTYPE="fr_FR.UTF-8"
    LC_NUMERIC="fr_FR.UTF-8"
    LC_TIME="fr_FR.UTF-8"
    LC_COLLATE="fr_FR.UTF-8"
    LC_MONETARY="fr_FR.UTF-8"
    LC_MESSAGES="fr_FR.UTF-8"
    LC_PAPER="fr_FR.UTF-8"
    LC_NAME="fr_FR.UTF-8"
    LC_ADDRESS="fr_FR.UTF-8"
    LC_TELEPHONE="fr_FR.UTF-8"
    LC_MEASUREMENT="fr_FR.UTF-8"
    LC_IDENTIFICATION="fr_FR.UTF-8"
    LC_ALL=
    $ cat chinese.sql
    cat tchinese.sql
    set echo on
    spool tchinese.log
    select * from v$version;
    select unistr('\8349') from dual;
    exit
    $ cat tchinese.log
    SQL> select * from v$version;
    BANNER                                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod               
    PL/SQL Release 10.2.0.1.0 - Production                                         
    CORE     10.2.0.1.0     Production                                                     
    TNS for Linux: Version 10.2.0.1.0 - Production                                 
    NLSRTL Version 10.2.0.1.0 - Production                                         
    SQL> select unistr('\8349') from dual;
    UNIS                                                                           
    草                                                                              Edited by: P. Forstmann on May 27, 2009 10:30 AM
    Edited by: P. Forstmann on May 27, 2009 10:33 AM

  • What does indexing do?

    Just what does indexing do?  I clicked on a photo & asked the program to find a similar photo & the reply was that I would get better results if I indexed first.  Now the crazy part I went to the PSE 10 manual & did a text search but the stupid manual is useless since it doesn't even contain the word 'indexing', the closest you get is a passing mention of 're-indexing'.

    photodrawken wrote:
    MichelBParis wrote:
    What I have found is that this index is a file : itemdata.mk4 within the catalog folder.
    If I'm not mistaken, the visual similarity searches also use data contained in the "WaldoData" directory, which has several files in it.
    MichelBParis wrote:
    What I still can't imagine is also how the resulting 'signature' can have a numerical order to be used in an index.
    Ken
    In PSE6 there is no Waldo subfolder, only in my PSE10.
    photodrawken wrote:
    MichelBParis wrote:
    MichelBParis wrote:
    What I still can't imagine is also how the resulting 'signature' can have a numerical order to be used in an index.
    It wouldn't necessarily need a numerical order value.  I don't have any idea how PSE does its Visual Similarity searches, either, but for purposes of discussion, consider this:
    If one of the criteria used is "light coloured blob in the center of the image", then all PSE would have to do is store the image IDs of the images that fit that criteria.  If a user uses an image with a light coloured object as the VS search item, PSE would use the index to quickly retrieve those image IDs and display images of, for example, portraits or a boat on the water, etc.
    Quite a few years ago, IBM developed a "Query By Image Content" (QBIC) application which is stunning in its capabilities and accuracy.  You can use QBIC at the State Hermitage Museum (St. Petersburg, Russia) Web site to search for images in its collection:
    http://www.hermitagemuseum.org/fcgi-bin/db2www/qbicSearch.mac/qbic?sel Lang=English
    Then I believe the word 'indexing' is slightly inadequate. It is rather  a kind of multicriteria tagging.
    I happen to use the visual similarity feature, but I don't use any of the autoanalyzer functions nor face recognition. I suppose the 'Waldo' subfolder was introduced for those automatic functions.

  • What does a package database consist of?

    What does a package database consist of? can any one give me complete description.

    Hi,
    This is Prabhuram Devar,
    A package database consists of:
    /var/sadm/pkg: This is a directory containing one directory entry for every package installed on the system.
    /var/sadm/pkg/<packagename>/pkginfo
    /var/sadm/pkg/<packagename>/save/<patchid>/undo.Z for the backout packages.
    /var/sadm/pkg/<packagename>/save/pspool/<packagename>: A sparse package that is used for non-global zone install.
    /var/sadm/install/contents: This file has an entry for every file in the system that has been installed through a package. Entries are added or removed automatically using the binaries installf and removef.

  • What to do when database hang

    Hi all,
    May I know what to do when database hangs after shutdown immediate command perform? Can I use kill process command to stop Oracle process?

    Hello,
    see documentation for details of immediate-clause:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/start.htm#sthref589
    You can do an shutdown abort instead, but then sql is terminated. You can read details here: http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/start.htm#sthref595
    Greets,
    Hannibal

  • What are indexes

    Hi Forum,
    will any one please explain what are INDEXES.what are their USES, why do we create them and why do we drop them.any step by step procedure available to create them and drop them.at the same what are BW STATISTICS and what are their uses and how do we create them.
    The only way i say thanx to help full answers is by assigning points.
    Regds
    Suhel
    [email protected]

    Hi Mohammad,
    Creating and deleting indexes come with automatically when you design the process chains with your transaction data...
    Both these (deleting and re-creating indexes) are used for the betterment of the BW system performance but in different areas..
    for instance, its a usual practise to delete the indexes before loading a huge set of transaction data otherwise data loading will consume a huge amount of time to load each and every record based on the index that is already existing in the infocube... a record will go and sit inside the cube based on the indexes created for this cube... so its always advised to delete the indices before loading a huge set of data to improve the performance of data loading..
    Now, the purpose of re-creating the indices after the data has been loaded is required in order to make data retrieval comparitively easier (during reporting).. When a query is being executed, data retrieval will always be faster when indices are created for the cube.. so that records are fetched based on the indices thats created for the cube instead searching the entire cube..
    Hence, deleteing the indices before data loading enhances the performance of data loading and re-creating the indices after the data has been loaded improves the performance of data retrieval..
    Hope it answers your question..
    Regards
    Manick

  • Can we drop and then recreate the indexes when database is open.

    Can we drop and then recreate the indexes when database is open.

    I am trying to drop the index not happening..any suggestion..
    I tried :
    drop index index_name >>> index does not exist, though it exist on particular table
    drop index table_name.index_name
    drop index index_name on table_name; >> SQL command not properly ended
    Could you suggest me how would i drop it

  • How to create secondry index on database table

    how to create secondry index on database table

    Hi
    By trx SE11:
    - Choose your table and press CHANGE ICON, so INDEX
    When you create an index you should consider if your index is contained in another index.
    If the fields of your index are:
    - FIELD1, FLIED2, FIELD3
    ...it'll be triggered only if the select is:
    SELECT * FROM <TABLE> WHERE FIELD1
                            AND FIELD2
                            AND FIELD3
    A select like this
    SELECT * FROM <TABLE> WHERE FIELD1
                            AND FIELD3
                            AND FIELD2
    doesn't use your index.
    Max

Maybe you are looking for

  • Item & Discount added in the Sales Order

    Dear All, I have a requirement where in once a Sales Order is created with approved Quotation, then no new extra items to be added in the sales order. Quantity in the existing line item can be decreased to the lower side but no addition in quantity t

  • How did my text turn red?

    Hi again, You guys were so helpful with my first question I thought I'd try another one: You see, I started using Dreamweaver CS5. Obviously, I didn't know how to use it because I messed some things up. Another thing that happened was that most of th

  • Unable to set my Wifi network!

    I just got my my first airport extreme router last evening. I have been struggling to set it up as an extender with my existing Netgear Wi-Fi router, for which I have have had to attach it to my net gear router through ethernet cable. However, after

  • Help with uppercase letters in Find/Change

    Hiyis. I'm trying to change all instances of "US" to "U.S.," but when I type it into Find/Change, I'm getting stuff like "discuss" highlighted. Any way to specify just uppercase US on its own? Or do I have to go through and review every suggested cha

  • Joining to the Active Diresctory

    Dear Guys,  I am facing problem in joining to the domain, one of university here in Oman, they order 24 pieces to our company, the OS x Mountain Lion, and they want to join to active directory all of imac. but when i try to bind to AD Windows Server