Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A3DB19FA248 for ; Mon, 11 Dec 2006 10:47:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 48533-03 for ; Mon, 11 Dec 2006 10:47:17 -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.171]) by postgresql.org (Postfix) with ESMTP id 4BCEE9FA1DE for ; Mon, 11 Dec 2006 10:47:17 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so1381058ugf for ; Mon, 11 Dec 2006 06:47:15 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BgO+Rct6PAPBnKuTUS/sJzXnYvy6IIIBhlkKH4CEPIuPl31gNRaELTMPw3YJM53HuYkMa0u3trQXZbyLAg94lp1a5nCKoXo0FcI9AL7SdP9V6sAVHaaRh6P+uCpBtmoF4T4rbw4KdHFJZA5Cp0UCFi22r7xPy5of/bF/ORVnSHo= Received: by 10.78.204.20 with SMTP id b20mr3215268hug.1165848435151; Mon, 11 Dec 2006 06:47:15 -0800 (PST) Received: by 10.78.45.3 with HTTP; Mon, 11 Dec 2006 06:47:14 -0800 (PST) Message-ID: Date: Mon, 11 Dec 2006 09:47:14 -0500 From: "Merlin Moncure" To: "Daniel van Ham Colchete" Subject: Re: New to PostgreSQL, performance considerations Cc: pgsql-performance@postgresql.org In-Reply-To: <8a0c7af10612110305u305124b2v3d63491b5f57a86b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8a0c7af10612101141n2c7727c3r2f92345753960808@mail.gmail.com> <430d92a20612101336r3de8862coe618277fccb4006a@mail.gmail.com> <8a0c7af10612101702i49b5a533v4a2300d90d9dae6b@mail.gmail.com> <20061211021847.GE16692@mathom.us> <8a0c7af10612110305u305124b2v3d63491b5f57a86b@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/232 X-Sequence-Number: 22288 On 12/11/06, Daniel van Ham Colchete wrote: > But, trust me on this one. It's worth it. Think of this: PostgreSQL > and GNU LibC use a lot of complex algorithms: btree, hashes, > checksums, strings functions, etc... And you have a lot of ways to > compile it into binary code. Now you have Pentium4's vectorization > that allow you to run plenty of instructions in paralell, but AMD > doesn't have this. Intel also have SSE2 that makes double-precision > floatpoint operations a lot faster, AMD also doesn't have this (at > least on 32bits). Now imagine that you're RedHat and that you have to > deliver one CD to AMD and Intel servers. That means you can't use any > AMD-specific or Intel-specific tecnology at the binary level. AMD processors since the K6-2 and I think Intel ones since P-Pro are essentially RISC processors with a hardware microcode compiler that translates and reorganizes instructions on the fly. Instruction choice and ordering was extremely important in older 32 bit architectures (like the 486) but is much less important these days. I think you will find that an optimized glibc might be faster in specific contrived cases, the whole is unfortunately less than the sum of its parts. While SSE2 might be able to optimize things like video decoding and the like, for most programs it's of little benifit and IMO a waste of time. Also as others pointed out things like cache hits/misses and i/o considerations are actually much more important than instruction execution speed. We ran Gentoo here for months and did not to be faster enough to merit the bleeding edge quirks it has for production environments. If you dig assembly, there was an interesting tackle of the spinlocks code on the hackers list last year IIRC. merlin