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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. difference b/w clustered and non-clustered index...

difference b/w clustered and non-clustered index...

Scheduled Pinned Locked Moved Database
databasesql-serversysadmin
6 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
    siva455
    wrote on last edited by
    #1

    please let me know the difference b/w clustered and non-clustered index... in sQL server in simple language....eventhough i searched in google im not clear abt the exact diff and in which scenario use these indexes...(clustered and non clustered)

    W 1 Reply Last reply
    0
    • S siva455

      please let me know the difference b/w clustered and non-clustered index... in sQL server in simple language....eventhough i searched in google im not clear abt the exact diff and in which scenario use these indexes...(clustered and non clustered)

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Basically the main difference is that both are B-tree indexes but clustered index causes the data in the table to be sorted based on the indexed columns. This is why a single table cannot have multiple clustered indexes. Nonclustered index is like an index at the end of a book. Entries are sorted and there are pointers (page numbers in book) referencing the actual place for the data. Have a look at this: Nonclustered Index Structures [^] Regards, mika

      The need to optimize rises from a bad design.My articles[^]

      M 1 Reply Last reply
      0
      • W Wendelius

        Basically the main difference is that both are B-tree indexes but clustered index causes the data in the table to be sorted based on the indexed columns. This is why a single table cannot have multiple clustered indexes. Nonclustered index is like an index at the end of a book. Entries are sorted and there are pointers (page numbers in book) referencing the actual place for the data. Have a look at this: Nonclustered Index Structures [^] Regards, mika

        The need to optimize rises from a bad design.My articles[^]

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Mika Wendelius wrote:

        data in the table to be sorted

        Don't you mean sorted and STORED using the clustered index, I think that is the most relevant part.

        Never underestimate the power of human stupidity RAH

        W 1 Reply Last reply
        0
        • M Mycroft Holmes

          Mika Wendelius wrote:

          data in the table to be sorted

          Don't you mean sorted and STORED using the clustered index, I think that is the most relevant part.

          Never underestimate the power of human stupidity RAH

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Yap, exactly. I was thinking the table as a permanent object but it's a good idea to clearly point that out. Thanks.

          The need to optimize rises from a bad design.My articles[^]

          M 1 Reply Last reply
          0
          • W Wendelius

            Yap, exactly. I was thinking the table as a permanent object but it's a good idea to clearly point that out. Thanks.

            The need to optimize rises from a bad design.My articles[^]

            M Offline
            M Offline
            Mycroft Holmes
            wrote on last edited by
            #5

            It's been a while since we saw you here, welcome back.

            Never underestimate the power of human stupidity RAH

            W 1 Reply Last reply
            0
            • M Mycroft Holmes

              It's been a while since we saw you here, welcome back.

              Never underestimate the power of human stupidity RAH

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              Thank you Mycroft :) Yes, it's been a really busy couple of years. I noticed that you've been a 2010 MVP :thumbsup:. Congratulations (sorry that this comes so late!)

              The need to optimize rises from a bad design.My articles[^]

              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