MYISAM table type or engine - creates 3 files on disk for each table.
- for structure .frm
- for data .myd
- for index .myi If I create new index for already existed table, which files from above get changed?
When we create index, what exactly happends to the data in table? does the records in table get chenged for indexed column?
If we insert new record as
name = aaass
,salary = 40500
, at which position the record is stored? at the end? or as we created index, it will store bellow the name= aaab?
e.g table is
id name salary
1 aaa 20000
2 ddd 23000
3 aaabb 10000
4 dddqa 40000
if I create index on name, then does data gets rearraged as follows?
id name salary
1 aaa 20000
3 aaabb 10000
2 ddd 23000
4 dddqa 40000
If not then what is the use of index?