Why would you want to put an index on a view?

If the view is indexed then any queries that can be answered using the index only will never need to refer to the underlying tables. This can lead to an enormous improvement in performance.

Essentially, the database engine is maintaining a “solved” version of the query (or, rather, the index of the query) as you update the underlying tables, then using that solved version rather than the original tables when possible.

Here is a good article in Database Journal.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)