Administrative privileges 用户此权限的用户能进行数据库管理的工作,不针对特别的数据库
Database privileges 针对具体的某个数据库以及数据库下所有的对象
Privileges for database objects 针对某个数据库对象,比如表、索引、视图、存储过程等
MySQL的Multiple-Column Index
MySQL can use multiple-column indexes for queries that test all the columns in the index, or queries that test just the first column, the first two columns, the first three columns, and so on
如果一个表有multiple-column索引,那么只有索引的最左前缀(leftmost prefix )才能被优化器使用。例如,有一个3列的索引在(col1, col2, col3),只有(col1), (col1, col2), 和 (col1, col2, col3) 才能走索引。
假如有以下表和索引的定义,索引testidx建立在col2列和col3列上:
db2 "create table test(col1 int, col2 int, col3 int)"
db2 "create index testidx on test(col2, col3)"
那么以下SQL会用到索引testidx:
SELECT * FROM test WHERE col2=1111"
SELECT * FROM test WHERE col2=1111 AND col3=2111"
SELECT * FROM test WHERE col2=1111 AND (col3=2111 OR col3=2112)"
SELECT * FROM test WHERE col2=1111 AND col3 >=2111 AND col3 < 2114"
以下SQL不会用到索引testidx:
"SELECT * FROM test WHERE col3=2111"
"SELECT * FROM test WHERE col2=1111 OR col3=2111"
http://blog.csdn.net/qingsong3333/article/details/76736641