MySQL View is faster or not for querying from DB that containd 40 million data [closed]

家住魔仙堡 提交于 2019-12-04 22:09:49

Yes, It is possible to reduce query time using view because it have clustered index assigned and they'll store temporary result that can speed up resulting queries.

Well, the MySQL statement for creating a view is:

CREATE ALGORITHM = MERGE VIEW my_view AS
SELECT ...

Where the algorithm is one of MERGE, TEMPTABLE, or UNDEFINED.

However, as always the answer to how to increase performance is, "it depends". We really need more details on the table structure (columns and types), current indices, how often the table rows get updated, how often new rows get inserted, and what kind of data is stored in the table in order to make an educated guess on how to improve performance.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!