Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code DEF204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.

Rechercher dans le manuel MySQL

8.8.3 Extended EXPLAIN Output Format

The EXPLAIN statement produces extra (extended) information that is not part of EXPLAIN output but can be viewed by issuing a SHOW WARNINGS statement following EXPLAIN. As of MySQL 8.0.12, extended information is available for SELECT, DELETE, INSERT, REPLACE, and UPDATE statements. Prior to 8.0.12, extended information is available only for SELECT statements.

The Message value in SHOW WARNINGS output displays how the optimizer qualifies table and column names in the SELECT statement, what the SELECT looks like after the application of rewriting and optimization rules, and possibly other notes about the optimization process.

The extended information displayable with a SHOW WARNINGS statement following EXPLAIN is produced only for SELECT statements. SHOW WARNINGS displays an empty result for other explainable statements (DELETE, INSERT, REPLACE, and UPDATE).

Here is an example of extended EXPLAIN output:

  1. mysql> EXPLAIN
  2.        SELECT t1.a, t1.a IN (SELECT t2.a FROM t2) FROM t1\G
  3. *************************** 1. row ***************************
  4.            id: 1
  5.   select_type: PRIMARY
  6.         table: t1
  7.          type: index
  8. possible_keys: NULL
  9.           key: PRIMARY
  10.       key_len: 4
  11.           ref: NULL
  12.          rows: 4
  13.      filtered: 100.00
  14.         Extra: Using index
  15. *************************** 2. row ***************************
  16.            id: 2
  17.   select_type: SUBQUERY
  18.         table: t2
  19.          type: index
  20. possible_keys: a
  21.           key: a
  22.       key_len: 5
  23.           ref: NULL
  24.          rows: 3
  25.      filtered: 100.00
  26.         Extra: Using index
  27. 2 rows in set, 1 warning (0.00 sec)
  28.  
  29. mysql> SHOW WARNINGS\G
  30. *************************** 1. row ***************************
  31.   Level: Note
  32.    Code: 1003
  33. Message: /* select#1 */ select `test`.`t1`.`a` AS `a`,
  34.          <in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in
  35.          ( <materialize> (/* select#2 */ select `test`.`t2`.`a`
  36.          from `test`.`t2` where 1 having 1 ),
  37.          <primary_index_lookup>(`test`.`t1`.`a` in
  38.          <temporary table> on <auto_key>
  39.          where ((`test`.`t1`.`a` = `materialized-subquery`.`a`))))) AS `t1.a
  40.         IN (SELECT t2.a FROM t2)` from `test`.`t1`
  41. 1 row in set (0.00 sec)

Because the statement displayed by SHOW WARNINGS may contain special markers to provide information about query rewriting or optimizer actions, the statement is not necessarily valid SQL and is not intended to be executed. The output may also include rows with Message values that provide additional non-SQL explanatory notes about actions taken by the optimizer.

The following list describes special markers that can appear in the extended output displayed by SHOW WARNINGS:

  • <auto_key>

    An automatically generated key for a temporary table.

  • <cache>(expr)

    The expression (such as a scalar subquery) is executed once and the resulting value is saved in memory for later use. For results consisting of multiple values, a temporary table may be created and you will see <temporary table> instead.

  • <exists>(query fragment)

    The subquery predicate is converted to an EXISTS predicate and the subquery is transformed so that it can be used together with the EXISTS predicate.

  • <in_optimizer>(query fragment)

    This is an internal optimizer object with no user significance.

  • <index_lookup>(query fragment)

    The query fragment is processed using an index lookup to find qualifying rows.

  • <if>(condition, expr1, expr2)

    If the condition is true, evaluate to expr1, otherwise expr2.

  • <is_not_null_test>(expr)

    A test to verify that the expression does not evaluate to NULL.

  • <materialize>(query fragment)

    Subquery materialization is used.

  • `materialized-subquery`.col_name

    A reference to the column col_name in an internal temporary table materialized to hold the result from evaluating a subquery.

  • <primary_index_lookup>(query fragment)

    The query fragment is processed using a primary key lookup to find qualifying rows.

  • <ref_null_helper>(expr)

    This is an internal optimizer object with no user significance.

  • /* select#N */ select_stmt

    The SELECT is associated with the row in non-extended EXPLAIN output that has an id value of N.

  • outer_tables semi join (inner_tables)

    A semijoin operation. inner_tables shows the tables that were not pulled out. See Section 8.2.2.1, “Optimizing IN and EXISTS Subquery predicates with Semijoin Transformations”.

  • <temporary table>

    This represents an internal temporary table created to cache an intermediate result.

When some tables are of const or system type, expressions involving columns from these tables are evaluated early by the optimizer and are not part of the displayed statement. However, with FORMAT=JSON, some const table accesses are displayed as a ref access that uses a const value.


Suchen Sie im MySQL-Handbuch

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-explain-extended.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:en Manuel MySQL : https://dev.mysql.com/

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut