Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)

From: Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo>
Date: Thu, 27 May 2004 23:01:49 +0200
Message-ID: <bglcb0p5muc7fp5abjl9nq9i03pkntah1d_at_4ax.com>


On Tue, 25 May 2004 19:01:43 -0700, Gene Wirchenko wrote:

>Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo> wrote:
>
>[snip]
>
>>The elapsed time reported by SET STATISTICS TIME is close to the elapsed
>>time I calculated by comparing start and end time, but there should have
>>been no difference at all (reported elapsed: 1106144 ms; my calculation
>>says 18:47:413 or 1127413 ms - a 21 sec difference!). The cpu time
>>reported by SET STATISTICS TIME is 939797 ms, so it looks as if there's
>>little time lost while waiting.
>
> What about the possibility of round-off error?

>
>[snip]
>
>Sincerely,
>
>Gene Wirchenko
>
>Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.

Hi Gene,

21 seconds is a BIG roundoff error!!

But I've found the explanation. The output of SET STATISTICS TIME is not a total, but individual display per executed query. The last query executed (and thus the last line displayed) is actually displayed twice (sometimes whit a tiny increase for the second time it's displayed). I now think that the repeated line is an (incorrect) display for the EXECUTE statement, displaying only the cost of the last query executed in the SP plus the (very small) overhead of calling the SP.

First, I assumed that detailed info, subtotals and (as the last line) a grand total were displayed. That's why I used only the values from the last line outputted. Later, I found out that if I neglect the last line and add together all other lines, the total elapsed time matches the duration from start to finish.

Best, Hugo

-- 

(Remove _NO_ and _SPAM_ to get my e-mail address)
Received on Thu May 27 2004 - 23:01:49 CEST

Original text of this message