Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
278 views
in Technique[技术] by (71.8m points)

ssas - Logical order an MDX query is processed

What is the order of evaluation of the clauses within an MDX script?

WITH 
  MEMBER measures.A AS ...
  MEMBER measures.B AS ...
  SET S1 AS ...
SELECT 
  {
    measures.A
   ,measures.B
   ,measures.x
  } ON COLUMNS
  {S1} HAVING <condition> on ROWS
FROM [Cube]
WHERE ({S2})
  1. FROM
  2. WHERE
  3. WITH
  4. SELECT
  5. HAVING

?

But maybe not that simple as a MEMBER and a SET are dealt with differently in terms of context - so if this order is correct how does context tie in?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I would say:

  1. FROM (including potential subselects)
  2. WHERE
  3. SETs and MEMBER location in the WITH clause
  4. Build the list of tuples for all query axes (columns, rows, ...) in parallel, ignoring NON EMPTY and HAVING
  5. Cell values for all axis intersections
  6. Remove tuples from the axes as requested by NON EMPTY and HAVING for each axis.

By "member location" in step 3, I mean the information that the member exists at all, and in which hierarchy and possibly under which parent it is located in the hierarchy. This does not involve the member definition expression. That will be evaluated in step 5 and 6. But the location is needed for step 4.

The parallel evaluation of the axes means that there is no relation between axes in the query processing.

Also note that this is the conceptual view. Physically, step 6 may happen during the processing of step 4, or whatever the optimizer decides is a proper execution order, as long as the result would be the same.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...