MySQL,是全局视图还是每个会话/连接?

时间:2011-01-20 12:52:28

标签: mysql sql-view

我正在考虑创建一个VIEW以加快速度,我的问题是:每个会话/连接是VIEWS还是全局?

示例:

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和用户栏是否使用相同的VIEW X,还是每个都有“私人”VIEW X?

1 个答案:

答案 0 :(得分:1)

它们是在数据库中创建的,不受会话限制。如果视图对于不同的会话实际上是相同的,您可以使用我认为的CREATE OR REPLACE VIEW。