权限设置越复杂,所有 SQL 语句的开销就越大。简化通过 GRANT 语句建立的权限,可以使 MySQL 在客户端执行语句时减少权限检查开销。例如,如果您未授予任何表级或列级权限,服务器就无需检查 tables_priv 和 columns_priv 表的内容。类似地,如果您没有对任何账户设置资源限制,服务器就不需执行资源计数。如果您的语句处理负载非常高,可以考虑使用简化的授权结构来减少权限检查开销。The more complex your privilege setup, the more overhead applies
to all SQL statements. Simplifying the privileges established by
GRANT statements enables MySQL to
reduce permission-checking overhead when clients execute
statements. For example, if you do not grant any table-level or
column-level privileges, the server need not ever check the
contents of the tables_priv and
columns_priv tables. Similarly, if you place
no resource limits on any accounts, the server does not have to
perform resource counting. If you have a very high
statement-processing load, consider using a simplified grant
structure to reduce permission-checking overhead.