Quantcast
Viewing latest article 10
Browse Latest Browse All 21

Table.Buffer for cashing intermediate query results or how workaround Unnecessary Queries Issue

Hi All! I found out that actual behavior of PQ is slightly different in comparison with what I described in my previous comment.

Actually all the N steps are called only when this exception happens (text is from trace messages):
Exception:
ExceptionType: System.IO.EndOfStreamException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message: Reading after the end of stream impossible.
StackTrace:   in System.IO.__Error.EndOfFile()   in System.IO.BinaryReader.FillBuffer(Int32 numBytes)   in System.IO.BinaryReader.ReadInt64()   in Microsoft.Mashup.EngineHost.Services.DiskPersistentCache.PersistentDictionary.<>c__DisplayClass2c.<ReadBucket>b__2b()   in Microsoft.Mashup.EngineHost.Services.FileSystemAccessHelper.<>c__DisplayClass4.<IgnoringAccessExceptions>b__3()   in Microsoft.Mashup.EngineHost.Services.FileSystemAccessHelper.TryIgnoringAccessExceptions[T](Func`1 func, IEvaluationConstants evaluationConstants, T& result, Exception& accessException)

I translated "Reading after the end of stream impossible." from Russian, because original message was in Russian, so possibly the wording is slightly different in English locales.

I can see this message only in trace, in PQ UI all goes fine, except longer that without the error. And I see good data in UI, so if I would not look at trace, I wouldn't understand that there is this error.

If you don't have an error during a Query refresh, PQ launches evaluation of several steps (usually some last ones, from my experience), and stops refreshing. After that, if you click on steps of the Query, evaluated during the refresh - you get results immediately. If steps were not evaluated - the evaluation of particular clicked step is launched after the click, and you have to wait for results.

So the situation is not so bad as I described in the previous comment (but still not good).
It is not good, because every step in a Query is a separate query for PQ. If you have a number of steps, usually not all the steps are refreshed (if PQ doesn't encounter any problems while refresh them). And if a step was refreshed during the Query refresh, you see results immediately after clicking on the step after the finish of Query refresh.

The problem here is that during Query refresh every step is launched as very :-) separately. Virtually, every step of any Query is a separate query for PQ. They are combined in something common only in UI.

Current targeted version of Excel shares cash between different queries, and while refreshing every step separately, PQ still uses the cash after the first request for the whole Query refresh. But it does it just like for different Queries, called from refreshed Query. So I cannot say that refreshing of steps of queries are totally separated. But you won't benefit from Buffer while every of the step of refreshed Query, even if the refreshing happens in the same Mashup process.

Of cource it would be much better, if PQ would use the previous step (or even Query) for both purposes - for providing results for the next step of a Query AND for showing the results in UI. In particular, I don't understand why _steps_ are calculated very separately.

SO I have 2 questions:

1. Can we expect any improvement in steps (or even Query) calculating, in order to avoid this unnecessary multievaluation?

2. Why the error, I described, happens? it's defenitely because of some troubles in PQ. It starts to happen after of quite long work in PQ UI. And as soon as it starts to happen - it happens more and more often. But if you close PQ window (but not close Excel), and then launch PQ window again - the error disappears and all works fine. For some time ;-).


Viewing latest article 10
Browse Latest Browse All 21

Trending Articles