Does creating a table automatically creates index on the column. I mean if I will create a table create table.....(id, name) Will this automatically be indexed on id and name ?
No. Nor should it be. Indices incur a decrease in insert/update/delete performance so you wouldn't want them added by default.
Some database s (such as SQL Server) will automatically create indices on columns that are foreign keys. Other than that by and large its up to you to choose what to index.
Jeanne Boyarsky
,
author & internet detective
staff
Priyakant, Many databases automatically create an index on the primary key (likely id in your example.)
There would be no point in creating an index on all the columns in the table - automatically or manually. The reason is that such an index would be just as large as the source table. Which means it would take just as long to scan as the table.