[MDEV-4581] QUERY CACHE - ADD more columns in QC_INFO plugin Created: 2013-05-25 Updated: 2015-05-21 Resolved: 2014-10-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | roberto spadim | Assignee: | Sergei Golubchik |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | plugins, qc_info, querycache | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
new fields (flags) to qc_info plugin |
| Comments |
| Comment by roberto spadim [ 2013-05-26 ] |
|
now last version... and but, work is done, please close this mdev, and if possiblem, submit patch to review =) thanks! |
| Comment by roberto spadim [ 2013-05-26 ] |
|
ops, i done tab->space conversion, patch was a little big, ops |
| Comment by roberto spadim [ 2013-05-26 ] |
|
insert date information in unixtimestamp |
| Comment by roberto spadim [ 2013-05-26 ] |
|
mariadb 10.0.2 patch |
| Comment by roberto spadim [ 2013-05-26 ] |
|
sergei i don't know how to get the rows sent to user, on some select * from xxx order by xxx limit 1, the column "RESULT_FOUND_ROWS" sometimes return a very big number ?! |
| Comment by roberto spadim [ 2013-05-27 ] |
|
hummm found... mariadb 10.0.2 |
| Comment by roberto spadim [ 2013-05-28 ] |
|
add some more columns |
| Comment by roberto spadim [ 2013-05-28 ] |
|
SELECT first 60 minutes of query cache, give me a faster response now i know if qc is a good thing to me or not =] now i will focus on MDEV-4582, and |
| Comment by roberto spadim [ 2013-06-03 ] |
|
5.5 patch is a bit old, must change it like 10.0.2 |
| Comment by roberto spadim [ 2013-06-03 ] |
|
the query cache time, should be changed to: |
| Comment by roberto spadim [ 2013-06-05 ] |
|
end =) |
| Comment by roberto spadim [ 2013-06-05 ] |
|
i removed the 5.5 version since 10.0.2 is newer and i'm using it without big problems in production machines =) |
| Comment by roberto spadim [ 2013-06-09 ] |
|
could be release with 10.0.3? |
| Comment by roberto spadim [ 2013-06-11 ] |
|
well, after 10.0.3 i will rewrite the patch |
| Comment by roberto spadim [ 2013-06-12 ] |
|
mariadb 10.0.3 patch diff -u mariadb-original/sql/sql_cache.cc mariadb-10.0.3/sql/sql_cache.cc > diff_10_0_3_sql_cache.cc diff -u mariadb-original/sql/sql_cache.h mariadb-10.0.3/sql/sql_cache.h > diff_10_0_3_sql_cache.h diff -u mariadb-original/plugin/qc_info/qc_info.cc mariadb-10.0.3/plugin/qc_info/qc_info.cc > diff_10_0_3_qc_info.cc |
| Comment by roberto spadim [ 2013-06-13 ] |
|
i done a production use test with this patch and mariadb 10.0.3 (in production use too), and this mdev nice to be closed, could you (mariadb) test and close it? |
| Comment by roberto spadim [ 2013-06-17 ] |
|
at this line in qc_info patch: what ->table_types() means? it's something like MyISAM/ARIA/INNODB? |
| Comment by roberto spadim [ 2013-06-17 ] |
|
added table type to QUERY_CACHE_TABLES |
| Comment by roberto spadim [ 2013-06-17 ] |
|
found at handler.h /* Table caching type */ and at sql_cache.cc my doubt now is about query tables_type, and not table_type of table in ha_partition.cc |
| Comment by roberto spadim [ 2013-06-17 ] |
|
added tables_type, bug-overflow in max length with strncat |
| Comment by roberto spadim [ 2013-06-17 ] |
|
add mean period between hits with a outlier of 1 minute (QUERY_CACHE_QC_INFO_PERIOD_OUTLIER_US), it's better to see if a query is being hitted or not than hit counter and last hit time maybe in future add more granularity 10 seconds mean period, 30 seconds, 60 seconds, etc, example... but i didn't tested if it's memory intensive (i'm using longlong...) just a <60 period is nice for now (i think) 1)does feedback plugin, give some information about max query hits? or something about query cache (just global STATUS)? maybe this could be a nice source of information to chose right memory type for qc_info informations |
| Comment by roberto spadim [ 2013-06-17 ] |
|
hum... running 10 minutes in production server... maybe should consider: i'm seeing many queries that could be removed because the hit period is bigger than the expend time maybe when a query cache clean method could be developed (MDEV-4584 and MDEV-4583), we could consider a algorithm to remove queries with mean period between hits higher than expend time, and after others queries |
| Comment by Jean Weisbuch [ 2013-06-18 ] |
|
(It might be a little off-topic but i dont think that it would deserve a MDEV on its own and you already opened enough trasks on the QC, feel free to tell me if i did put that in the wrong one) Another idea would be to add a query cache settings (query_cache_type=3 for example) to only cache queries that involved filesort and non-indexed rows retreival. With these options, only long/expensive queries would be put in cache, it surely wouldnt solve the cache cleaning but it could limit the number of entries in the cache and ease the cleanup process. |
| Comment by roberto spadim [ 2013-06-18 ] |
|
nice jean, i think MDEV-4582 is the right place to put your comment and my one i will put it in MDEV-4583 to don't forget about it |
| Comment by roberto spadim [ 2013-06-18 ] |
|
well i think that's my last patch and we can close this MDEV changed the outlier... now use the expend time, and a outlier coefient (today = 10) and a minimal period time (today 1second) with this we can know if a hit is being executed very fast (lower than expend time), if it's a normal hit.. (higher than expend time) or if it's a sometimes hit (outlier). normal hit when removed from cache normally don't give a user impression of "hey the system is slow now" – more than this, i think, only with a query log to know if a query is being hitted or not, and when where why, etc... this is enought to know about query cache and start development of query cache control, prune and low mem procedures (check MDEV with 'querycache' label) sql_cache.h is nice documented (with comments) - i don't know how to change the functions of qc_info plugin inside .h file to .cc file, this help a lot when compiling, since a change in sql_cache.h change many files in compile time... sql_cache.cc have about 3 changes (start qc_info plugin information, save expend time, hit query) and some time variables (to get expend time) qc_info.cc should be better documented... but source code is enought for now... (i think) inside qc_info.cc: thanks, that's for now =] |
| Comment by roberto spadim [ 2013-06-18 ] |
|
using i think that _no_flags could be the default table, and a _with_flags could be a second table, i'm using query_cache_queries_no_flags more than with flags table change order of QUERY_HITS_PERIOD_OUTLIER after QUERY_HITS change order of RESULT_FOUND_ROWS after QUERY_ROWS maybe, change order of QUERY_HITS_TOTAL_TIME_US after QUERY_HITS_MEAN_PERIOD_HIGH_US, others users could help here saying, please put it here instead of here... |
| Comment by Sergei Golubchik [ 2013-06-19 ] |
|
Roberto, under what license did you provide these patches to us? |
| Comment by Sergei Golubchik [ 2013-06-19 ] |
|
Comments about the patch. Otherwise it was pretty much fine. Basically, I can apply your patch anytime, assuming you're ok with the above changes. |
| Comment by roberto spadim [ 2013-06-19 ] |
|
hi sergei, after your work done, could you send me something about what's wrong or not? i will rewrite the qc_info.cc to use only one function to fill table |
| Comment by roberto spadim [ 2013-06-19 ] |
|
>Sergei Golubchik added a comment - Today 07:46 >Comments about the patch. >2. Why do you want "ENTRY_POSITION_IN_CACHE" column? Why would it be useful to anyone? I'd rather remove it, if it's not useful for the user. >3. Detail, I don't particularly like "HA_CACHE_TBL_NONTRANSACT" etc strings in the user-visible output, I'll replace them with something less obscure. >4. I don't like the comma separated list of tables in the QUERY_CACHE_QUERIES table. Better to include some kind of the query id in both QUERIES and TABLES table (for example, ENTRY_POSITION_IN_CACHE of a query) and let the user join on that, if desired. >5. there's no need for a "NOFLAGS" version of the table, a user can select desired columns explicitly or create a view. >Otherwise it was pretty much fine. >Basically, I can apply your patch anytime, assuming you're ok with the above changes. thanks! |
| Comment by roberto spadim [ 2013-06-19 ] |
|
uncomplete qc_info.cc with #ifdef to add (or not) the stats/flags table |
| Comment by Sergei Golubchik [ 2013-06-19 ] |
|
Hi, Roberto! I don't understand what you mean by that. Right, but I mean, ENTRY_POSITION_IN_CACHE in the TABLES table. Yes, this is a fundamental issue, that will go away when we have an meanwhile one has to live with it, it's documented that different I_S anyway, the worse that can happen, when one joins QUERIES and TABLES yes. and SQL way of solving it is to specify desired columns explicitly. Eh, fine. If you haven't finished working on it, I'll wait. But when you say "please review", I assume that the code is final, and I So, now, I'll stop looking at this plugin and will wait until you're Regards, |
| Comment by roberto spadim [ 2013-06-19 ] |
|
>Hi, Roberto! >Yes, this is a fundamental issue, that will go away when we have an >anyway, the worse that can happen, when one joins QUERIES and TABLES the query_and_table is a table like: >yes. and SQL way of solving it is to specify desired columns explicitly. >Eh, fine. If you haven't finished working on it, I'll wait. >But when you say "please review", I assume that the code is final, and I >So, now, I'll stop looking at this plugin and will wait until you're >Regards, |
| Comment by roberto spadim [ 2013-06-19 ] |
|
About the sql_cache.h sql_cache.cc, should i open other MDEV? |
| Comment by roberto spadim [ 2013-06-19 ] |
|
created another mdev just for statistics |
| Comment by roberto spadim [ 2013-06-19 ] |
|
new fields (flags) to qc_info plugin |
| Comment by roberto spadim [ 2013-06-20 ] |
|
hi sergey, tell me what is better: it's easy to implement, but since last review, you told me to wait the review instead of changing code while you are working on it |
| Comment by Sergei Golubchik [ 2013-06-20 ] |
|
I'm not working on it now, I'm waiting. |
| Comment by roberto spadim [ 2013-06-20 ] |
|
ok, i will change it, and post again, after i contact you to review when possible |
| Comment by roberto spadim [ 2013-06-20 ] |
|
new table query/table |
| Comment by roberto spadim [ 2013-06-20 ] |
|
DONE! |
| Comment by roberto spadim [ 2013-06-21 ] |
|
what about partitioning? could i get the partitions used in some query cached? isn't of only the table? |
| Comment by roberto spadim [ 2013-07-15 ] |
|
hi sergey, the partition isn't implemented yet, i read the mysql/mariadb codes, no problem, maybe in a future we can implement... i have a doubt about the should i use another name? should i remove? any news please contact me, bye |
| Comment by roberto spadim [ 2013-08-09 ] |
|
Hi serg, any news about adding this patch to current branch? |
| Comment by roberto spadim [ 2013-08-16 ] |
|
hi Sergei, about this plugin, should i change something? other doubt, there's a manual or doc about creating unit tests for mariadb? |
| Comment by Sergei Golubchik [ 2013-08-18 ] |
|
unit tests — see unittest/ directory. |
| Comment by roberto spadim [ 2014-09-21 ] |
|
please close this mdev, everything is inside mdev-4682 |
| Comment by Daniel Black [ 2015-05-18 ] |
|
https://github.com/MariaDB/server/pull/67/files contains just the flags addition. |
| Comment by Daniel Black [ 2015-05-21 ] |
|
i assume by upping the priority you might look at this. If so opening the issue again is probably also required. |
| Comment by Sergei Golubchik [ 2015-05-21 ] |
|
I'll look at |