SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    o_O O_o BlueFire2k5's Avatar
    Join Date
    Mar 2003
    Location
    Sioux Falls, SD
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about indexes...

    I'm creating a forum/CMS system, and I use unique ID numbers to find almost everything, from posts to boards to users. Would it be in my best interests to index all the ID columns to speed up the forum/CMS?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,248
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    yes, but only if those IDs are used in joins

    and if they were declared as primary keys, they already have indexes
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    o_O O_o BlueFire2k5's Avatar
    Join Date
    Mar 2003
    Location
    Sioux Falls, SD
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that speed up the script quite a bit. Load times decreassed by nearly 1/3. Didn't know indexing some columns would speed things up that much.

    Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •