草庐IT

centstorage

全部标签

mysql - SQL请求优化

我有一个SQL请求在工作时占用了我100%的VMCPU。我想知道如何优化它:SELECTg.nameAShostgroup,h.nameAShostname,a.host_id,s.display_nameASservicename,a.service_id,a.entry_timeASack_time,(SELECTctimeFROMlogsWHERElogs.host_id=a.host_idANDlogs.service_id=a.service_idANDlogs.ctime问题出在这部分:(SELECTctimeFROMlogsWHERElogs.host_id=a.host