Bug #71278 | NUMBER OF ROWS IN PERFORMANCE SCHEMA TABLES | ||
---|---|---|---|
Submitted: | 2 Jan 2014 17:22 | Modified: | 17 Feb 2014 18:07 |
Reporter: | Valeriy Kravchuk | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Performance Schema | Severity: | S3 (Non-critical) |
Version: | 5.6 | OS: | Any |
Assigned to: | Marc ALFF | CPU Architecture: | Any |
Tags: | missing manual, performance_schema, threads |
[2 Jan 2014 17:22]
Valeriy Kravchuk
[2 Jan 2014 18:23]
MySQL Verification Team
Hello Valeriy, Thank you for the bug report. Verified as described. Thanks, Umesh
[6 Jan 2014 14:13]
Marc ALFF
Taking this as a server bug in the performance schema, instead of a doc bug. Currently, the performance schema only supports full table scans, and has *no* indexes and/or condition push down exposed to the optimizer, so that the only thing the optimizer can possible care about is: - whether the table is empty (0 rows) - whether the table is a constant (exactly 1 row) - whether the table has many rows (2 rows or more). In other words, 3 different values are used : 0, 1, and "MANY" All the optimizer heuristics are the same for N >= 2 rows, so returning a hard coded "1000" as of today, or a better and more accurate estimate, has no visible effect in any case. The output of EXPLAIN SELECT is confusing, but there are no change of behavior what-so-ever caused by the inaccurate estimate returned for the number of rows. Now, considering that the code (improved since then) already supports a better way to compute a number of rows for each table (see PFS_engine_table_share::get_row_count()), fixing this bug to implement a m_get_row_count() callback for every table is better, and therefore needs to be done to improve the code base, and avoid confusion with EXPLAIN. For the record, the size of table performance_schema.threads is controlled by the parameter named performance_schema_max_thread_instances. While EXPLAIN SELECT does not show it, SHOW ENGINE PERFORMANCE_SCHEMA STATUS output is accurate and does show the correct sizes.
[17 Feb 2014 18:07]
Paul DuBois
Noted in 5.7.4 changelog. Previously, for EXPLAIN output, the rows-examined estimate for Performance Schema tables always displayed as 1000. Now a more accurate estimate is displayed based on sizing parameters used when allocating memory for each table. This results in no change of behavior because Performance Schema tables have no indexes.