这个是DZX3的附件列表,这个SQL的表流程是,先获取板块ID,然后根据返回的帖子数来去DZ的十张附件表里,把所有的AID查询出来,我是这样写SQL语句的
select * from
(select * from pre_forum_attachment_0
union all
select * from pre_forum_attachment_1
union all
select * from pre_forum_attachment_2
union all
select * from pre_forum_attachment_3
union all
select * from pre_forum_attachment_4
union all
select * from pre_forum_attachment_5
union all
select * from pre_forum_attachment_6
union all
select * from pre_forum_attachment_7
union all
select * from pre_forum_attachment_8
union all
select * from pre_forum_attachment_9
) tb
where
aid in(select aid from pre_forum_attachment where tid IN (SELECT tid FROM `pre_forum_thread` WHERE ( fid='36' )))
我想请问怎么优化称THINKPHP支持的最快查询方式?