MySQL,视图是全局视图还是每个会话/连接?
我正在考虑创建一个视图来加快速度,我的问题是:视图是每个会话/连接的还是全局的?
示例:
User Foo issues a query that creates a VIEW X, then user Foo continues to query
against VIEW X.
Meanwhile, User Bar issues the same query that creates a VIEW X because the creation and the name is hard coded into the function issuing the query.
现在,用户 Foo 和用户 Bar 是否使用相同的 VIEW X 或者它们各自拥有“私有”VIEW X?
I'm thinking of creating a VIEW to speed up things and my question is: Are VIEWS per session/connection or global?
Example:
User Foo issues a query that creates a VIEW X, then user Foo continues to query
against VIEW X.
Meanwhile, User Bar issues the same query that creates a VIEW X because the creation and the name is hard coded into the function issuing the query.
Now, does user Foo and user Bar work with the same VIEW X or do they have "private" VIEW X each?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们是在数据库中创建的,不受会话限制。如果不同会话的视图实际上是相同的,我认为您可以使用 CREATE OR REPLACE VIEW 。
They're created in the database and are not session bound. If the view actually is the same for the different sessions, you can just use CREATE OR REPLACE VIEW I think.