Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 10A7C9F9357 for ; Sat, 16 Dec 2006 14:03:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 67926-05 for ; Sat, 16 Dec 2006 14:03:40 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by postgresql.org (Postfix) with ESMTP id A11F19F9F47 for ; Sat, 16 Dec 2006 14:03:41 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so1121558ugf for ; Sat, 16 Dec 2006 10:03:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Xabd5LfrabXwotPRYgGIzf/3hL3zPK+c5mDxSeCSucIW0VSXQY/n180uhdIDuyVXhksRexnd4VjXXJ+CmZlesJqo2BdSEMXoFl2rEMMARNyYrldJlVdeN77kUrrT29U058rbFQwOCYeoED9XqS8aspytW9QzOU+5zb+czNygdFU= Received: by 10.78.185.15 with SMTP id i15mr1434726huf.1166292219496; Sat, 16 Dec 2006 10:03:39 -0800 (PST) Received: by 10.78.180.4 with HTTP; Sat, 16 Dec 2006 10:03:38 -0800 (PST) Message-ID: <84fb38e30612161003gded26aalfcd3aa0a5176c75c@mail.gmail.com> Date: Sat, 16 Dec 2006 12:03:38 -0600 From: tsuraan To: tsuraan , pgsql-performance@postgresql.org Subject: Re: Scaling concerns In-Reply-To: <20061216173221.GA25410@uio.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <84fb38e30612160926l609ec55cs352b2495289bae0c@mail.gmail.com> <20061216173221.GA25410@uio.no> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/442 X-Sequence-Number: 22498 > Unqualified SELECT COUNT(*) FROM foo is one of the most expensive operations > you can do on your system, since the visibility information has to be > checked > on disk for each row. Instead, try real queries on real data, and post here > if some are too slow for you. Ok, that's a bad example. I'm learning :-) Is insert ... select also really expensive then? I have a table loaded with message-id and path information of currently-existing messages. It has ~20 million rows. Trying to do "INSERT INTO Messages(path, msgid) SELECT (path, msgid) FROM tmpMessages" took a really long time before psql died with an out-of-memory error. Is there a more sane way to do a table copy, or should I have just dropped all the indices from the Message table and loaded into that? Thanks!