Re: Must be owner to truncate?
| От | Stephen Frost |
|---|---|
| Тема | Re: Must be owner to truncate? |
| Дата | |
| Msg-id | 20050709135752.GV24207@ns.snowman.net обсуждение |
| Ответ на | Re: Must be owner to truncate? (Mike Mascari <mascarm@mascari.com>) |
| Ответы |
Re: Must be owner to truncate?
|
| Список | pgsql-hackers |
* Mike Mascari (mascarm@mascari.com) wrote:
> Stephen Frost wrote:
>
> >delete from x;/truncate x;
> > --> Creates a new, empty, file and makes it the 'current' file
> > --> Marks the old file for deletion, but it is kept around for any
> > transactions which were started before the truncate;
> > --> New transactions use the empty file
> > --> Once all transactions using the old file have completed, the old
> > file can be deleted.
> > --> Old transactions which insert rows would need to use the new file
> > or scan the old file for rows which they added, I suppose.
>
> And when the transaction that issued the TRUNCATE aborts after step 3,
> but newer transactions commit?
The newer transactions would have to check for that situation. It's not
completely thought through, but at the same time I don't necessairly
think it's something that would be completely impossible to do and still
retain most of the performance benefits, at least in the most common
case.
Thanks,
Stephen
В списке pgsql-hackers по дате отправления: