Home > Backend Development > PHP Tutorial > union all效率低下,该用存储过程、视图、临时表哪种方法来解决?该如何解决

union all效率低下,该用存储过程、视图、临时表哪种方法来解决?该如何解决

WBOY
Release: 2016-06-13 11:19:59
Original
1372 people have browsed it

union all效率低下,该用存储过程、视图、临时表哪种方法来解决?
union all效率低下,大概union all数十张表,单表select仅需0.0003-0.002秒,但union all后需要0.6秒左右
想改善下效率

这种情况该用存储过程、视图、临时表哪种方法来解决?


------解决方案--------------------
数据量有多大啊?要达到分表的情况下了。分表的话,这种水平分也不合理吧。
------解决方案--------------------
union all 之后还做了order之类? 要不不该差这么大啊
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template