Which one is faster browsing or a subquery?

This question says it all. Which one is faster? And when should we use a view instead of a subquery and vice versa, when it comes to speed optimization?

I don't have a specific situation, but I was thinking about it while trying to try some things with views in mysql.

+5
source share
2 answers

MySQL is not particularly effective. In any case, MySQL does not cache the data in the views, so the view simply adds another step in the execution of the query. This makes browsing slower than subqueries. Check out this blog entry for more information http://www.mysqlperformanceblog.com/2007/08/12/mysql-view-as-performance-troublemaker/

One possible alternative (if you can deal with slightly outdated data) is materialized views. See Flexviews for more information and implementation.

+5
source

. , , - , , .

; . . . , , , . .

+5

All Articles