Re: Re: patch review : Add ability to constrain backend temporary file space

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: cedric(dot)villemain(dot)debian(at)gmail(dot)com
Cc: mark(dot)kirkwood(at)catalyst(dot)net(dot)nz, ishii(at)postgresql(dot)org, josh(at)agliodbs(dot)com, robertmhaas(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: patch review : Add ability to constrain backend temporary file space
Date: 2011-07-16 23:45:46
Message-ID: 20110717.084546.706994262324555350.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> I modeled the original message on what happens when statement timeout is
>> exceeded, which doesn't state its limit in the error message at all -
>> actually I did wonder if there is was informal standard for *not* stating
>> the value of the limit that is being exceeded! However, I agree with you and
>> think it makes sense to include it here. I wonder if the additional detail
>> you are suggesting above might be better added to a HINT - what do you
>> think? If it is a better idea to just add it in the message as above I can
>> certainly do that.
>
> Remember that what will happens is probably:
>
> ERROR: aborting due to exceeding temp file limit. Current usage 8000kB,
> requested size 8008kB, thus it will exceed temp file limit 8kB.
>
> because temp file are increased by 8kb at once, rarely more (and by
> rare I mean that it can happens via an extension or in the future, not
> with current core postgresql).

Could you please elaborate why "Current usage 8000kB" can bigger than
"temp file limit 8kB"? I undertstand the point that temp files are
allocated by 8kB at once, but I don't understand why those numbers you
suggested could happen. Actually I tried with the modified patches and
got:

test=# CREATE TEMPORARY TABLE resourcetemp1 AS SELECT generate_series(1,100000);
SELECT 100000
test=# SET temp_file_limit = 578;
SET
test=# SELECT count(*) FROM (select * FROM resourcetemp1 ORDER BY 1) AS a;
ERROR: aborting due to exceeding temp file limit, current usage 576kB, requested size 8192kB, thus it will exceed temp file limit 578kB

Here temp_file_limit is not specified by 8kB unit, so "current usage"
becomes 576kB, which is 8kB unit. I don't think those numbers
will terribly confuse DBAs..
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-07-17 01:47:40 Re: Is there a committer in the house?
Previous Message Florian Pflug 2011-07-16 22:14:28 Re: proposal: a validator for configuration files