MySQL represents each table by an .frm table format (definition) file in the database directory. The storage engine for the table might create other files as well. For InnoDB tables, the file storage is controlled by the innodb_file_per_table configuration option. When this option is turned off, all InnoDB tables and indexes are stored in the system tablespace , represented by one or more ibdata* files . For each InnoDB table created when this option is turned on, the table data and all associated indexes are stored in a .ibd file located inside the database directory. For MyISAM tables, the storage engine creates data and index files. Thus, for each MyISAM table tbl_name , there are three disk files. File Purpose tbl_name .frm Table format (definition) file tbl_name .MYD Data file tbl_name .MYI Index file
CREATE INDEX To create a B-tree index on the column title in the table films : CREATE UNIQUE INDEX title_idx ON films (title); ALTER INDEX ALTER INDEX distributors RENAME TO suppliers; ALTER INDEX name RENAME TO new_name
Comments
Post a Comment