mysql外左连接查询太慢了

时间:2016-01-25 07:26:34

标签: mysql join outer-join

为了只显示最后一条消息(table:messages),我在表calderone(lot是关键字段)和messaggi(lot,ope_nr是关键字段)上使用正确但缓慢的查询。

SELECT *
FROM calderone s1
Left outer JOIN (
  SELECT lot,ope_nr,messaggio, MAX(datamex)
  FROM messaggi s2
  GROUP BY lot,ope_nr ) as s3
using (lot,ope_nr)

有没有办法加快查询速度?

0 个答案:

没有答案