SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2001
    Location
    UK
    Posts
    553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Understanding Indexes... Or Not

    I've been purusing some of the MySQL documentation, particularly the pages on query optimisation. One thing which seems to come up again and again is the use of Indexes. And yet I've never used them! I understand the benifits of them, but don't see how they should be used, and in what circumstances they should be implemented.

    Can anyone tell me how you know which columns should have an index, and what is the difference between the different type of Indexes i.e. Index, Unique and Fulltext.

    I'd like to learn more about using Indexes but I didn't find the MySQL documentation on them all that helpful... can anyone point me in the direction of a good tutorial or article on Indexes?

    Thanks in advance,
    Regards, Ant.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,274
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    to answer your immediate question, declare indexes on join columns and/or columns in WHERE clause search conditions

    <tip type="googling">
    when the originating site has documentation that you find hard to read, try googling, specifically excluding that site using a search string like
    mysql indexes -site:mysql.com
    </tip>

    here are three of the better hits on the first page of results

    Optimizing MySQL Queries and Indexes

    Optimizing your MySQL Application

    MySQL Performance Tuning -- How to Write Efficient MySQL Applications by Jeremy Zawodny (Senior Editor of Linux Magazine and the MySQL database expert at Yahoo! Finance)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •