Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2006
    Posts
    76

    Need help with MySQL database design

    I am designing a website that stores values in a MySql database. I need them to be able to be looked up by two numbers at the same time. I know how to use MySql queries to do what I need, but I am afraid that the database will grow quickly, and then start querying slowly. I heard about indexes, but after seaching on google, I haven't been able to figure out whether or not they are what I want, or how to use them.

    Can someone explain to me what indexes are, how they work, and how to use them.

    Thanx in advance

  2. #2
    Here's a perfect read up on it. It doesn't really get much clearer than this if you already understand MySQL and how to use the queries in your code.

    http://mysqld.active-venture.com/MySQL_indexes.html

  3. #3
    Join Date
    Dec 2006
    Posts
    76
    So I just create the index, and then I could do a search as normal?

    Thank You

  4. #4
    Join Date
    Jun 2004
    Location
    Ontario Canada
    Posts
    259
    Basically yes. Indexes are a way for MySQL to quickly search through specific fields that you have chose as an index. Properly using indexes will greatly increase your query speeds, and you do not need to change your query syntax at all. For example, I have a database with over 500 Million entries, and with 99.9% Key Efficiency, it can process a few thousand queries a second still.

    Keep in mind though if you have a large database having too many indexes can become inefficient as well (and consume a lot of space) as indexes are stored in a seperate file.

  5. #5
    Join Date
    Dec 2006
    Posts
    76
    Thank You. I don't think space will be too much of a problem, as my hosting provider gave me a good deal.

Posting Permissions

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