Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id CD0A71337B58 for ; Sun, 28 Nov 2010 18:17:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 05099-08 for ; Sun, 28 Nov 2010 22:17:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 64.mail-out.ovh.net (64.mail-out.ovh.net [91.121.185.65]) by mail.postgresql.org (Postfix) with SMTP id 0DEA01337B51 for ; Sun, 28 Nov 2010 18:17:25 -0400 (AST) Received: (qmail 19059 invoked by uid 503); 28 Nov 2010 21:36:20 -0000 Received: from b9.ovh.net (HELO mail32.ha.ovh.net) (213.186.33.59) by 64.mail-out.ovh.net with SMTP; 28 Nov 2010 21:36:20 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 28 Nov 2010 23:50:43 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 28 Nov 2010 23:50:42 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Mario Splivalo" Cc: pgsql-performance@postgresql.org Subject: Re: SELECT INTO large FKyed table is slow References: <4CF24103.8030209@megafon.hr> <4CF2A8A6.4010400@megafon.hr> Date: Sun, 28 Nov 2010 22:50:42 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <4CF2A8A6.4010400@megafon.hr> User-Agent: Opera Mail/10.62 (Linux) X-Ovh-Tracer-Id: 14893966917784045174 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/391 X-Sequence-Number: 41415 > I pasted DDL at the begining of my post. Ah, sorry, didn't see it ;) > The only indexes tables have are the ones created because of PK > constraints. Table drones has around 100k rows. Table drones_history has > around 30M rows. I'm not sure what additional info you'd want but I'll > be more than happy to provide more relevant information. Can you post the following : - pg version - output of VACCUM ANALYZE VERBOSE for your 2 tables