[Mondrian] CurrentDateMember udf

Rushan Chen rchen at lucidera.com
Tue Aug 28 18:59:50 EDT 2007


I am looking at a performance problem when using CurrentDateMember udf 
in a filter such as this("all dates before today"):

filter(targetDateTimeDim, currentMember < 
currentDateMember(sourceDateTimeDim, format, EXACT))

because currentDateMember does a lookup (via sql) to see if "today" 
exists in the sourceDateTimeDim, if targetDateTimeDim is large, this 
filter could take a very long time to finish. One solution is to use a 
CacheCalculator when evaluating currentdateMember udf. I will check in 
the change soon.

There's also a general question of whether udfs like this should be 
evaluated more than once during a MDX query, e.g when caching is 
disabled. Not caching, or,  when caching is disabled, calculating the 
expression more than once, could produce incorrect result, say when the 
query running time spans two days.

SQL2003 treats date functions in a SQL procedure as if they are 
evaluated at the same time(SQL/Foundation: 6.31).
Should Mondrian do the same for CurrentDateMember udf(similarly 
CurrentDateString)? Any thoughts?

Rushan




More information about the Mondrian mailing list