Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009

    Unanswered: About index in SQL

    Can somebody explain what index do exactly???

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2002
    Toronto, Canada
    Quote Originally Posted by ambi
    Can somebody explain what index do exactly???
    provides a shortcut to the rows you want

    let's assume you walk into the empire state building looking for gadget company

    all you see is a directory listing the companies on each floor --

    1st floor -- widgets r us, gizmos inc, doohickey company

    2nd floor -- thingamajig enterprises, whatsis inc, gewgaw internationsl

    3rd floor -- ... you get the idea

    what you have to do is scan (read sequentially) every floor in the directory until you find the company you're looking for

    it would be even worse if there was no directory at all, and you had to actually visit each floor to see if gadget company was there

    on the other hand, suppose you had a building directory which listed the companies in alphabetic order

    you just look at the list under "G" to find the floor that gadget company is on, and go straight to that floor

    that's an index -- it gives the database a shortcut to the rows you asked for | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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