GRANT 权限检查对 MySQL 性能有多大影响? [英] How much does GRANT permission checking affect MySQL performance?

查看:51
本文介绍了GRANT 权限检查对 MySQL 性能有多大影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读这篇文章:http://www.ajaxline.com/32-tips-to-speed-up-your-mysql-queries

在第 4 点,它指出:

at point#4 , it states :

在发出 GRANT 语句时使用更简单的权限可以启用MySQL 减少客户端执行时的权限检查开销声明.

Using simpler permissions when you issue GRANT statements enables MySQL to reduce permission-checking overhead when clients execute statements.

问题:

  1. 这对性能有何影响?
  2. 更简单的权限"是什么意思?例如.如果我有一个拥有所有权限的 root 用户,例如.在数据库上创建或更改表,以及我的 Web 应用程序的appDbUser",我应该如何向 appDbUser 授予 SELECT、UPDATE、DELETE、INSERT 权限以符合上述文本中的建议.

推荐答案

最简单的方法是对其进行概要分析并亲自查看....

The easiest way would be to profile it and see for yourself....

-- enable profile gathering
SET PROFILING = 1;

SELECT <query involving complex set of column and table permissions>;

SHOW PROFILE

--or SHOW PROFILES, and then SHOW PROFILE FOR QUERY 2 etc

-- turn profiling back off again
SET PROFILING = 0;

这将显示一个表格,显示正在执行的查询的每个阶段以及持续时间.您可能会看到,即使有相当复杂的权限,与查询的执行、排序和分组相比,时间并不重要

This will present a table showing each stage of the query being executed, along with the duration. You will probably see that even with fairly complex permissions, the time is not significant compared to the execution, sorting and grouping of the query

这篇关于GRANT 权限检查对 MySQL 性能有多大影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆