evanvolgas / common-schema

Automatically exported from code.google.com/p/common-schema
0 stars 0 forks source link

view to generate SQL to kill slow queries #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What component are you suggesting? (view, table, function, procedure)
- view

- What will this new component do?
generate SQL statements to kill slow queries

- Characteristics of the component? (e.g. NO SQL for stored function)

- Dependencies for component?
perhaps one of the security tables from common_schema

- Compatibility with what kind of MySQL version/distribution?
>= 5.1

- OS specific issues?
none

- Do you expect this to be a heavyweight operation? Why?
no

- Anything else?
based on:
http://forge.mysql.com/tools/tool.php?id=106

Please label as "Type-Enhancement"

Original issue reported on code.google.com by shl...@makam.co.il on 21 Jul 2011 at 4:46

GoogleCodeExporter commented 8 years ago
Question: the user+host as listed on PROCESSLIST do not necessarily reflect any 
GRANTEE account. 

Compare this to USER() and CURRENT_USER().
The processlist identifies the USER() while the grantee refers to 
CURRENT_USER().

How do you solve that?

Original comment by shl...@makam.co.il on 21 Jul 2011 at 5:47

GoogleCodeExporter commented 8 years ago
Hrm, currently I don't have a way to solve this.  I think it would require some 
changes to the server to report CURRENT_USER in another column of processlist.

Original comment by TodoI...@gmail.com on 22 Jul 2011 at 3:45

GoogleCodeExporter commented 8 years ago
A solution is presented here: 
http://code.openark.org/blog/mysql/finding-current_user-for-any-user

I've already committed the function code; not yet released

Original comment by shlomi.n...@gmail.com on 9 Aug 2011 at 11:20

GoogleCodeExporter commented 8 years ago
complete in revision 68

Original comment by shlomi.n...@gmail.com on 6 Sep 2011 at 10:32