mysql - UNION ALL 的效率很差么?
大家讲道理
大家讲道理 2017-04-17 14:23:33
0
1
719

有3个结构类似的表(内容类型不一样),我想用 UNION ALL 做一个 TIMELINE(时间倒序排列),请问这个函数效率是否很差(以前用过一次,确实不理想,可能当时没有很好的利用索引)

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
迷茫

UNION ALL itself is not bad. What UNION ALL has to do is very simple, which is to merge multiple result sets, without involving operations or the like.

According to your needs, you need to sort by time after UNION ALL. . . Indeed, the index is no longer valid at this time.
If the amount of data is large, it should be very slow.

So, you should think about how much data this TIMELINE needs to display.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!