FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


mySQL question N2 - Indexing





animassacre
I have no idea, what is this thing 'index' ,how it works , what should be indexed and why .

Can you explane it to me or sugges some reading material?
shamil
animassacre wrote:
I have no idea, what is this thing 'index' ,how it works , what should be indexed and why .

Can you explane it to me or sugges some reading material?
First u should try to google ur problem. Because it is faster. Avoid wasting time by writing and waiting for reply for one click problems.
Google mysql index tutorial. You will find loads of stuff to read. Good luck.
animassacre
Before you wrote that did you tryed to google 'mysql index tutorial' yourself.

there was one tutorial on the topic, but i didn't understood much.
shamil
animassacre wrote:
Before you wrote that did you tryed to google 'mysql index tutorial' yourself.

there was one tutorial on the topic, but i didn't understood much.
Yes i did so. Not one there are lots of related tutorials. You should select more appropriate ones.
I think first result is answer to ur question.
animassacre
animassacre wrote:
Before you wrote that did you tryed to google 'mysql index tutorial' yourself.

there was one tutorial on the topic, but i didn't understood much.


I was talking abouth the first Smile Rolling Eyes
powers1983
As far as I understand it you index a field if you want mySQL to be able to find something in that field quicker.

eg. if you have a field called 'usernames' and for whatever reason you are always searching it:

Code:
SELECT * from table WHERE usernames='$current_user';


If you specify the field 'usernames' as an index then mySQL stores the information somewhere it can search must faster. Not sure how it works and it probably isn't that important (maybe it stores a sorted copy plus some other optimizations).

The downside is that it uses more space to index a table (as mySQL has to have more copies of the same data) and also if you are adding to or altering values in the indexed field then mySQL has to recreate the index each time which causes increased server load.

So you should only use indexes where it is neccessary to speed up the searching of specific fields (ie. not on everything).

Try here: http://hudzilla.org/phpwiki/index.php?title=Indexes for more info
animassacre
powers1983 ,
10x for the link
Related topics
PHP/MySQL question
n00b mySQL question :D
quick mysql question
What exactly does indexing mysql do?
Mysql question!
The last foolish PHP/MySQL Question of the Year....
MySQL Question
mySQL question....
newbie MySQL question
PHP MySQL Question
mySQL question
I'm having problems understanding keys
statement MySQL question
Newbie PHP/MySQL question
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.