Results 1 to 3 of 3
Can someone explain to me what indexes are? This is the one topic I cannot seem to grasp....
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-26-2003 #1Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Index
Can someone explain to me what indexes are? This is the one topic I cannot seem to grasp.
The best things in life are free.
- 05-26-2003 #2Linux Engineer
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
An index are in short term a shortcut... the database keep track of the fields,columns you have put your index on, so it knows for example how many lines it is on that column (keeps statistics),
indexes are used to prevent full table scans which means that the database have to check all lines in a table to find the value it wants. If an index can be used, the query just have to go throw for example 30000 lines instead of 10000000 lines for a full table scan.
To get the best performance you have to know a litte about databases and how they function and good knowledge about SQL-language.
Regards
Regards
Andutt
- 05-26-2003 #3Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Yeah, indexes are basically for filtering rows to find the most relevant hits faster. If you use indexes on columns that you use very much in WHERE ops or grouping and linking ops, you will get better performance. They do take extra hard drive space, though, so its not necessarily a good idea to use them on all columns.
I'm sure the MySQL manual says a lot about it if you want to check it out.


Reply With Quote
