pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Thornton <mthornton@optrak.com>
To: pgsql-performance@postgresql.org
To: cjames@emolecules.com
Subject: Re: DELETE vs TRUNCATE explanation
Date: Wed, 11 Jul 2012 22:32:33 +0100
Message-ID: <4FFDF0F1.9010005@optrak.com> (raw)
In-Reply-To: <CAFwQ8rcR5mimJO5FumcYzkgoxkNiP3g3XOaHB1H4oHe-QnLRPQ@mail.gmail.com>
References: <4FFCCAC4.4030503@ringerc.id.au>
	<CAAZKuFZ9tYeC1K5ZayZgztm3re_7ytbsEYFa0wwXirB6Hfm+EQ@mail.gmail.com>
	<23853.1342015548@sss.pgh.pa.us>
	<CAFwQ8rcR5mimJO5FumcYzkgoxkNiP3g3XOaHB1H4oHe-QnLRPQ@mail.gmail.com>

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





view thread (46+ messages)  latest in thread

Message-ID: <4FFDF0F1.9010005@optrak.com>
Permalink:  ../4FFDF0F1.9010005@optrak.com/
Also on:    postgresql.org/message-id/4FFDF0F1.9010005@optrak.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mthornton@optrak.com, cjames@emolecules.com
  Subject: Re: DELETE vs TRUNCATE explanation
  In-Reply-To: <4FFDF0F1.9010005@optrak.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox