2

I will short my question. (SQL-Server 2008)

Is it a good idea , when crating a new table, to create an index for each column?

Why i'm saying this?

Today I was creating a database, and my boss was behind me, and he said:

"Oh, it's good to create an index, for every column" (and then he showed me the graphic way to do this).

I'm studying indexes now and I'm not sure if this is a good idea, since every index will be updated everytime time there will be an insert\update on the table.

Some advices?

ypercubeᵀᴹ
  • 99,450
  • 13
  • 217
  • 306
Racer SQL
  • 7,546
  • 16
  • 77
  • 140

2 Answers2

6

Would you find it useful to have the phone book, only having it as a list of Surnames with phone numbers, plus a list of Firstnames with phone numbers, and a list of towns with phone numbers? Because essentially, that's what you're getting if you index each column individually.

Rob Farley
  • 16,324
  • 2
  • 39
  • 61
1

Absolutely NO! Creating index on tables decreases insertion performance and you must create an index only if you really need that (if you include the column in select queries many times).

Vérace
  • 30,923
  • 9
  • 73
  • 85
Hooman
  • 11
  • 2