Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7D77C1337B80 for ; Wed, 11 May 2011 16:53:25 -0300 (ADT) 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 22454-06 for ; Wed, 11 May 2011 19:53:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp01.lnh.mail.rcn.net (smtp11.lnh.mail.rcn.net [207.172.157.101]) by mail.postgresql.org (Postfix) with ESMTP id 522591337B83 for ; Wed, 11 May 2011 16:53:16 -0300 (ADT) Received: from ms14.lnh.mail.rcn.net ([208.58.56.82]) by smtp02.lnh.mail.rcn.net with ESMTP; 11 May 2011 15:53:15 -0400 Received: (from ms14.lnh.mail.rcn.net [64.148.9.74]) by ms14.lnh.mail.rcn.net (MOS 4.2.3-GA) with HTTP/1.1 id BMI50169 (AUTH gnuoytr@rcn.com); Wed, 11 May 2011 15:53:09 -0400 (EDT) From: Subject: Re: Postgres refusing to use >1 core To: sthomas@peak6.com, "Scott Marlowe" Cc: "Craig Ringer" , "Aren Cambre" , pgsql-performance@postgresql.org X-Mailer: Mirapoint Webmail Direct 4.2.3-GA MIME-Version: 1.0 In-Reply-To: <4DCAB3A1.2090507@peak6.com> References: <4DC81A3F020000250003D433@gw.wicourts.gov> <4DC81D56020000250003D438@gw.wicourts.gov> <4DC8B893.3060908@postnewspapers.com.au> <4DC9E7C5.9080309@postnewspapers.com.au> <4DCAB3A1.2090507@peak6.com> Message-Id: <201105111953.060147@ms14.lnh.mail.rcn.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 11 May 2011 15:53:09 -0400 (EDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.585 tagged_above=-10 required=5 tests=BAYES_00=-1.9, SARE_MILLIONSOF=0.315 X-Spam-Level: X-Archive-Number: 201105/158 X-Sequence-Number: 43667 ---- Original message ---- >Date: Wed, 11 May 2011 11:04:49 -0500 >From: pgsql-performance-owner@postgresql.org (on behalf of Shaun Thomas ) >Subject: Re: [PERFORM] Postgres refusing to use >1 core >To: Scott Marlowe >Cc: Craig Ringer ,Aren Cambre , > >On 05/10/2011 11:26 PM, Scott Marlowe wrote: > >> I.e. don't grab 1,000 rows and work on them on the client side and >> then insert data, do the data mangling in the query in the database. >> My experience has been that moving things like this into the database >> can result in performance gains of several factors, taking hour long >> processes and making them run in minutes. > >This is a problem I encounter constantly wherever I go. Programmer >selects millions of rows from giant table. Programmer loops through >results one by one doing some magic on them. Programmer submits queries >back to the database. Even in batches, that's going to take ages. > >Databases are beasts at set-based operations. If the programmer can >build a temp table of any kind and load that, they can turn their >update/insert/whatever into a simple JOIN that runs several orders of >magnitude faster. Going the route of parallelism will probably work too, >but I doubt it's the right solution in this case. > >When there are tables with millions of rows involved, processing 111 per >second is a bug. Even with ten perfectly balanced threads, 30 hours only >becomes three. On decent hardware, you can probably drop, reload, and >index the entire table faster than that. > >-- >Shaun Thomas >OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 >312-676-8870 >sthomas@peak6.com > >______________________________________________ > >See http://www.peak6.com/email_disclaimer.php >for terms and conditions related to this email > >-- >Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) >To make changes to your subscription: >http://www.postgresql.org/mailpref/pgsql-performance So, the $64 question: how did you find an engagement where, to bend Shakespeare, "first thing we do, is kill all the coders" isn't required? This RBAR mentality, abetted by xml/NoSql/xBase, is utterly pervasive. They absolutely refuse to learn anything different from the COBOL/VSAM messes of their grandfathers; well modulo syntax, of course. The mere suggestion, in my experience, that doing things faster with fewer lines of code/statements in the engine is met with overt hostility. Regards, Robert