Results 1 to 5 of 5
-
01-18-2007, 03:15 PM #1Junior Guru Wannabe
- 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
-
01-18-2007, 04:02 PM #2Newbie
- Join Date
- Nov 2006
- Posts
- 13
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
-
01-18-2007, 04:50 PM #3Junior Guru Wannabe
- Join Date
- Dec 2006
- Posts
- 76
So I just create the index, and then I could do a search as normal?
Thank You
-
01-18-2007, 05:06 PM #4Web Hosting Guru
- 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.
-
01-18-2007, 06:46 PM #5Junior Guru Wannabe
- 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.