mysql 中的视图和临时表有什么区别?哪个更好?

What is the difference between views and temporary tables in mysql? which is better?

mysql中的视图和临时表有什么区别?哪个更好?

View 和 Temporary 之间的性能 table 很简单。

它们取决于它们的定义:

临时 tables 只是 tempdb 中的 tables。 视图是对现有 table 中现有数据的存储查询。

临时table需要先填充数据,填充是主要的性能问题。

因此视图中的数据已经存在,因此视图比临时视图更快 table。

如果有任何问题或疑问,请告诉我。