Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2FD4C9FA19B for ; Mon, 11 Dec 2006 07:06:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 31757-07 for ; Mon, 11 Dec 2006 07:05:49 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0102.google.com (nz-out-0506.google.com [64.233.162.228]) by postgresql.org (Postfix) with ESMTP id 4A9AF9F9F75 for ; Mon, 11 Dec 2006 07:05:58 -0400 (AST) Received: by nz-out-0102.google.com with SMTP id i11so741673nzh for ; Mon, 11 Dec 2006 03:05:57 -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=tXeW5GQRshOthWfdIrXqAcsighA60t9lMVMYnh4BTFtc2ltdhwbcwQW7vmW1h8OVSg700o4+iNEN50B0J83K9MqroDsecu+LdlsY6LuSkujp5jfhP8hsiU7eAFHeI2PFs7Jt3nHst8W8abKeABr7iF1mIJEXVTvRlCjqPhpLwaY= Received: by 10.65.160.7 with SMTP id m7mr10696462qbo.1165835156796; Mon, 11 Dec 2006 03:05:56 -0800 (PST) Received: by 10.65.215.20 with HTTP; Mon, 11 Dec 2006 03:05:56 -0800 (PST) Message-ID: <8a0c7af10612110305u305124b2v3d63491b5f57a86b@mail.gmail.com> Date: Mon, 11 Dec 2006 09:05:56 -0200 From: "Daniel van Ham Colchete" To: pgsql-performance@postgresql.org Subject: Re: New to PostgreSQL, performance considerations In-Reply-To: <20061211021847.GE16692@mathom.us> 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> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/217 X-Sequence-Number: 22273 Mike, unfortunally I don't have any benchmarks right now. Doing something like this with the same machine would be a 2-day work (at least). Installing a Gentoo and putting it to run well is not a quick task (although is easy). 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. Things can get worse. If you take a look at GCC's code (at gcc/config/i386/i386.c), you'll see that GCC knows what runs faster on each processor. Let-me give an example with the FDIV and FSQRT instructions: ARCH - FDIV - FSQRT (costs relative to an ADD) i386: 88 - 122 i486: 73 - 83 pentium: 39 - 70 k6: 56 - 56 Athlon: 24 - 35 K8: 19 - 35 Pentium4: 43 - 43 Nocona: 40 - 44 Imagine that you are GCC and that you have two options in front of you: you can use FSQRT or FDIV plus 20 ADD/SUB. If you are on an Pentium situation you should use the second option. But on a Pentium4 or on a Athlon you should choose for the first one. This was only an example, nowadays you would have to choose between: 387, 3dNow, 3dNow+, SSE, SSE2, ... With this info, GCC knows how to choose the best ways to doing things to each processor. When you are compiling to an generic i586 (like Fedora and RedHat), them you are using pentium's timings. An example that I know of: it's impossible to run my software at a high demanding customer without compiling it to the it's processor (I make 5 compilations on every release). Using Intel's Compiler for Intel's processors makes things even faster, but it is not free and the "how fast" part really depends on your application is coded. With 64bits processors, AMD and Intel restarted the process and everyone has SSE2 (but not SSE3). Even so, the timings are also very diferent. Best regards Daniel On 12/11/06, Michael Stone wrote: > On Sun, Dec 10, 2006 at 11:02:44PM -0200, Daniel van Ham Colchete wrote: > >I'm using Gentoo Linux, so all my libraries (including glibc that is > >very important to PostgreSQL), and all my softwares are compiled with > >good CFLAG options to my processor ("-O2 march=athlon-xp (...)"). My > >Linux is not an Intel-AMD binary compatible turtle like > >Fedora/RedHat/SUSE/... It's really important to have your GLIBC > >compiled for your processor. It is essencial for performance. > > Please, point to the benchmarks that demonstrate this for a postgres > application. > > Mike Stone > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >