Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3ED369FA274 for ; Mon, 11 Dec 2006 15:04:07 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 16834-05 for ; Mon, 11 Dec 2006 15:03:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by postgresql.org (Postfix) with ESMTP id 311289F931E for ; Mon, 11 Dec 2006 15:03:59 -0400 (AST) Received: from osgiliath.mathom.us ([71.246.251.8]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JA400197HZWN0A0@vms044.mailsrvcs.net> for pgsql-performance@postgresql.org; Mon, 11 Dec 2006 12:57:32 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by osgiliath.mathom.us (Postfix) with ESMTP id 1CE2E6EA76 for ; Mon, 11 Dec 2006 13:57:30 -0500 (EST) Received: from osgiliath.mathom.us ([127.0.0.1]) by localhost (osgiliath.home.mathom.us [127.0.0.1]) (amavisd-new, port 10024) with LMTP id E+CRu5jTfJ38 for ; Mon, 11 Dec 2006 13:57:29 -0500 (EST) Received: by osgiliath.mathom.us (Postfix, from userid 1000) id 0733D70ABD; Mon, 11 Dec 2006 13:57:29 -0500 (EST) Date: Mon, 11 Dec 2006 13:57:28 -0500 From: Michael Stone Subject: Re: New to PostgreSQL, performance considerations In-reply-to: To: pgsql-performance@postgresql.org Mail-followup-to: pgsql-performance@postgresql.org Message-id: <20061211185727.GJ16692@mathom.us> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-disposition: inline X-Virus-Scanned: Debian amavisd-new at mathom.us X-Pgp-Fingerprint: 53 FF 38 00 E7 DD 0A 9C 84 52 84 C5 EE DF 7C 88 References: <20061211173105.GH16692@mathom.us> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/254 X-Sequence-Number: 22310 On Mon, Dec 11, 2006 at 10:30:55AM -0800, Luke Lonergan wrote: >Here's one - I wrote a general purpose Computational Fluid Dynamics analysis >method used by hundreds of people to perform aircraft and propulsion systems >analysis. That's kinda the opposite of what I meant by general code. I was trying (perhaps poorly) to distinguish between scientific codes and other stuff (especially I/O or human interface code). >Compiler flag tuning would speed it up by factors of 2-3 or even >more on some architectures. The reason it was so effective is that the >structure of the code was designed to be general, but also to expose the >critical performance sections in a way that the compilers could use - deep >pipelining/vectorization, unrolling, etc, were carefully made easy for the >compilers to exploit in critical sections. It also sounds like code specifically written to take advantage of compiler techniques, rather than random code thrown at a pile of cflags. I don't disagree that it is possible to get performance improvements if code is written to be performant code; I do (and did) disagree with the idea that you'll get huge performance improvements by taking regular old C application code and playing with compiler flags. >Yes, this made the code in those >sections harder to read, but it was a common practice because it might >take weeks of runtime to get an answer and performance mattered. IMO that's appropriate for some science codes (although I think even that sector is beginning to find that they've gone too far in a lot of ways), but for a database I'd rather have people debugging clean, readable code than risking my data to something incomprehensible that runs in optimal time. >Column databases like C-Store remove these abstractions at planner time to >expose native operations in large chunks to the compiler and the IPC >reflects that - typically 1+ and as high as 2.5. If we were to redesign the >executor and planner to emulate that same structure we could achieve similar >speedups and the compiler would matter more. gcc --make-it-really-fast-by-rewriting-it-from-the-ground-up? Mike Stone