Home >Backend Development >PHP Tutorial >MySQL Manual Version 5.0.20-MySQL Optimization (2) (1) (4)_PHP Tutorial
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)