MDX - NON EMPTY function faster?

浪尽此生 提交于 2019-12-11 02:53:05

问题


I was under the assumption that NON EMPTY clause must be avoided whenever possible. So, I was in for a shock when I accidentally found that it actually made the query much faster!

Sample this:

select 
[Measures].[Count Of Requests] on 0,
([Client].[Client Number].children , [Date].[Year].children) on 1
from [MyCube]

--19 seconds on a hot cache

select 
[Measures].[Count Of Requests] on 0,
non empty ([Client].[Client Number].children , [Date].[Year].children) on 1
from [MyCube]

--5 seconds on a cold cache(Consistently)

Isn't NON EMPTY recursive? Is it because of local cache size?


回答1:


I was under the impression thatNON EMPTY is applied at the very end of the script's process. See previous question/answer here: Logical order an MDX query is processed

So effectively everything is returned and then before rendering results to grid or client application the NON EMPTY instruction means that null tuples on either rows or columns are discarded.

If your first script is returning a lot of data then does it take the extra time for the render process to complete?

Another interesting article re. NON EMPTY is here: http://www.bidn.com/blogs/DustinRyan/bidn-blog/2996/non-empty-vs-nonempty-to-the-death



来源:https://stackoverflow.com/questions/27107370/mdx-non-empty-function-faster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!