Re: EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Gunnlaugur Thor Briem <gunnlaugur(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <kgrittn(at)ymail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT
Date: 2015-03-16 19:24:22
Message-ID: 55072DE6.1070005@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joao Junior 2015-03-16 19:24:50 Re: MusicBrainz postgres performance issues
Previous Message Jim Nasby 2015-03-16 19:23:11 Re: EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT