Databases Reference
In-Depth Information
Scope Stack
SELECT measures.members on COLUMNS
from
(SELECT [measures]. [Unit Sales] on
COLUMNS FROM
[Warehouse and Sales])
Subcube Scope
Subcube Scope
Parent
Subcube Scope
Parent
SELE C T measures.members on COLUMNS
from [Warehouse and Sales])
Query Scope
Parent
Session Scope
Create Member measures.x as '1'
Parent
Global Scope
FIGURE 29.6 All these types of scope make up a stack, with global scope on the bottom and
subcube, query, or session scope on the top.
Global Scope and Global Scope Cache
Cube and dimension calculations defined in the metadata of the cube or dimensions are
accessible to all the users who have access to the cube or dimensions. Therefore, Analysis
Services tries not to reevaluate expressions for calculations during every MDX query;
instead, it creates a cache and stores Scope objects in it. However, evaluation of calcula-
tions depends on the security permissions of the user who executes the query. If this user
doesn't have access to certain dimension members, he cannot access those members from
an MDX script or dimension calculation. (For more information about dimension security,
see Chapter 36, “Securing Dimension Data.”) Therefore, Analysis Services caches the global
scopes per combination of security roles to which the current user belongs, or even per
user if any of the calculations stored in the scope use dynamic security. (Dynamic security
is also discussed in Chapter 36.)
The global scope cache is a hash table integrated with Memory Manager. (It can be
unloaded from memory if the Memory Manager detects that the system is low on
resources.) The key to this hash table is a string that contains names of the roles to which
the current user belongs. If at least one of the calculation objects uses the UserName func-
tion or the client-passed EffectiveUserName connection string property, Analysis Services
Search WWH ::




Custom Search