Re: DELETE vs TRUNCATE explanation

From: Mark Thornton <mthornton(at)optrak(dot)com>
To: pgsql-performance(at)postgresql(dot)org, cjames(at)emolecules(dot)com
Subject: Re: DELETE vs TRUNCATE explanation
Date: 2012-07-11 21:32:33
Message-ID: 4FFDF0F1.9010005@optrak.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On 11/07/12 21:18, Craig James wrote:
>
> It strikes me as a contrived case rather than a use case. What sort
> of app repeatedly fills and truncates a small table thousands of times
> ... other than a test app to see whether you can do it or not?
If I have a lot of data which updates/inserts an existing table but I
don't know if a given record will be an update or an insert, then I
write all the 'new' data to a temporary table and then use sql
statements to achieve the updates and inserts on the existing table.

Is there a better way of doing this in standard SQL?

Mark

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-07-11 21:35:26 emacs configuration for new perltidy settings
Previous Message Alvaro Herrera 2012-07-11 21:20:28 Re: Schema version management

Browse pgsql-performance by date

  From Date Subject
Next Message Craig James 2012-07-11 22:09:56 Re: DELETE vs TRUNCATE explanation
Previous Message Andrew Dunstan 2012-07-11 21:04:39 Re: DELETE vs TRUNCATE explanation