Greg Stark <stark@mit.edu> writes:
> However then I started thinking about this case and wondered if it
> wouldn't be possible to optimize. One of the suggested optimizations
> was to look at using TRUNCATE. But I wonder why it's necessary to use
> a dedicated command. Shouldn't it be possible for the system to notice
> this situation and do effectively the same thing itself?
Not unless you'd like DELETE to always acquire exclusive lock...
> There are a couple problems with the way I've described this idea
> here.
Precisely because of the lack of lock.
regards, tom lane