Re: Temporary Views Cleanup Issue - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Temporary Views Cleanup Issue
Date
Msg-id 1297045.1736173636@sss.pgh.pa.us
Whole thread Raw
Responses Re: Temporary Views Cleanup Issue
List pgsql-hackers
"=?UTF-8?B?6LW15a6H6bmPKOWuh+W9rSk=?=" <zhaoyupeng.zyp@alibaba-inc.com> writes:
> I have discovered a peculiar issue: after creating a temporary view, if the
> backend process exits abnormally, the temporary view is not cleaned up. However,
> if a temporary table is created and the backend process exits abnormally, the
> temporary table is cleaned up.

I think this is intentional.  A temp table may consume enough disk
space that it's worth hacking up autovacuum to remove the space.
The same cannot be said of other kinds of objects.  (If we had
temp materialized views, they might be worth cleaning up ... but
we don't.)  So we might as well leave the rest for the normal
RemoveTempRelations call the next time somebody uses the temp
namespace.

Also, I don't buy the argument that it's better for autovacuum to be
aggressive here.  RemoveTempRelations will cope if, say, a temp view
has a dependency on another one.  autovacuum might fail entirely
(blocking additional cleanup), if it happens to try to delete the
wrong one first.  So we should minimize the amount of stuff we expect
autovacuum to accomplish.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Fwd: Re: A new look at old NFS readdir() problems?
Next
From: Peter Eisentraut
Date:
Subject: Re: initdb -c "track_commit_timestamp=on" crashes in case of debug build