寻求帮助--优化SQL
select /* 70674:200 */
m.id,
substr(m.flags, 2, 1) deleted_flag,
substr(m.flags, 1, 1) read_flag,
p.id mail_to_userid,
m.subject subject,
substr(m.flags, 1, 1) read,
m.received_on received_on,
m.message_body message_desc,
substr(m.flags, 2, 1) deleted
from fgt_mail_header m
inner join cmt_person p on m.mail_to = p.id
inner join fgt_ext_notify_event e on m.event_id = e.id
inner join fgt_memo_mail_body b on m.id = b.owner_id
where m.id = m.id
and p.locale_id = e.locale_id
and m.mail_to = lower(:1)
and substr(m.flags, 2, 1) = :2
ORDER BY 6, 7 desc
cmt_person有50万条记录,fgt_mail_header有16万条记录,执行时间为620毫秒; 希望能有优化的方法,请大俠指点优化方法。