index_subquery – the same as unique_subquery but returns more than one result row.unique_subquery – an IN subquery returns only one result from the table and makes use of the primary key.The key column of EXPLAIN‘s output will contain the keys used. index_merge – the join uses a list of indexes to produce the result set.ref_or_null – this is the same as ref but also contains rows with a null value for the column.fulltext – the join uses the table’s FULLTEXT index.This type of join appears for indexed columns compared using = or operators. ref – all of the matching rows of an indexed column are read for each combination of rows from the previous table.This is the next best possible join type. eq_ref – all parts of an index are used by the join and the index is PRIMARY KEY or UNIQUE NOT NULL.This is the fastest type of join because the table only has to be read once and the column’s value can be treated as a constant when joining other tables. const – the table has only one matching row which is indexed.system – the table has only zero or one row.This is one of the most insightful fields in the output because it can indicate missing indexes or how the query is written should be reconsidered. type – how MySQL joins the tables used.table – the table referred to by the row.UNION RESULT – the SELECT is a result of a UNION.DEPENDENT UNION – the second or later SELECT of a UNION is dependent on an outer query.UNION – the SELECT is the second or later statement of a UNION.UNCACHEABLE SUBQUERY – a subquery which is not cacheable (there are certain conditions for a query to be cacheable).DEPENDENT SUBQUERY – a subquery which is dependent upon on outer query.SUBQUERY – the first SELECT in a subquery. ![]() DERIVED – the SELECT is part of a subquery within a FROM clause.PRIMARY – the SELECT is in the outermost query in a JOIN.SIMPLE – the query is a simple SELECT query without any subqueries or UNIONs.select_type – the type of SELECT query.id – a sequential identifier for each SELECT within the query (for when you have nested subqueries).It may not seem like it, but there’s a lot of information packed into those 10 columns! The columns returned by the query are: Let’s analyze the output of a simple query to familiarize yourself with the columns returned by the command. Using EXPLAIN is as simple as pre-pending it before the SELECT queries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |