Amir Samary · Dec 14, 2015

%DeepSee.ResultSet taking forever to run an MDX that Analyzer executes fast

I am working on a project and I am facing a weird problem. I have created an MDX using Analyzer. This MDX executes very fast. I am trying to automate its execution with %DeepSee.ResultSet and the query never returns:

Set tSC = oMDX.%PrepareMDX(tMDX)

Set tSC = oMDX.%Execute()

What could be causing %Execute() to take so long to run while Analyzer is responding fast?

I can see that the process that is executing the %Execute() method is on HANGW state. I am assuming that it is waiting for another process. I have realized there are no DeepSee agents processes up. I started some and saw no changes. Does %Execute() use agents?

I have also found that %DeepSee.ResultSet has a method called %ExecuteAsynch(pQueryKey, pParms, pWait) that, accordingly to the method’s documentation, will use agents to execute the query. Tomorrow, I will try to use this instead of %Execute() to see if anything changes.

How do you suggest me to debug this? What are the typical things that could be wrong to get this behaviour?

Kind regards,

0 270
Discussion (2)2
Log in or sign up to continue

You should use %ExecuteAsynch.

The %ExecuteAsynch method uses multiple DeepSee agents do to the work.

The %Execute method only uses only 1 process (the current process) to do all the work. This is why %Execute is slower than you saw with Analyer, which uses %ExecuteAsynch.

So change your code to this:

Set tSC = oMDX.%ExecuteAsynch(,,1)

Here is the method signature of %ExecuteAsync

method %ExecuteAsynch(Output pQueryKey As %String,
                      ByRef pParms,
                      pWait As %Boolean = 0) as %Status

The 3rd argument of 1 indicates that you want to wait until the query is completed before the method completes.

If you don't wait until the query is  complete (pWait = 0), then your code can proceeed without waiting for the query to complete.  Then you can later use the instance method %GetStatus or the classmethod %GetQueryStatus to check if the query is complete.