Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 61DB51337B96 for ; Fri, 4 Feb 2011 17:18:29 -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 88357-01 for ; Fri, 4 Feb 2011 21:18:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tanagra.summersault.com (tanagra.summersault.com [12.161.105.149]) by mail.postgresql.org (Postfix) with ESMTP id 9E63E1337B97 for ; Fri, 4 Feb 2011 17:18:21 -0400 (AST) Received: (qmail 51809 invoked from network); 4 Feb 2011 21:18:20 -0000 Received: from simba.summersault.com (192.168.97.182) by tanagra.summersault.com with SMTP; 4 Feb 2011 21:18:20 -0000 Message-ID: <4D4C6D1A.2000305@summersault.com> Date: Fri, 04 Feb 2011 16:18:18 -0500 From: Mark Stosberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: gmane.comp.db.postgresql.performance To: pgsql-performance@postgresql.org Subject: Re: getting the most of out multi-core systems for repeated complex SELECT statements References: <20110203105704.BAX82905@ms14.lnh.mail.rcn.net> In-Reply-To: <20110203105704.BAX82905@ms14.lnh.mail.rcn.net> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/221 X-Sequence-Number: 42359 On 02/03/2011 10:57 AM, gnuoytr@rcn.com wrote: > For PG to prosper in the future, it has to embrace the multi-core/processor/SSD machine at the query level As the person who brought up the original concern, I'll add that "multi-core at the query level" really isn't important for us. Most of our PostgreSQL usage is through a web application which fairly automatically takes advantage of multiple cores, because there are several parallel connections. A smaller but important piece of what we do is run this cron script needs to run hundreds of thousands of variations of the same complex SELECT as fast it can. What honestly would have helped most is not technical at all-- it would have been some documentation on how to take advantage of multiple cores for this case. It looks like it's going to be trivial-- Divide up the data with a modulo, and run multiple parallel cron scripts that each processes a slice of the data. A benchmark showed that this approach sped up our processing 3x when splitting the application 4 ways across 4 processors. (I think we failed to achieve a 4x improvement because the server was already busy handling some other tasks). Part of our case is likely fairly common *today*: many servers are multi-core now, but people don't necessarily understand how to take advantage of that if it doesn't happen automatically. Mark