Filter the condition and then establish the index of the related query field in the table in the same time. So it's pretty fast in the case of Big Data multi-table federated queries.
SELECTM.*, SS. Sensorcode,ss. Sensorstatus,ss. Manufacturerid,ss. Electricity,ss. Voltage,ss. Minelectricity,ss. Minvoltage,ss. Temperature,ss. Statusupdtedate,ss. UpdateStatus, TP. Pricingstrategyid,tps. Freeduration,bat. Berthtypeid from(SELECTT.*, BS. Parkstatus,bs. Changetime, CA. Cantonname, SE. SectionName from(SELECTA.*, B.berthid,b.berthcode,b.berthaddress,b.berthstatus,b.linedirection,b.cantonid,b.sectionid from (SELECTAr. Areaid,ar. Areacode,ar. AreaName fromSys_area asArWHERE 1=1 andAr. AreaCode=' the') A Left JOINSys_berth asB onB.areaid=A.areaid) TJOINSys_berthstatus asBs onT.berthcode=BS. BerthcodeJOINSys_canton asCa onT.cantonid=CA. CantonidJOINSys_section asSE onT.sectionid=SE. SectionID) M Left JOINSys_sensor SS onM.berthcode=SS. Berthcode Left JOINTra_pricingberth asTp onTp. Berthcode=M.berthcode Left JOINTra_pricingstrategy asTps onTps. Pricingstrategyid=TP. Pricingstrategyid Left JOINSys_berthandtype asBat onBat. Berthcode=M.berthcodeORDER byBerthcodeASC
MySql left JOIN multi-table join query optimization statement