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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: cedric(dot)villemain(dot)debian(at)gmail(dot)com, mark(dot)kirkwood(at)catalyst(dot)net(dot)nz, 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-17 03:07:51
Message-ID: 525.1310872071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <ishii(at)postgresql(dot)org> writes:
>> 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.

> 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

You didn't show us how you computed those numbers, but I'm really
dubious that FileWrite() has got any ability to produce numbers that
are helpful. Like Cedric, I think the write amount in any one call
is usually going to be one block.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-07-17 03:16:12 Re: Is there a committer in the house?
Previous Message Tom Lane 2011-07-17 03:00:30 Re: Re: patch review : Add ability to constrain backend temporary file space