两表联合查询,加上排序后,效率就不高了,有没有好的优化方案
(select ctime,..... from `ni000_kline` where ctime>=1514466000 and ctime<1545980340)
UNION all
(select ctime,.....from `SR000_kline` where ctime>=1514466000 and ctime<1545980340)
order by ctime asc
需求是这样的,有两个表数据结构一直,存放的是期货不同品种的k线数据,现在需要把2018年内量表的数据都取出来写入文件,大家看看