
You should always measure carefully if you’re trying to use views to improve perfor-
mance. Even MERGE views add overhead, and it’s hard to predict how a view will impact
performance. Views actually use a different execution path within the MySQL opti-
mizer, one that isn’t tested as widely and might still have bugs or problems. For that
reason, views don’t seem quite as mature as we’d like. For example, we’ve seen cases
where complex views under high concurrency caused the query optimizer to spend a
lot of time in the planning and statistics stages of the query, even causing server-wide
stalls, which we solved by replacing the view with the equivalent SQL. This indicates
that views—even those using the MERGE algorithm—don’t always have an optimal
implementation.