X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E8001D1D4BE for ; Thu, 20 Nov 2003 21:05:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 09813-06 for ; Thu, 20 Nov 2003 17:04:30 -0400 (AST) Received: from almaden.ibm.com (p1.almaden.ibm.com [198.4.83.52]) by svr1.postgresql.org (Postfix) with ESMTP id 3EADFD1C950 for ; Thu, 20 Nov 2003 17:04:28 -0400 (AST) Received: from user.almaden.ibm.com (user.almaden.ibm.com [9.1.25.220]) by almaden.ibm.com (AIX4.3/8.9.3p2/8.9.3) with ESMTP id NAA32396 for ; Thu, 20 Nov 2003 13:04:29 -0800 Received: from almaden.ibm.com (sfarrell@yoyo.almaden.ibm.com [9.1.24.63]) by user.almaden.ibm.com (8.12.3/8.12.3/Debian -4) with ESMTP id hAKL4TlZ023952 for ; Thu, 20 Nov 2003 13:04:29 -0800 Message-ID: <3FBD2C5D.8000706@almaden.ibm.com> Date: Thu, 20 Nov 2003 13:04:29 -0800 From: stephen farrell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031030 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Problem with insert into select... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/221 X-Sequence-Number: 4781 I'm having a problem with a queyr like: INSERT INTO FACT (x,x,x,x,x,x) SELECT a.key,b.key,c.key,d.key,e.key,f.key from x,a,b,c,d,e,f where x=a and x=b .... -- postgres7.4 is running out of memory. I'm not sure why this would happen -- does it buffer the subselect before doing the insert? Things are pretty big scale: 3gb ram, 32768 shared buffers, 700gb disk, millions of rows in the tables.