Home >Backend Development >PHP Tutorial >MySQL Manual Version 5.0.20-MySQL Optimization (2) (1) (4)_PHP Tutorial

MySQL Manual Version 5.0.20-MySQL Optimization (2) (1) (4)_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:03:16853browse



The following example shows how to use the information provided by EXPLAIN to maximize the performance of multi-table joint queries.


Suppose you have the following SELECT statement and are planning to use EXPLAIN to detect it:


EXPLAIN SELECT tt.TicketNumber, tt.TimeIn,

tt.ProjectReference, tt.EstimatedShipDate,

tt.ActualShipDate, tt.ClientID,

tt.ServiceCodes, tt.RepetitiveID,

tt.CurrentProcess, tt.CurrentDPPerson,

tt.RecordVolume, tt.DPPrinted, et.COUNTRY,

et_1.COUNTRY, do.CUSTNAME

FROM tt, et, et AS et_1, do

WHERE tt.SubmitTime IS NULL

AND tt.ActualPC = et.EMPLOYID

AND tt.AssignedPC = et_1.EMPLOYID

AND tt. ClientID = do.CUSTNMBR;

In this example, first make the following assumptions:


The fields to be compared are defined as follows:

(t114)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630970.htmlTechArticleThe following example shows how to use the information provided by EXPLAIN to maximize the performance of multi-table joint queries. Suppose you have the following SELECT statement and are planning to use EXPLAIN to detect it: ...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn