views:

26

answers:

1

Hi I am a newbie to mysql

Here are my questions:

  1. What is the use of Mysql Index key?

  2. Does it make a difference in mysql queries with defining a Index key and without it?

  3. Are all primary keys default Index key?

Thanks a million

+1  A: 

1- Defining an index on a column (or set of columns) makes searching on that column (or set) much faster, at the expense of additional disk space.

2- Yes, the difference is that queries using that column will be much faster.

3- Yes, as it's usual to search by the primary key, it makes sense for that column to always be indexed.

Read more on MySQL indexing here.

Roadmaster
Thanks!!!!!!!!!!!!!!!!~
leon