On 19/02/11 10:38, Josh Berkus wrote:
>
>> To answer the other question, what happens when the limit is exceeded is
>> modeled on statement timeout, i.e query is canceled and a message says
>> why (exceeded temp files size).
> When does this happen? When you try to allocate the file, or when it
> does the original tape sort estimate?
>
> The disadvantage of the former is that the user waited for minutes in
> order to have their query cancelled. The disadvantage of the latter is
> that the estimate isn't remotely accurate.
>
Neither - it checks each write (I think this is pretty cheap - adds two
int and double + operations and a /, > operation to FileWrite). If the
check shows you've written more than the limit, you get canceled. So you
can exceed the limit by 1 buffer size.
Yeah, the disadvantage is that (like statement timeout) it is a 'bottom
of the cliff' type of protection. The advantage is there are no false
positives...
Cheers
Mark