pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT
Date: Mon, 16 Mar 2015 14:24:22 -0500
Message-ID: <55072DE6.1070005@BlueTreble.com> (raw)
In-Reply-To: <CAPs+M8JaFmns1me5PB5TE9jsTscM0yW9ONL4JwzFHmcbQ-9p-g@mail.gmail.com>
References: <54F9E179.4000804@2ndquadrant.com>
	<1407502480.21180.1425691482543.JavaMail.yahoo@mail.yahoo.com>
	<27245.1425692294@sss.pgh.pa.us>
	<CAMkU=1zxAB4AQySxex_DXP2mt+Ab=S+nQw+2M1rY7CFJzgYfTQ@mail.gmail.com>
	<54FB1CDA.1080606@2ndquadrant.com>
	<CAPs+M8JaFmns1me5PB5TE9jsTscM0yW9ONL4JwzFHmcbQ-9p-g@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 3/11/15 10:54 AM, Gunnlaugur Thor Briem wrote:
> (Even better, just make the new table not temporary, and have it replace
> the former table altogether. But that's for later; requires some broader
> changes in our application.)

The other thing you should consider is using TRUNCATE instead of an 
un-filtered DELETE. It will both be much faster to perform and won't 
leave any dead rows behind.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (21+ messages)  latest in thread

Message-ID: <55072DE6.1070005@BlueTreble.com>
Permalink:  ../55072DE6.1070005@BlueTreble.com/
Also on:    postgresql.org/message-id/55072DE6.1070005@BlueTreble.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: Jim.Nasby@BlueTreble.com, gunnlaugur@gmail.com, tomas.vondra@2ndquadrant.com, jeff.janes@gmail.com, tgl@sss.pgh.pa.us, kgrittn@ymail.com
  Subject: Re: EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT
  In-Reply-To: <55072DE6.1070005@BlueTreble.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