s example slightly

ANALYZE SELECT * 
FROM orders, customer 
WHERE
 customer.c_custkey=orders.o_custkey AND
 customer.c_acctbal < -0 AND
 customer.c_comment LIKE '%foo%' AND
 orders.o_totalprice > 200*1000;

+----+-------------+----------+------+---------------+-------------+---------+-
------------------+--------+--------+----------+------------+-------------+
| id | select_type | table    | type | possible_keys | key         | key_len |
ref                | rows   | r_rows | filtered | r_filtered | Extra       |
+----+-------------+----------+------+---------------+-------------+---------+-
------------------+--------+--------+----------+------------+-------------+
|  1 | SIMPLE      | customer | ALL  | PRIMARY,...   | NULL        | NULL    |
NULL               | 149095 | 150000 |    18.08 |       0.00 | Using where |
|  1 | SIMPLE      | orders   | ref  | i_o_custkey   | i_o_custkey | 5       |
customer.c_custkey |      7 |   NULL |   100.00 |       NULL | Using where |
+----+-------------+----------+------+---------------+-------------+---------+-
------------------+--------+--------+----------+------------+-------------+

Here, one can see that orders.r_rows=NULL and orders.r_filtered=NULL. This
means that table orders was not scanned even once. Indeed, we can also see
customer.r_filtered=0.00. This shows that a part of WHERE attached to table
`customer` was never satisfied (or, satisfied in less than 0.01% of cases).

ANALYZE FORMAT=JSON
-------------------

ANALYZE FORMAT=JSON produces JSON output. It produces much more information
than tabular ANALYZE.

Notes
-----

* ANALYZE UPDATE or ANALYZE DELETE will actually make updates/deletes (ANALYZE
SELECT will perform the select operation and then discard the resultset).
* PostgreSQL has a similar command, EXPLAIN ANALYZE.
* The EXPLAIN in the slow query log feature allows MariaDB to have ANALYZE
output of slow queries printed into the slow query log (see MDEV-6388).

URL: https://mariadb.com/kb/en/analyze-statement/https://mariadb.com/kb/en/analyze-statement/