WorkLog Frontpage Log in / Register
High-Level Description | Task Dependencies | High-Level Specification | Low-Level Design | File Attachments | User Comments | Time Estimates | Funding and Votes | Progress Reports

 information_schema.query_statistics
Title
Task ID179
Queue
Version N/A
Status
PriorityN/A
Copies toSergei

Created byMdcallag13 Mar 2011Done
Supervisor N/A  
Lead Architect    
Architecture Review  
Implementor  
Code Review  
QA  
Documentation  
 High-Level Description
Add IS.query_statistics to summarize resource metrics by query text. The key for 
the table might be either the original query text or the canonical form of the 
query text where canonical includes some/all of strip query text, remove extra 
white space, replace literals with #. For me canonical means that all of the 
above must be done. This can then reuse the same counters kept for 
IS.user_statistics -- at query end read from them for this table and for 
user_statistics.

It also might be useful to:
* have an option to sample queries for this rather than take all
* not include queries from some accounts for this table (security)
* limit max size of query text

IS.user_statistics from the Facebook patch has metrics I am interested in. 
Current definition for it is listed below, but some of those columns are invalid 
in this context (COMMANDS_DDL, etc).

USER_STATISTICS CREATE TEMPORARY TABLE `USER_STATISTICS` (
  `USER_NAME` varchar(192) NOT NULL DEFAULT '',
  `BINLOG_BYTES_WRITTEN` bigint(21) NOT NULL DEFAULT '0',
  `BYTES_RECEIVED` bigint(21) NOT NULL DEFAULT '0',
  `BYTES_SENT` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_DDL` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_DELETE` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_HANDLER` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_INSERT` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_OTHER` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_SELECT` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_TRANSACTION` bigint(21) NOT NULL DEFAULT '0',
  `COMMANDS_UPDATE` bigint(21) NOT NULL DEFAULT '0',
  `CONNECTIONS_CONCURRENT` int(11) NOT NULL DEFAULT '0',
  `CONNECTIONS_DENIED_MAX_GLOBAL` bigint(21) NOT NULL DEFAULT '0',
  `CONNECTIONS_DENIED_MAX_USER` bigint(21) NOT NULL DEFAULT '0',
  `CONNECTIONS_LOST` bigint(21) NOT NULL DEFAULT '0',
  `CONNECTIONS_TOTAL` bigint(21) NOT NULL DEFAULT '0',
  `DISK_READ_BYTES` bigint(21) NOT NULL DEFAULT '0',
  `DISK_READ_REQUESTS` bigint(21) NOT NULL DEFAULT '0',
  `DISK_READ_SVC_USECS` bigint(21) NOT NULL DEFAULT '0',
  `DISK_READ_WAIT_USECS` bigint(21) NOT NULL DEFAULT '0',
  `ERRORS_ACCESS_DENIED` bigint(21) NOT NULL DEFAULT '0',
  `ERRORS_TOTAL` bigint(21) NOT NULL DEFAULT '0',
  `MICROSECONDS_CPU` bigint(21) NOT NULL DEFAULT '0',
  `MICROSECONDS_WALL` bigint(21) NOT NULL DEFAULT '0',
  `QUERIES_EMPTY` bigint(21) NOT NULL DEFAULT '0',
  `RECORDS_IN_RANGE_CALLS` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_DELETED` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_FETCHED` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_INSERTED` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_READ` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_UPDATED` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_INDEX_FIRST` bigint(21) NOT NULL DEFAULT '0',
  `ROWS_INDEX_NEXT` bigint(21) NOT NULL DEFAULT '0',
  `TRANSACTIONS_COMMIT` bigint(21) NOT NULL DEFAULT '0',
  `TRANSACTIONS_ROLLBACK` bigint(21) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
 Task Dependencies
Others waiting for Task 179Task 179 is waiting forGraph
 
 High-Level Specification
 Low-Level Design
 File Attachments
 NameTypeSizeByDate
 User Comments
 Time Estimates
NameHours WorkedLast Updated
Total0 
 Hrs WorkedProgressCurrentOriginal
Total000
 
 Funding and Votes
Votes: 0: 0%
 Make vote: Useless    Nice to have    Important    Very important    

Funding: 0 offers, total 0 Euro
 Progress Reports
(Sergei - Mon, 04 Apr 2011, 11:12
    
Category updated.
--- /tmp/wklog.179.old.25533	2011-04-04 11:12:50.000000000 +0000
+++ /tmp/wklog.179.new.25533	2011-04-04 11:12:50.000000000 +0000
@@ -1,2 +1,2 @@
-WorkLog-RawIdeaBin
+Server-RawIdeaBin
 

(Sergei - Mon, 04 Apr 2011, 11:12
    
Version updated.
--- /tmp/wklog.179.old.25533	2011-04-04 11:12:50.000000000 +0000
+++ /tmp/wklog.179.new.25533	2011-04-04 11:12:50.000000000 +0000
@@ -1,2 +1,2 @@
-WorkLog-4.0
+9.x
 

(Sergei - Tue, 22 Mar 2011, 14:18
    
Observers changed: Sergei


Report Generator:
 
Saved Reports:

WorkLog v4.0.0
  © 2010  Sergei Golubchik and Monty Program AB
  © 2004  Andrew Sweger <yDNA@perlocity.org> and Addnorya
  © 2003  Matt Wagner <matt@mysql.com> and MySQL AB