-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
MDEV-4682 - Include statistic fields to query cache and qc_info #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
79102cd
Include statistic fields to query cache and qc_info
rspadim 26001e1
Use MY_MIN instead of min, downgrade from gamma to alpha
rspadim af2a39c
forgot to define qc_info_now variable at query_cache::end_of_result
rspadim 9b5cfce
rewrote test files
rspadim abf6f24
change #define #ifdef macros to always include stats columns
rspadim a57e57a
Include compile time macro HAVE_QUERY_CACHE_STATS
rspadim 5fe6231
Include a new column to query_cache_queries_table with table suffix
rspadim 7bca392
include is_disabled() before try_lock
rspadim 0dfd1e0
When HAVE_QUERY_CACHE_STATS isn't defined, set all unused fields as null
rspadim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
set global query_cache_size=1355776; | ||
create table t1 (a int not null); | ||
create table t1 (a int not null) engine=myisam; | ||
insert into t1 values (1),(2),(3); | ||
select * from t1; | ||
a | ||
1 | ||
2 | ||
3 | ||
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; | ||
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_queries; | ||
statement_schema statement_text result_blocks_count result_blocks_size | ||
test select * from t1 1 512 | ||
select `schema`,`table` from information_schema.query_cache_queries_tables; | ||
schema table | ||
test t1 | ||
select `table_schema`,`table_name` from information_schema.query_cache_tables; | ||
table_schema table_name | ||
test t1 | ||
drop table t1; | ||
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; | ||
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_queries; | ||
statement_schema statement_text result_blocks_count result_blocks_size | ||
set global query_cache_size = 0; | ||
select * from information_schema.query_cache_info; | ||
STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED | ||
select * from information_schema.query_cache_queries; | ||
QUERY_CACHE_ID STATEMENT_SCHEMA STATEMENT_TEXT RESULT_FOUND_ROWS QUERY_ROWS SELECT_ROWS_READ QUERY_HITS QUERY_HITS_PERIOD_LOW QUERY_HITS_PERIOD_HIGH QUERY_HITS_PERIOD_OUTLIERS QUERY_HITS_TOTAL_TIME_US QUERY_HITS_MEAN_PERIOD_US QUERY_HITS_MEAN_PERIOD_LOW_US QUERY_HITS_MEAN_PERIOD_HIGH_US QUERY_INSERT_TIME QUERY_LAST_HIT_TIME SELECT_EXPEND_TIME_US SELECT_LOCK_TIME_US TABLES_TYPE RESULT_LENGTH RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED FLAGS_CLIENT_LONG_FLAG FLAGS_CLIENT_PROTOCOL_41 FLAGS_PROTOCOL_TYPE FLAGS_MORE_RESULTS_EXISTS FLAGS_IN_TRANS FLAGS_AUTOCOMMIT FLAGS_PKT_NR FLAGS_CHARACTER_SET_CLIENT FLAGS_CHARACTER_SET_RESULTS FLAGS_COLLATION_CONNECTION FLAGS_LIMIT FLAGS_TIME_ZONE FLAGS_SQL_MODE FLAGS_MAX_SORT_LENGTH FLAGS_GROUP_CONCAT_MAX_LEN FLAGS_DIV_PRECISION_INCREMENT FLAGS_DEFAULT_WEEK_FORMAT FLAGS_LC_TIME_NAMES | ||
select * from information_schema.query_cache_queries_tables; | ||
QUERY_CACHE_ID SCHEMA TABLE | ||
select * from information_schema.query_cache_tables; | ||
TABLE_SCHEMA TABLE_NAME TABLE_HASHED TABLE_TYPE QUERIES_IN_CACHE | ||
set global query_cache_size= default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'query_cache_info' and plugin_status='active'`) | ||
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'query_cache_queries' and plugin_status='active'`) | ||
{ | ||
--skip QUERY_CACHE_INFO plugin is not active | ||
--skip QUERY_CACHE_QUERIES plugin is not active | ||
} | ||
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'query_cache_queries_tables' and plugin_status='active'`) | ||
{ | ||
--skip QUERY_CACHE_QUERIES_TABLES plugin is not active | ||
} | ||
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'query_cache_tables' and plugin_status='active'`) | ||
{ | ||
--skip QUERY_CACHE_TABLES plugin is not active | ||
} | ||
|
||
set global query_cache_size=1355776; | ||
|
||
create table t1 (a int not null); | ||
create table t1 (a int not null) engine=myisam; | ||
insert into t1 values (1),(2),(3); | ||
select * from t1; | ||
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; | ||
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_queries; | ||
select `schema`,`table` from information_schema.query_cache_queries_tables; | ||
select `table_schema`,`table_name` from information_schema.query_cache_tables; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
--loose-query_cache_info | ||
--loose-query_cache_queries | ||
--loose-query_cache_queries_tables | ||
--loose-query_cache_tables | ||
--plugin-load-add=$QUERY_CACHE_INFO_SO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uncomment to use statistics