SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2000
    Location
    Seattle, WA area
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can someone explain to me good indexing techniques for MySQL databases. What columns are good to index? Should whole tables that get accessed frequently be indexed? That kind of information.

    An explanation or a point in the right direction would be helpful. Thanks.

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    While I'm not too hot on this myself (I tend to index any field that contains an id which will be used to relate tables together) there's a very good tutorial on this subject here:

    http://www.phpbuilder.net/columns/tim20010110.php3

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2000
    Location
    Seattle, WA area
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. That indexing stuff is confusing!

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Generally any column that will be searched should be indexed. If you're only going to be using a table to list the entire table's contents, indexes are really not required.

    As Skunk suggests, ID variables used to relate tables of data, as well as any text fields that are used by a search script on your site are good candidates for indexing.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •