← Back to team overview

maria-developers team mailing list archive

Re: Query cache information plugin - MDEV-4516

 

sorry wrong files
now diff files =)


2013/5/25 Roberto Spadim <roberto@xxxxxxxxxxxxx>

> sergei, there's a public contribuition system like github for mariadb?
>
> i put more information to query cache:
> query_hits (per query)
> rows_read (todo)
> expend_time  (todo)
>
> attached patchs
> diff -u maria_db_5.5.31_original_file.xx my_changed_file.xx
>
> todo work:
>   get rows_read from query and put this information in qc
>   get expend_time running query and put this information in qc
>
>
>
>
> 2013/5/25 Roberto Spadim <roberto@xxxxxxxxxxxxx>
>
>> ops... please change ´ with  `
>> attached again
>>
>> thanks guy!! :D
>>
>>
>> 2013/5/25 Roberto Spadim <roberto@xxxxxxxxxxxxx>
>>
>>> hi sergei =D work done :D
>>> i put a last diff with tables used by the query
>>> i used a char[] since i don't know how to use string or others function
>>> in c :)
>>>
>>> now query cache information is very very nice and beautiful =D
>>> i'm putting code here too
>>>
>>> it's mariadb 5.5.31
>>>
>>
>>
>>
>> --
>> Roberto Spadim
>> SPAEmpresarial
>>
>
>
>
> --
> Roberto Spadim
> SPAEmpresarial
>



-- 
Roberto Spadim
SPAEmpresarial

Attachment: diff_qc_info.cc
Description: Binary data

Attachment: diff_sql_cache.cc
Description: Binary data

--- sql_cache.old.h	2013-05-25 16:45:40.080882118 -0300
+++ sql_cache.h	2013-05-25 17:35:57.367895671 -0300
@@ -158,10 +158,19 @@
   ulong len;
   uint8 tbls_type;
   unsigned int last_pkt_nr;
+  ulonglong query_hits_counter;
+  ulonglong select_expend_time;		/* TODO: time expend to execute de SELECT query, 
+						 change the variable to the right type         */
+  ulonglong select_rows_read;		/*       how many rows read from disk in SELECT query  */
+  
 
   Query_cache_query() {}                      /* Remove gcc warning */
   inline void init_n_lock();
   void unlock_n_destroy();
+  inline ulonglong query_expend_time()		   { return select_expend_time; }
+  inline ulonglong query_rows_read()		   { return select_rows_read; }
+  inline ulonglong query_hits()		   { return query_hits_counter; }
+  inline void query_hits_add()             { query_hits_counter+=1; }
   inline ulonglong found_rows()		   { return limit_found_rows; }
   inline void found_rows(ulonglong rows)   { limit_found_rows= rows; }
   inline Query_cache_block *result()	   { return res; }

References