Mysql VIEWS vs. PHP query

前端 未结 5 1082
温柔的废话
温柔的废话 2021-02-12 11:16

I am working on a web application which involves create list of Restaurants in various lists like \"Joe\'s must visit places\". Now for each Restaurant and list, I have display

5条回答
  •  天命终不由人
    2021-02-12 11:58

    The original question was about pros and cons, but not seeing much about disadvantages in the answers so far.

    Isn't one disadvantage of views that they can give you the false comfort of running a simple query? For instance, SELECT username FROM myview WHERE id='1' That looks simple, but what if "myview" is a really complex SELECT... Perhaps even built on other views? You end up having a simple-looking query that, in the background, takes a whole lot more work than if you had written your query from the ground up.

    I've been experimenting with views, and despite the benefits, have not yet been fully sold. I'd be interested in hearing what others perceive about the disadvantages of Views, rather than just the party line about why views are so great. Might still make the switch, but would like to understand more about performance.

提交回复
热议问题