草庐IT

createdTS

全部标签

mysql - 需要优化 MySQL 查询

我有一个需要33秒的查询是否有更好的方法来重写它,我怎样才能将它转换为过程selectut.templateId,(casewhenut.reportTypeId=4then'Account'whenut.reportTypeId=5then'Campaign'whenut.reportTypeId=6then'AdGroup'whenut.reportTypeId=7then'Ad'whenut.reportTypeId=8then'Keyword'end)asReportType,ur.reportId,(casewhentimestampdiff(SECOND,b.created