为了只显示最后一条消息(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)
有没有办法加快查询速度?