Plannig indexing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dany13
    New Member
    • Apr 2008
    • 5

    Plannig indexing

    Dear all.
    I am designing the database for SQL server 2005 . I have problem in planning index.
    In one part I have personal table. I don’t need quarry by personal ID any time but I create clustered index in personal ID by add primary key constraint .
    I decide have to clustered index constraint in other column for example last name or SSN and add none clustered index for primary key.
    I need some Idea about this.
    Thank you , Saeid.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by Dany13
    ...I don’t need quarry by personal ID any time but I create clustered index in personal ID by add primary key constraint .
    ...
    Are you sure about this? Don't you have personalID appearing as a foreign key in other tables?

    Comment

    • Dany13
      New Member
      • Apr 2008
      • 5

      #3
      i use PersonalID for foreign key but for this propose I can add non clustered index .
      By this work sort data in table in insert time and increase quarry performance.
      it is right?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Dany13
        i use PersonalID for foreign key but for this propose I can add non clustered index .
        By this work sort data in table in insert time and increase quarry performance.
        it is right?
        Not sure I understand what you are trying to say but I think this article should be able to help you more.

        Comment

        • ck9663
          Recognized Expert Specialist
          • Jun 2007
          • 2878

          #5
          Indexing,makes accessing tables faster, that's a general rule.

          If the table will only have one index, make it clustered.

          Create a clustered index for your primary key and create non-clustered for those columns frequently use in WHERE conditions on your query. Though re-indexing is a 3GL thing, (dbase, foxpro, foxbase) it wouldn't hurt to do a index maintenance whenever your data increases by at least 10-15%.

          -- CK

          Comment

          Working...