Bug #72229 It is confusing that P_S records impacts of itself in P_S tables.
Submitted: 3 Apr 2014 19:57 Modified: 4 Apr 2014 19:16
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:any that has P_S OS:Any
Assigned to: CPU Architecture:Any

[3 Apr 2014 19:57] Peter Laursen
Description:
Following the discussion in http://bugs.mysql.com/bug.php?id=72218 (where I accept Valeriy's explanation) I find that P_S should have an option not to record what impact it has itself on the server (threads, connections etc.). There should be an option to filter this.

This is a wellknown issue in varios branches of physics (refer for instance http://en.wikipedia.org/wiki/Observer_effect_(physics) and http://en.wikipedia.org/wiki/Uncertainty_principle) but I think it applies equally well here! 

P_S measurements should to the largest extend possible not add *noise* to what is measured.

How to repeat:
see above

Suggested fix:
see above
[4 Apr 2014 6:52] Valeriy Kravchuk
Why do you think that queries to P_S or P_S activity in general has impact worth discussing? Any evidence?

Please, check setup_objects table that by default has a content like this:

mysql> select * from performance_schema.setup_objects;
+-------------+--------------------+-------------+---------+-------+
| OBJECT_TYPE | OBJECT_SCHEMA      | OBJECT_NAME | ENABLED | TIMED |
+-------------+--------------------+-------------+---------+-------+
| TABLE       | mysql              | %           | NO      | NO    |
| TABLE       | performance_schema | %           | NO      | NO    |
| TABLE       | information_schema | %           | NO      | NO    |
| TABLE       | %                  | %           | YES     | YES   |
+-------------+--------------------+-------------+---------+-------+
4 rows in set (0.00 sec) 

You see "NO" for P_S there, and according to the manual, http://dev.mysql.com/doc/refman/5.6/en/setup-objects-table.html, it means that access to tables in P_S is not instrumented, so impact should be minimal:

"The effect of the default object configuration is to instrument all tables except those in the mysql, INFORMATION_SCHEMA, and performance_schema databases."
[4 Apr 2014 19:16] Sveta Smirnova
Valeriy,

thank you for the great explanation! Report closed as "Not a Bug".