I was thinking of starting to use views to reduce the complexity of the code and queries in our project - some of them have several unions, and from what I understand, MySQL views will allow us to simplify the link to this data a little in several places.
There are many different things where "MySQL does not use indexes for views", "You cannot have an indexed view", "Only if you use MERGE" ... There is no clear cut out answer.
So, to abort the chase: Do MySQL views use indexes for the tables from which they are built? Is it good to use views at all because performance will be terrible or will it use indexes on base tables when performing its joins? If I sort the view by the column indexed in the table, will it still sort as fast as usual?
My research seems to indicate that views do not use indexes, but if so, no one has ever used them; obviously people do it, so ...?
Sorry if this seems absurd.
mysql view
Xkeeper Oct 27 '11 at 9:31 on 2011-10-27 21:31
source share