A slow query log that samples fast queries too

Registered by Laurynas Biveinis

Superseded by https://blueprints.launchpad.net/percona-server/+spec/rate-limit-to-slow-log

Currently it is impossible to have the following slow logging setup:
a) log all slow queries, that is, taking more than lonq_query_time to execute;
b) additionally, log a random sample of fast queries, that is taking less than long_query_time to execute;
c) each logged query would be annotated to indicate whether it was logged as slow or fast query, e.g. "# logged as sampling 1/100 queries", "# logged as sampling 1/100 queries".

This blueprint is for implementation of such setup. The resulting slow query log in this configuration would be helpful at once in showing both 1) slow queries that need attention; and 2) overall workload on the server.

This feature would be controlled by a new variable log_slow_sample_fast_rate, unsigned integer, that specifies logging of every nth query. The default would be zero, which means no logging.

Interaction with other slow query log options:

log_slow_admin_statements, log_slow_filter, log_slow_statements, log_slow_rate_limit, log_slow_sp_statements, min_examined_row_limit, and log_queries_not_using_indexes would apply only to queries logged as a).
log_slow_timestamp_every and log_slow_verbosity would apply to both a) and b).
use_global_log_slow_control and use_global_long_query_time would work as they do currently.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Not
Drafter:
Laurynas Biveinis
Direction:
Needs approval
Assignee:
None
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Laurynas Biveinis

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.