How Indexes improve performance?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dilippanda
    New Member
    • Jun 2007
    • 26

    How Indexes improve performance?

    Hi,

    Can you please explain me how indexes improve performance?
    And where to use which index?

    A link will also be useful for me.

    Thanks,
    Dilip
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    An index creates an entry for each value that appears in the indexed columns. By default, Oracle creates B-tree indexes.


    The syntax for creating a index is:

    CREATE [UNIQUE] INDEX index_name
    ON table_name (column1, column2, . column_n)
    [ COMPUTE STATISTICS ];

    UNIQUE indicates that the combination of values in the indexed columns must be unique.

    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.

    We could also choose to collect statistics upon creation of the index as follows:

    [CODE=oracle]CREATE INDEX emp_namesal_ind ON emp (ename, sal) COMPUTE STATISTICS;[/CODE]

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You can also follow this link for further details.

      Comment

      • dilippanda
        New Member
        • Jun 2007
        • 26

        #4
        Thank you very much.
        Originally posted by debasisdas
        You can also follow this link for further details.

        Comment

        Working...