索引,视图,存储过程,函数
索引(index):索引是提高select操作性能的最佳途径,分为Btree索引和Hash(主要是MEMORY引擎)索引。实现方式有:前缀索引,全文本索引,空间列类创建索引。暂时不支持函数索引。
语法:创建:create [unique/fulltext]index __ on _表名_ ( _ 列名_ ) ;
删除:drop index __ on __ ;
Btree和Hash索引的区别:Btree支持范围内的查询,而Hash只支持精确的查找,即等号查询。
索引分类:primary key unique index fulltext
视图(view):定义:是一种虚拟的表结构,主要是简单,透明,用来加强底层数据库的安全性。
视图操作:创建: create or replace algorithm=undefined/merge/temptable view __ as _sql语句_ with cascaded/local check option
修改:alter algorithm=undefined/merge/temptable view __ as _语句_with cascaded/local check option
删除:drop view if exists __ ;
查看视图定义:show table status like __ ; or show create view __ \G ;
存储过程(procedure):定义理解: