[MDEV-6388] ANALYZE $stmt output in the slow query log Created: 2014-06-25  Updated: 2014-10-17  Resolved: 2014-10-17

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: 10.1.1

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: analyze-stmt

Issue Links:
Relates
relates to MDEV-406 ANALYZE $stmt Closed
relates to MDEV-407 Print EXPLAIN [ANALYZE] in the slow q... Closed
relates to MDEV-6382 ANALYZE $stmt and security Closed

 Description   

MDEV-406 allows to execute a statement, and collect data for ANALYZE output. This task is about having ANALYZE printed in the slow query log, like originally envisioned in MDEV-407 (MDEV-407 only implemented EXPLAIN in the slow query log).

User interface question: MDEV-407 introduced a switch:

log-slow-verbosity=explain

Should we keep the option name just print tabular ANALYZE output instead of tabular EXPLAIN output?
Or, introduce another flag:

log-slow-verbosity=analyze

?

What if the user specifies both explain and analyze? Should we print both or just print analyze (since it is a superset of explain output)? Is it acceptable to always print analyze output?

There is the same question for formatting the log. 10.0 shows EXPLAIN outputs in slow query log like this:

# explain: id   select_type     table   type    possible_keys   key     key_len ref     rows    Extra
# explain: 1    SIMPLE  nation  ref     PRIMARY,n_name  n_name  26      const   1       Using where; Using index
# explain: 1    SIMPLE  customer        ref     PRIMARY,i_c_nationkey   i_c_nationkey   5       dbt3sf1.nation.n_nationkey      3145    Using index
# explain: 1    SIMPLE  orders  ref     i_o_custkey     i_o_custkey     5       dbt3sf1.customer.c_custkey      7       Using index

Should we keep "explain:" or introduce "analyze:" ?



 Comments   
Comment by Sergei Petrunia [ 2014-10-17 ]

Pushed a patch that makes log_slow_verbosity always produce ANALYZE output (that is, EXPLAIN output with extra columns).

Generated at Thu Feb 08 07:11:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.