Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. what is the use of indexes , when i creating table it already creating one index..........

what is the use of indexes , when i creating table it already creating one index..........

Scheduled Pinned Locked Moved Database
questionsharepointdatabaseperformancecode-review
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shaik Haneef
    wrote on last edited by
    #1

    hi all, i created table like that below create table extable(empid int primary key identity(1,1),empname varchar(50) not null,salary money not null) when i execute sp_help it already created one index for that table. sp_help extable PK__extable__3D9E16F4 Is it clustered index or non-clustered index ? what is the use of that index, how can improve that performance of the retrieving data

    This is haneef.............................................................

    J V 2 Replies Last reply
    0
    • S Shaik Haneef

      hi all, i created table like that below create table extable(empid int primary key identity(1,1),empname varchar(50) not null,salary money not null) when i execute sp_help it already created one index for that table. sp_help extable PK__extable__3D9E16F4 Is it clustered index or non-clustered index ? what is the use of that index, how can improve that performance of the retrieving data

      This is haneef.............................................................

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      The primary key is, by default, created as a clustered index. It will be used for lookups using "empid" in your case. Improving performance for retrieving data depends on how you lookup the data. For example, if you tend to lookup using empname put an index on that. If you lookup using empname and salary then create an index which includes both those columns. This is obviously a simplistic answer - indexing is a fine art where you must balance performance.

      1 Reply Last reply
      0
      • S Shaik Haneef

        hi all, i created table like that below create table extable(empid int primary key identity(1,1),empname varchar(50) not null,salary money not null) when i execute sp_help it already created one index for that table. sp_help extable PK__extable__3D9E16F4 Is it clustered index or non-clustered index ? what is the use of that index, how can improve that performance of the retrieving data

        This is haneef.............................................................

        V Offline
        V Offline
        Vinay Dornala
        wrote on last edited by
        #3

        Hi, The clustered index is created on primary key. a table can have only one clustered index the reason the data is arranged in physical order, sql server will maintain index record this will contain all index values mean empid in particular order. When we fire an select query this will arrange the result set in following format and fetch the corresponding record. The proper implementation of clustered index will reduce the query response time. The disadvantage is All the index values should present in Index Record Table( here is empids) empid 101 ---------> 101 XXX India 102 ---------> 102 YYY USA 103 ---------> 103 ZZZ UK Non Clustered index on table will arrange result set in heap sorting order this mean not all index values should not present in Index Record. This will occupies less memory space. We will usually created on Non primary keys. -.Net Professional.

        modified on Tuesday, May 20, 2008 3:10 AM

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups