I want options to log some queries on the server side using the slow query log format. The initial options are: * statement sample rate -- sets percentage of queries to be logged, a value between 0 and 100 * transaction sample rate -- sets percentage of transactions to be logged, a value between 0 and 100. In this case all statements in the transaction are to be logged. This should also support the equivalent of --log-slow-extra from the Facebook patch or the Percona equivalent and log extra attributes into the slow query log. See http://www.facebook.com/note.php?note_id=390420710932 for some details on that. There are many interesting counters from SHOW SESSION STATUS that can be logged. The only problem is that those are per-connection not per-statement values. There are also interesting counters from the new code added for information_schema.{user_statistics, table_statistics} that can also be written as attributes (including innodb disk reads per query). Eventually this might need options to not log queries for some users, but I don't want to put that in the first version of this feature. The facebook patch has this code for "statement sample rate" but that change is trivial and for MariaDB using the audit plugin infrastructure and a new file (not the current slow query log) is likely to be a better choice. There is some useful code in the FB patch that provides more data that can be logged.
Category updated. --- /tmp/wklog.181.old.25544 2011-04-04 11:12:59.000000000 +0000 +++ /tmp/wklog.181.new.25544 2011-04-04 11:12:59.000000000 +0000 @@ -1,2 +1,2 @@ -WorkLog-RawIdeaBin +Server-RawIdeaBin
Version updated. --- /tmp/wklog.181.old.25544 2011-04-04 11:12:59.000000000 +0000 +++ /tmp/wklog.181.new.25544 2011-04-04 11:12:59.000000000 +0000 @@ -1,2 +1,2 @@ -WorkLog-4.0 +9.x
Observers changed: Sergei