mysql - What happens if I put index on each column in a table -


let consider have table 60 columns , need perform kind of queries on table , need join table other tables well. , using rows searching data in table including other tables. table primary table(like primary key) in database. table in relation table. considering above scenario can create index on each column on table (60 columns ) ,is practice ?

in single sentence:

is best practice create index on each column in table ? might happens if create index on each column in table? 

where index might "primary key", "unique key" or "index"

please comment, if question unclear people try improve question.

mysql's documentation pretty clear on (in summary use indices on columns use in where, join, , aggregation functions).

therefore there nothing inherently wrong creating index on columns in table, if 60 columns. more indices there slower inserts , updates because mysql has create keys, if don't create indices mysql has scan entire table if non-indexed columns used in comparisons , joins.

i have i'm astonished would

  1. have table 60 columns
  2. have all of columns used either in join or where clause without dependency on other column in same table

...but that's separate issue.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -