diff --git "a/pgsql-performance.200608" "b/pgsql-performance.200608" new file mode 100644--- /dev/null +++ "b/pgsql-performance.200608" @@ -0,0 +1,54085 @@ +From pgsql-performance-owner@postgresql.org Tue Aug 1 03:19:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 226A99FB3CD + for ; + Tue, 1 Aug 2006 03:19:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 77815-02-2 + for ; + Tue, 1 Aug 2006 03:18:49 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id 0F2739FB429 + for ; + Tue, 1 Aug 2006 01:27:15 -0300 (ADT) +Received: from 172.16.1.25 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Tue, 01 Aug 2006 00:27:00 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 Aug + 2006 00:27:00 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Tue, 1 Aug + 2006 04:26:59 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Mon, 31 Jul 2006 21:26:57 -0700 +Subject: Re: Performances with new Intel Core* processors +From: "Luke Lonergan" +To: "Vivek Khera" , + "Pgsql-Performance ((E-mail))" +Message-ID: +Thread-Topic: [PERFORM] Performances with new Intel Core* processors +Thread-Index: Aca1Irlc97H0HCEVEduFdAAWy4o9DA== +In-Reply-To: +MIME-Version: 1.0 +X-OriginalArrivalTime: 01 Aug 2006 04:27:00.0789 (UTC) + FILETIME=[BB9EA650:01C6B522] +X-WSS-ID: 68D0079E3782009863-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.635 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/2 +X-Sequence-Number: 20187 + +Vivek, + +On 7/31/06 2:04 PM, "Vivek Khera" wrote: + +> No, but it *does* matter how fast said processor can sling the memory +> around, and in my experience, the opterons have been much better at +> that due to the efficiency of the memory transport layer. + +My Mac laptop with a Core 1 and DDR2 RAM does 2700 MB/s memory bandwidth. +The Core 2 also has lower memory latency than the Opteron. + +That said - Intel still hasn't figured out how to do cache-coherent SMP +scaling yet - the Opteron has the outstanding EV6/HTX bus and the cc-numa +cache coherency logic working today. + +- Luke + + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 02:57:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 4FAE59FB3A1 + for ; + Tue, 1 Aug 2006 02:57:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 74666-02-4 + for ; + Tue, 1 Aug 2006 02:56:50 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from ns2.nec.com.au (ns2.nec.com.au [147.76.180.2]) + by postgresql.org (Postfix) with ESMTP id 3B4769FA6B1 + for ; + Tue, 1 Aug 2006 02:01:20 -0300 (ADT) +Received: from smtp1.nec.com.au (unknown [172.31.8.18]) + by ns2.nec.com.au (Postfix) with ESMTP id 824A63B6B1 + for ; + Tue, 1 Aug 2006 15:01:17 +1000 (EST) +Received: from eddy (eddy.ssd.neca.nec.com.au [147.76.48.116]) + by warp.ssd.neca.nec.com.au (8.12.10+Sun/8.12.10) with SMTP id + k7151HuP014061 for ; + Tue, 1 Aug 2006 15:01:17 +1000 (EST) +Reply-To: +From: "Guoping Zhang" +To: +Subject: Are there any performance penalty for opposite edian platform + combinations.... +Date: Tue, 1 Aug 2006 15:01:15 +1000 +Message-ID: <001401c6b527$85406620$74304c93@eddy> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="hz-gb-2312" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 +Importance: Normal +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/1 +X-Sequence-Number: 20186 + +Hello, + +I apologize that if the similar questions were already asked and answered +before..... +Here is a go: + +a) If we have application clients running on a Solaris 10/SPARC box and +database server running on a Solaris10 X_86 box; further, we have a few +tables, in which we split an integer type of field into several our own +defined bit map segement, upon them, we have a set of logic operation +implemented in our applications, MY question is, could the different edian +scheme (SPARC is a big edian and X_86 is the opposite) possibly slow down +the applcation? + +In fact, it is a general question that "Is it a good practice we shall avoid +to run application server and database server on the platform with opposite +edian? or it simply doesn't matter"? + +b) Same direction for the question, if using slony-1, if master server is +running on a big edian host but slave is running on a small edian host, are +there any performance loss due to the edian difference? + +Thanks in advance for your opinions. + +Regards, +Guoping Zhang + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 04:28:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DD6E09FA5E9 + for ; + Tue, 1 Aug 2006 04:28:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 86756-02 for + ; + Tue, 1 Aug 2006 04:28:10 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx00.ext.bfk.de (mx00.ext.bfk.de [217.29.46.125]) + by postgresql.org (Postfix) with ESMTP id 1F6219FA374 + for ; + Tue, 1 Aug 2006 04:28:09 -0300 (ADT) +Received: from fweimer by bfk.de with local id 1G7ofd-0007KA-4N; + Tue, 01 Aug 2006 09:28:05 +0200 +To: Arjen van der Meijden +Cc: Merlin Moncure , Jonathan Ballet , + pgsql-performance@postgresql.org +Subject: Re: Performances with new Intel Core* processors +References: <44CDFD44.8080307@multani.info> + + <44CE3023.3020402@tweakers.net> +From: Florian Weimer +Date: Tue, 01 Aug 2006 09:28:05 +0200 +In-Reply-To: <44CE3023.3020402@tweakers.net> (Arjen van der Meijden's message + of "Mon, 31 Jul 2006 18:30:27 +0200") +Message-ID: <8264hchq4a.fsf@mid.bfk.de> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/3 +X-Sequence-Number: 20188 + +* Arjen van der Meijden: + +> For a database system, however, processors hardly ever are the main +> bottleneck, are they? + +Not directly, but the choice of processor influences which +chipsets/mainboards are available, which in turn has some impact on +the number of RAM slots. (According to our hardware supplier, beyound +8 GB, the price per GB goes up sharply.) Unfortunately, it seems that +the Core 2 Duo mainboards do not change that much in this area. + +-- +Florian Weimer +BFK edv-consulting GmbH http://www.bfk.de/ +Durlacher Allee 47 tel: +49-721-96201-1 +D-76131 Karlsruhe fax: +49-721-96201-99 + +From pgsql-performance-owner@postgresql.org Tue Aug 1 09:10:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 632659FB1CC + for ; + Tue, 1 Aug 2006 09:10:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 57935-08 for + ; + Tue, 1 Aug 2006 09:10:40 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 71D249FA430 + for ; + Tue, 1 Aug 2006 09:10:40 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k71CAYtw000858; + Tue, 1 Aug 2006 08:10:34 -0400 (EDT) +To: guoping.zhang@nec.com.au +cc: pgsql-performance@postgresql.org +Subject: Re: Are there any performance penalty for opposite edian platform + combinations.... +In-reply-to: <001401c6b527$85406620$74304c93@eddy> +References: <001401c6b527$85406620$74304c93@eddy> +Comments: In-reply-to "Guoping Zhang" + message dated "Tue, 01 Aug 2006 15:01:15 +1000" +Date: Tue, 01 Aug 2006 08:10:34 -0400 +Message-ID: <857.1154434234@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.193 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/4 +X-Sequence-Number: 20189 + +"Guoping Zhang" writes: +> In fact, it is a general question that "Is it a good practice we shall avoid +> to run application server and database server on the platform with opposite +> edian? or it simply doesn't matter"? + +Our network protocol uses big-endian consistently, so there will be some +tiny hit for little-endian machines, independently of what's on the +other end of the wire. I can't imagine you could measure the difference +though. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 1 10:40:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AAC709FB1FC + for ; + Tue, 1 Aug 2006 10:40:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 04593-02 for + ; + Tue, 1 Aug 2006 10:39:47 -0300 (ADT) +X-Greylist: delayed 00:30:39.516928 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id C5CDB9FB1F9 + for ; + Tue, 1 Aug 2006 10:39:47 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from webmail.enterprisedb.com (webmail.enterprisedb.com + [63.246.7.176]) + by svr4.postgresql.org (Postfix) with ESMTP id 6545D5AF024 + for ; + Tue, 1 Aug 2006 13:09:06 +0000 (GMT) +Received: from edb04.managed.contegix.com (localhost.localdomain [127.0.0.1]) + by webmail.enterprisedb.com (Postfix) with ESMTP id 133A3A248DC + for ; + Tue, 1 Aug 2006 08:09:04 -0500 (CDT) +Message-ID: + <743802020.4341154437744062.OPEN-XCHANGE.WebMail.tomcat@edb04.managed.contegix.com> +Date: Tue, 1 Aug 2006 08:09:04 -0500 (CDT) +From: Ernest Nishiseki +To: pgsql-performance@postgresql.org +Subject: Re: Fwd: Savepoint performance +In-Reply-To: <36e682920607310725p57529b68ic4f08847d8559e03@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable +X-Priority: 3 (normal) +X-Mailer: OPEN-XCHANGE 5061 - WebMail +X-Operating-System: Linux 2.6.9-34.0.2.ELsmp x86 (JVM 1.4.2) +Organization: EnterpriseDB - US +References: <1154020755.1634.509.camel@archimedes> + <20060727193520.GG18774@surnet.cl> + <5f820f750607271813m454dec68rd0e985deefeaa37e@mail.gmail.com> + <15026.1154050477@sss.pgh.pa.us> + <5f820f750607271933p5367b755ya88e41891b126983@mail.gmail.com> + <36e682920607310725p57529b68ic4f08847d8559e03@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/6 +X-Sequence-Number: 20191 + +Actually, what we did in the tests at EnterpriseDB was encapsulate each +SQL statement within its own BEGIN/EXCEPTION/END block. + +Using this approach, if a SQL statement aborts, the rollback is +confined=C2=A0 +to the BEGIN/END block that encloses it.=C2=A0 Other SQL statements would +not be affected since the block would isolate and capture that +exception. + +In the tests, the base-line version was a PL/pgSQL function for the +dbt-2 new order transaction written within a single BEGIN/END block. +The experimental version was a variation of the base-line altered so +the processing of each order entailed entering three sub-blocks from +the main BEGIN/END block. In addition, another sub-block was +entered each time a detail line within an order was processed. + +The transactions per minute were recorded for runs of 20 minutes +simulating 10 terminals and 6 hours simulating 10 terminals. +Below are some of the numbers we got: + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0With Sub- +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A0Test # =C2=A0 =C2=A0 =C2=A0 Base Line =C2=A0 Blocks=C2=A0=C2=A0=C2=A0= +=C2=A0=C2=A0=C2=A0=C2=A0 +Difference=C2=A0 % Variation +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A0--------=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ------------=C2=A0=C2=A0 -----= +------=C2=A0=C2=A0=C2=A0 +-------------=C2=A0 -------------- +10 terminals,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1= +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0 6128=C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 5861 +20 minutes=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0 2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= +=C2=A0 5700=C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 5702 +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A0=C2=A03=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= +=A0 6143=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 5556 +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A0=C2=A04=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 59= +54 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 5750 +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A05=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 5695=C2= +=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 5925 + +Average of tests 1 - 5=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= +=A0=C2=A0=C2=A0=C2=A0=C2=A0 5924=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= +=C2=A0=C2=A0 5758.8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +-165.2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -2.79 + +10 terminals, 6 hours=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= +=C2=A0=C2=A0=C2=A0 5341 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 5396=C2=A0=C2=A0= +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +55=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = +1.03 + +As you can see, we didn't encounter a predictable, significant +difference. + +Ernie Nishiseki, Architect +EnterpriseDB Corporation=C2=A0 wrote: + +>---------- Forwarded message ---------- +>From: Denis Lussier=20 +>Date: Jul 27, 2006 10:33 PM +>Subject: Re: [PERFORM] Savepoint performance +>To: Tom Lane=20 +>Cc: pgsql-performance@postgresql.org +> +> +>My understanding of EDB's approach is that our prototype just +>implicitly does a savepoint before each INSERT, UPDATE, or DELETE +>statement inside of PLpgSQL. We then rollback to that savepoint if a +>sql error occurs. I don 't believe our prelim approach changes any +>transaction start/end semantics on the server side and it doesn't +>change any PLpgSQL syntax either (although it does allow you to +>optionally code commits &/or rollbacks inside stored procs). +> +>Can anybody point me to a thread on the 7.3 disastrous experiment? +> +>I personally think that doing commit or rollbacks inside stored +>procedures is usually bad coding practice AND can be avoided... It's +>a backward compatibility thing for non-ansi legacy stuff and this is +>why I was previously guessing that the community wouldn't be +>interested in this for PLpgSQL. Actually... does anybody know +>offhand if the ansi standard for stored procs allows for explicit +>transaction control inside of a stored procedure? +> +>--Luss +> +>On 7/27/06, Tom Lane wrote: +>>"Denis Lussier" writes: +>>>Would the community be potentially interested in this feature if we +>>>created +>>>a BSD Postgres patch of this feature for PLpgSQL (likely for 8.3)?? +>> +>>Based on our rather disastrous experiment in 7.3, I'd say that fooling +>>around with transaction start/end semantics on the server side is +>>unlikely to fly ... +>> +>>regards, tom lane +>> +> +>---------------------------(end of +>broadcast)--------------------------- +>TIP 4: Have you searched our list archives? +> +>http://archives.postgresql.org +> +> +>-- +>Jonah H. Harris, Software Architect | phone: 732.331.1300 +>EnterpriseDB Corporation | fax: 732.331.1301 +>33 Wood Ave S, 2nd Floor | jharris@enterprisedb.com +>Iselin, New Jersey 08830 | http://www.enterprisedb.com/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 10:18:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CADD29FA374 + for ; + Tue, 1 Aug 2006 10:18:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 02412-05 for + ; + Tue, 1 Aug 2006 10:18:37 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from office.redwerk.com (office.redwerk.com [85.90.206.104]) + by postgresql.org (Postfix) with ESMTP id E44FA9FB1F4 + for ; + Tue, 1 Aug 2006 10:18:36 -0300 (ADT) +Received: from bofh by office.redwerk.com with local (Exim 4.62 (FreeBSD)) + (envelope-from ) id 1G7u8r-0001CG-Gp + for pgsql-performance@postgresql.org; Tue, 01 Aug 2006 16:18:37 +0300 +Date: Tue, 1 Aug 2006 16:18:37 +0300 +From: Eugeny N Dzhurinsky +To: pgsql-performance@postgresql.org +Subject: Query/database optimization +Message-ID: <20060801131837.GC4221@office.redwerk.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=koi8-r +Content-Disposition: inline +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/5 +X-Sequence-Number: 20190 + +Hello, I have a query: + +explain analyze select tu.url_id, tu.url, coalesce(sd.recurse, 100), case when +COALESCE(get_option('use_banner')::integer,0) = 0 then 0 else ts.use_banner +end as use_banner, ts.use_cookies, ts.use_robots, ts.includes, ts.excludes, +ts.track_domain, ts.task_id,get_available_pages(ts.task_id,ts.customer_id), +ts.redirects from task_url tu inner join task_scheduler ts on +tu.task_id=ts.task_id inner join (subscription s inner join subscription_dic +sd on sd.id=s.dict_id ) on s.customer_id=ts.customer_id inner join customer +c on c.customer_id=ts.customer_id AND c.active WHERE +get_available_pages(ts.task_id,ts.customer_id) > 0 AND +((get_option('expired_users')::integer = 0) OR (isfinite(last_login) AND +extract('day' from current_timestamp - last_login)::integer <= +coalesce(get_option('expired_users')::integer,100))) AND ((s.status is null +AND ts.customer_id is null) OR s.status > 0) AND +(get_check_period(ts.task_id,ts.next_check) is null OR +(unix_timestamp(get_check_period(ts.task_id,ts.next_check)) - +unix_timestamp(timenow()) < 3600)) AND ts.status <> 1 AND ((ts.start_time < +current_time AND ts.stop_time > current_time) OR (ts.start_time is null AND +ts.stop_time is null)) AND tu.url_id = 1 AND ts.customer_id not in (select +distinct customer_id from task_scheduler where status = 1) order by +ts.next_check is not null, unix_timestamp(ts.next_check) - +unix_timestamp(timenow()) limit 10; + +which produces this query plan: + Limit (cost=2874.98..2874.99 rows=2 width=88) (actual time=11800.535..11800.546 rows=3 loops=1) + -> Sort (cost=2874.98..2874.99 rows=2 width=88) (actual time=11800.529..11800.532 rows=3 loops=1) + Sort Key: (ts.next_check IS NOT NULL), (date_part('epoch'::text, ts.next_check) - date_part('epoch'::text, (timenow())::timestamp without time zone)) + -> Nested Loop (cost=4.37..2874.97 rows=2 width=88) (actual time=10249.115..11800.486 rows=3 loops=1) + -> Nested Loop (cost=4.37..2868.87 rows=2 width=55) (actual time=10247.721..11796.303 rows=3 loops=1) + Join Filter: ("inner".id = "outer".dict_id) + -> Nested Loop (cost=2.03..2865.13 rows=2 width=55) (actual time=10247.649..11796.142 rows=3 loops=1) + Join Filter: ((("inner".status IS NULL) AND ("outer".customer_id IS NULL)) OR ("inner".status > 0)) + -> Nested Loop (cost=2.03..2858.34 rows=2 width=55) (actual time=10247.583..11795.936 rows=3 loops=1) + -> Seq Scan on customer c (cost=0.00..195.71 rows=231 width=4) (actual time=0.082..154.344 rows=4161 loops=1) + Filter: (active AND isfinite(last_login) AND ((date_part('day'::text, (('now'::text)::timestamp(6) with time zone - (last_login)::timestamp with time zone)))::integer <= 150)) + -> Index Scan using task_scheduler_icustomer_id on task_scheduler ts (cost=2.03..11.51 rows=1 width=51) (actual time=2.785..2.785 rows=0 loops=4161) + Index Cond: ("outer".customer_id = ts.customer_id) + Filter: ((get_available_pages(task_id, customer_id) > 0) AND ((get_check_period(task_id, next_check) IS NULL) OR ((date_part('epoch'::text, get_check_period(task_id, next_check)) - date_part('epoch'::text, (timenow())::timestamp without time zone)) < 3600::double precision)) AND (status <> 1) AND ((((start_time)::time with time zone < ('now'::text)::time(6) with time zone) AND ((stop_time)::time with time zone > ('now'::text)::time(6) with time zone)) OR ((start_time IS NULL) AND (stop_time IS NULL))) AND (NOT (hashed subplan))) + SubPlan + -> Unique (cost=2.02..2.03 rows=1 width=4) (actual time=0.617..0.631 rows=3 loops=1) + -> Sort (cost=2.02..2.03 rows=1 width=4) (actual time=0.613..0.617 rows=3 loops=1) + Sort Key: customer_id + -> Index Scan using task_scheduler_istatus on task_scheduler (cost=0.00..2.01 rows=1 width=4) (actual time=0.044..0.580 rows=3 loops=1) + Index Cond: (status = 1) + -> Index Scan using subscription_icustomer_id on subscription s (cost=0.00..3.38 rows=1 width=12) (actual time=0.035..0.041 rows=1 loops=3) + Index Cond: ("outer".customer_id = s.customer_id) + -> Materialize (cost=2.34..2.65 rows=31 width=8) (actual time=0.008..0.027 rows=6 loops=3) + -> Seq Scan on subscription_dic sd (cost=0.00..2.31 rows=31 width=8) (actual time=0.013..0.034 rows=6 loops=1) + -> Index Scan using task_url_storage_task_id on task_url tu (cost=0.00..3.03 rows=1 width=37) (actual time=0.028..0.045 rows=1 loops=3) + Index Cond: (tu.task_id = "outer".task_id) + Filter: (url_id = 1) + Total runtime: 11801.082 ms +(28 rows) + + +Do I need to optimize a query somehow, or it is related to database +configuration? + +I'm running postgresql 8.0.0 on CentOS release 3.7 + +-- +Eugene N Dzhurinsky + +From pgsql-performance-owner@postgresql.org Tue Aug 1 13:15:50 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AD88E9FB376 + for ; + Tue, 1 Aug 2006 13:15:49 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 65398-01 for + ; + Tue, 1 Aug 2006 13:15:44 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 312AD9FB373 + for ; + Tue, 1 Aug 2006 13:15:44 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mis010-1.exch010.intermedia.net + (mis010-1.exch010.intermedia.net [64.78.61.91]) + by svr4.postgresql.org (Postfix) with ESMTP id 4DE895AFB5C + for ; + Tue, 1 Aug 2006 16:15:42 +0000 (GMT) +Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by + mis010-1.exch010.intermedia.net with Microsoft + SMTPSVC(6.0.3790.1830); Tue, 1 Aug 2006 09:15:36 -0700 +Content-class: urn:content-classes:message +Subject: PITR performance overhead? +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Date: Tue, 1 Aug 2006 09:15:41 -0700 +Message-ID: + <8C5B026B51B6854CBE88121DBF097A863329F2@ehost010-33.exch010.intermedia.net> +X-MimeOLE: Produced By Microsoft Exchange V6.5 +In-Reply-To: <20060731170833.GH2900@mathom.us> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: PITR performance overhead? +Thread-Index: Aca0xA0OH5cIEveXSEqKqX6GpTzC3QAwJTXA +From: "George Pavlov" +To: +X-OriginalArrivalTime: 01 Aug 2006 16:15:36.0925 (UTC) + FILETIME=[B93628D0:01C6B585] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/7 +X-Sequence-Number: 20192 + +I am looking for some general guidelines on what is the performance +overhead of enabling point-in-time recovery (archive_command config) on +an 8.1 database. Obviously it will depend on a multitude of factors, but +some broad-brush statements and/or anecdotal evidence will suffice. +Should one worry about its performance implications? Also, what can one +do to mitigate it?=20 + +Thanks, + +George + +From pgsql-performance-owner@postgresql.org Tue Aug 1 13:59:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 155EF9FB1FD + for ; + Tue, 1 Aug 2006 13:59:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 71246-05 for + ; + Tue, 1 Aug 2006 13:59:01 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx00.pub.collaborativefusion.com + (mx00.pub.collaborativefusion.com [206.210.89.199]) + by postgresql.org (Postfix) with ESMTP id A56E59FB1F3 + for ; + Tue, 1 Aug 2006 13:59:00 -0300 (ADT) +Received: from collaborativefusion.com (mx01.pub.collaborativefusion.com + [206.210.89.201]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) + by wingspan with esmtp; Tue, 01 Aug 2006 12:58:59 -0400 + id 00056425.44CF8853.00011CE9 +Received: from Internal Mail-Server (206.210.89.202) by mx01 (envelope-from + wmoran@collaborativefusion.com) + with AES256-SHA encrypted SMTP; 1 Aug 2006 12:55:28 -0400 +Date: Tue, 1 Aug 2006 12:59:00 -0400 +From: Bill Moran +To: "George Pavlov" +Cc: pgsql-performance@postgresql.org +Subject: Re: PITR performance overhead? +Message-Id: <20060801125900.30430a9f.wmoran@collaborativefusion.com> +In-Reply-To: + <8C5B026B51B6854CBE88121DBF097A863329F2@ehost010-33.exch010.intermedia.net> +References: <20060731170833.GH2900@mathom.us> + <8C5B026B51B6854CBE88121DBF097A863329F2@ehost010-33.exch010.intermedia.net> +Organization: Collaborative Fusion +X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.8.20; i386-portbld-freebsd6.1) +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/8 +X-Sequence-Number: 20193 + +In response to "George Pavlov" : + +> I am looking for some general guidelines on what is the performance +> overhead of enabling point-in-time recovery (archive_command config) on +> an 8.1 database. Obviously it will depend on a multitude of factors, but +> some broad-brush statements and/or anecdotal evidence will suffice. +> Should one worry about its performance implications? Also, what can one +> do to mitigate it? + +Prior to implementing PITR, I did some testing to see what kind of +overhead it would add. It was negligible. I don't remember the details, +but I seem to remember the performance hit was barely measurable. + +Note that in our usage scenarios, we have very little IO compared to +CPU usage. The result is that our DB servers have plenty of disk +bandwidth to spare. Since the log backup occurs as a background +process, it made almost no difference in our tests. If your DB is +very IO intensive, you may have different results. + +-- +Bill Moran +Collaborative Fusion Inc. + +**************************************************************** +IMPORTANT: This message contains confidential information and is +intended only for the individual named. If the reader of this +message is not an intended recipient (or the individual +responsible for the delivery of this message to an intended +recipient), please be advised that any re-use, dissemination, +distribution or copying of this message is prohibited. Please +notify the sender immediately by e-mail if you have received +this e-mail by mistake and delete this e-mail from your system. +E-mail transmission cannot be guaranteed to be secure or +error-free as information could be intercepted, corrupted, lost, +destroyed, arrive late or incomplete, or contain viruses. The +sender therefore does not accept liability for any errors or +omissions in the contents of this message, which arise as a +result of e-mail transmission. +**************************************************************** + +From pgsql-performance-owner@postgresql.org Tue Aug 1 14:26:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5199E9FB2B6 + for ; + Tue, 1 Aug 2006 14:26:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 75315-06 for + ; + Tue, 1 Aug 2006 14:26:24 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 4A9CB9FA64B + for ; + Tue, 1 Aug 2006 14:26:23 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 1CF8D56435; Tue, 1 Aug 2006 12:26:19 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Tue, 1 Aug 2006 12:26:17 -0500 +Date: Tue, 1 Aug 2006 12:26:17 -0500 +From: "Jim C. Nasby" +To: "Joshua D. Drake" +Cc: Jochem van Dieten , + pgsql-performance@postgresql.org +Subject: Re: PostgreSQL scalability on Sun UltraSparc T1 +Message-ID: <20060801172617.GN40481@pervasive.com> +References: <44CB7896.8030501@oli.tudelft.nl> + <44CB8235.9070903@commandprompt.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44CB8235.9070903@commandprompt.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060801:jd@commandprompt.com::AFOM2IyAp90SAIO5:00000000000000000 + 0000000000000000000000005cRe +X-Hashcash: + 1:20:060801:jochemd@oli.tudelft.nl::+mIumHTv+/TMPYTT:000000000000000 + 0000000000000000000000005RFD +X-Hashcash: + 1:20:060801:pgsql-performance@postgresql.org::kktPgrXuEIbedTIT:00000 + 0000000000000000000000002TCU +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.066 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/9 +X-Sequence-Number: 20194 + +On Sat, Jul 29, 2006 at 08:43:49AM -0700, Joshua D. Drake wrote: +> Jochem van Dieten wrote: +> >Tweakers.net has done a database performance test between a Sun T2000 (8 +> >core T1) and a Sun X4200 (2 dual core Opteron 280). The database +> >benchmark is developed inhouse and represents the average query pattern +> >from their website. It is MySQL centric because Tweakers.net runs on +> >MySQL, but Arjen van der Meijden has ported it to PostgreSQL and has +> >done basic optimizations like adding indexes. +> > +> >Arjen wrote about some of the preliminary results previously in +> >http://archives.postgresql.org/pgsql-performance/2006-06/msg00358.php +> >but the article has now been published http://tweakers.net/reviews/633/7 +> >This is all the more impressive if you scroll down and look at the +> >behaviour of MySQL (after tweaking by both MySQL AB and Sun). +> +> I would love to get my hands on that postgresql version and see how much +> farther it could be optimized. + +I'd love to get an english translation that we could use for PR. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 1 14:49:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DAA029FA682 + for ; + Tue, 1 Aug 2006 14:49:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 86019-04 for + ; + Tue, 1 Aug 2006 14:49:24 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from olive.qinip.net (olive.qinip.net [62.100.30.40]) + by postgresql.org (Postfix) with ESMTP id B288F9FA612 + for ; + Tue, 1 Aug 2006 14:49:23 -0300 (ADT) +Received: from [127.0.0.1] (h8441139206.dsl.speedlinq.nl [84.41.139.206]) + by olive.qinip.net (Postfix) with ESMTP id 4571D18233; + Tue, 1 Aug 2006 19:49:19 +0200 (MEST) +Message-ID: <44CF9422.5090406@tweakers.net> +Date: Tue, 01 Aug 2006 19:49:22 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: "Jim C. Nasby" +CC: "Joshua D. Drake" , + Jochem van Dieten , + pgsql-performance@postgresql.org +Subject: Re: PostgreSQL scalability on Sun UltraSparc T1 +References: <44CB7896.8030501@oli.tudelft.nl> + <44CB8235.9070903@commandprompt.com> + <20060801172617.GN40481@pervasive.com> +In-Reply-To: <20060801172617.GN40481@pervasive.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Antivirus: avast! (VPS 0631-1, 01-08-2006), Outbound message +X-Antivirus-Status: Clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.275 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/10 +X-Sequence-Number: 20195 + +On 1-8-2006 19:26, Jim C. Nasby wrote: +> On Sat, Jul 29, 2006 at 08:43:49AM -0700, Joshua D. Drake wrote: +> +> I'd love to get an english translation that we could use for PR. + +Actually, we have an english version of the Socket F follow-up. +http://tweakers.net/reviews/638 which basically displays the same +results for Postgres vs MySQL. +If and when a translation of the other article arrives, I don't know. +Other follow-up stories will follow as well, whether and how soon those +will be translated, I also don't know. We are actually pretty interested +in doing so, but its a lot of work to translate correctly :) + +Best regards, + +Arjen + +From pgsql-performance-owner@postgresql.org Tue Aug 1 15:10:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8387C9FB1E3 + for ; + Tue, 1 Aug 2006 15:10:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 89964-09 for + ; + Tue, 1 Aug 2006 15:10:07 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.183]) + by postgresql.org (Postfix) with ESMTP id 308CB9FB20C + for ; + Tue, 1 Aug 2006 15:10:04 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id b36so1028938pyb + for ; + Tue, 01 Aug 2006 11:09:59 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:to:subject:mime-version:content-type; + b=Q7yWDjOpMYbgE229VIf+HGLy7Vi55KSlAIojMbBNkf1XcblKfp82d+BM14AQ8CfwHRUYj5/t/gC6k0jc4jn2Cv7MIFdiuOCHSf6usGKKbqyanBXRht1VNVBxr2o4aHSUFXmMZSHHFBeb8LgTjJkr9t6NENvUZskBpO1+sTjwLM8= +Received: by 10.35.126.7 with SMTP id d7mr6113483pyn; + Tue, 01 Aug 2006 11:09:54 -0700 (PDT) +Received: by 10.35.100.7 with HTTP; Tue, 1 Aug 2006 11:09:54 -0700 (PDT) +Message-ID: <4d6d2c130608011109k2759ae60wd6dd89bff2e8e4a9@mail.gmail.com> +Date: Tue, 1 Aug 2006 14:09:54 -0400 +From: tlm +To: pgsql-performance@postgresql.org +Subject: How to speed up this "translation" query? +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_86901_28303562.1154455794530" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.574 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/11 +X-Sequence-Number: 20196 + +------=_Part_86901_28303562.1154455794530 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I need some expert advice on how to optimize a "translation" query (this +word choice will become clear shortly, I hope). + +Say I have a HUMONGOUS table of foreign language "translations" (call it +TRANS) with records like these: + +meaning_id: 1 +language_id: 5 +translation: jidoosha + +meaning_id: 1 +language_id: 2 +translation: voiture + + meaning_id: 1 +language_id: 5 +translation: kuruma + +meaning_id: 2 +language_id: 2 +translation: chat + +meaning_id: 2 +language_id: 5 +translation: neko + +meaning_id: 2 +language_id: 3 +translation: katz + +meaning_id: 3 +language_id: 4 +translation: pesce + + meaning_id: 3 +language_id: 2 +translation: poisson + + meaning_id: 3 +language_id: 5 +translation: sakana + +For the sake of this description, let's assume that the records above are +all the records in TRANS (though in fact the number of records in TRANS is +really about ten million times greater). + +Now suppose I have a tiny table called INPUT consisting of single text field +(say, word). E.g. suppose that INPUT looks like this: + +katz + voiture +pesce + +Now, let's fix a language_id, say 5. This is the "target" language_id. +Given this target language_id, and this particular INPUT table, I want the +results of the query to be something like this: + +neko +jidoosha +kuruma +sakana + +I.e. for each word W in INPUT, the query must first find each record R in +TRANS that has W as its translation field; then find each record Q in +TRANS whose language_id is 5 (the target language_id) AND has the same +meaning_id as R does. E.g. if W is 'katz', then R is + + meaning_id: 2 +language_id: 3 +translation: katz + +and therefore the desired Q is + + meaning_id: 2 +language_id: 5 +translation: neko + +...and so on. + +The only difficulty here is that performance is critical, and in real +life, TRANS has around 50M records (and growing), while INPUT has +typically between 500 and 1000 records. + +Any advice on how to make this as fast as possible would be much +appreciated. + +Thanks! + +G. + +P.S. Just to show that this post is not just from a college student trying +to get around doing homework, below I post my most successful query so far. +It works, but it's performance isn't great. And it is annoyingly complex, +to boot; I'm very much the SQL noob, and if nothing else, at least I'd like +to learn to write "better" (i.e. more elegant, more legible, more +clueful) SQL that this: + +SELECT q3.translation, q2.otherstuff +FROM +( + SELECT INPUT.word, q1.meaning_id, INPUT.otherstuff + FROM + INPUT + INNER JOIN + ( + SELECT translation, meaning_id + FROM TRANS + WHERE translation IN (SELECT word FROM INPUT) + ) AS q1 + ON INPUT.word = q1.translation +) AS q2 +LEFT JOIN +( + SELECT translation, meaning_id + FROM TRANS + WHERE language_id=5 +) AS q3 +ON q2.meaning_id=q3.meaning_id; + +As you can see, there are additional fields that I didn't mention in my +original description (e.g. INPUT.otherstuff). Also the above is actually a +subquery in a larger query, but it is by far, the worst bottleneck. Last, +there's an index on TRANS(translation). + +------=_Part_86901_28303562.1154455794530 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +
I need some expert advice on how to optimize a "translation" query (this word choice will become clear shortly, I hope).
+
 
+
Say I have a HUMONGOUS table of foreign language "translations" (call it TRANS) with records like these:
+
 
+
meaning_id: 1
+
language_id: 5
+
translation: jidoosha
+
 
+
meaning_id: 1
+
language_id: 2
+
translation: voiture
+
 
+
+
meaning_id: 1
+
language_id: 5
+
translation: kuruma
+
 
+
meaning_id: 2
+
language_id: 2
+
translation: chat
+
 
+
meaning_id: 2
+
language_id: 5
+
translation: neko
+
 
+
meaning_id: 2
+
language_id: 3
+
translation: katz
+
 
+
meaning_id: 3
+
language_id: 4
+
translation: pesce
+
 
+
+
meaning_id: 3
+
language_id: 2
+
translation: poisson
+
 
+
+
meaning_id: 3
+
language_id: 5
+
translation: sakana
+
 
+
For the sake of this description, let's assume that the records above are all the records in TRANS (though in fact the number of records in TRANS is really about ten million times greater).
+
 
+
Now suppose I have a tiny table called INPUT consisting of single text field (say, word).  E.g. suppose that INPUT looks like this:
+
 
+
katz
+
+
voiture
pesce
+
 
+
Now, let's fix a language_id, say 5.  This is the "target" language_id.  Given this target language_id, and this particular INPUT table, I want the results of the query to be something like this:
+
 
+
neko
+
jidoosha
+
kuruma
+
sakana
+
 
+
I.e. for each word W in INPUT, the query must first find each record R in TRANS that has W as its translation field; then find each record Q in TRANS whose language_id is 5 (the target language_id) AND has the same meaning_id as R does.  +E.g. if W is 'katz', then R is
+
 
+
+
meaning_id: 2
+
language_id: 3
+
translation: katz
+
 
+
and therefore the desired Q is
+
 
+
+
meaning_id: 2
+
language_id: 5
+
translation: neko
+
 
+
...and so on.
+
 
+
The only difficulty here is that performance is critical, and in real life, TRANS has around 50M records (and growing), while INPUT has typically between 500 and 1000 records.
+
 
+
Any advice on how to make this as fast as possible would be much appreciated.
+
 
+
Thanks!
+
 
+
G.
+
 
+
P.S.  Just to show that this post is not just from a college student trying to get around doing homework, below I post my most successful query so far.  It works, but it's performance isn't great.  And it is annoyingly complex, to boot; I'm very much the SQL noob, and if nothing else, at least I'd like to learn to write "better" ( +i.e. more elegant, more legible, more clueful) SQL that this:
+
 
+
SELECT q3.translation, q2.otherstuff
FROM
(
  SELECT INPUT.word, q1.meaning_id, INPUT.otherstuff
  FROM
  INPUT
  INNER JOIN
  (
    SELECT translation, meaning_id
    FROM TRANS
    WHERE translation IN (SELECT word FROM INPUT) +
  ) AS q1
  ON INPUT.word = q1.translation
) AS q2
LEFT JOIN
(
  SELECT translation, meaning_id
  FROM TRANS
  WHERE language_id=5
) AS q3
ON q2.meaning_id=q3.meaning_id;
 
+
As you can see, there are additional fields that I didn't mention in my original description (e.g. INPUT.otherstuff).  Also the above is actually a subquery in a larger query, but it is by far, the worst bottleneck.  Last, there's an index on TRANS(translation). +
+
 
+ +------=_Part_86901_28303562.1154455794530-- + +From pgsql-performance-owner@postgresql.org Tue Aug 1 15:40:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2EBC59FB20C + for ; + Tue, 1 Aug 2006 15:40:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 11176-06 for + ; + Tue, 1 Aug 2006 15:39:50 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 6FE969FB2B8 + for ; + Tue, 1 Aug 2006 15:39:50 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from alimail.net (potatis.alimail.net [84.19.131.11]) + by svr4.postgresql.org (Postfix) with ESMTP id AF8D35AFB30 + for ; + Tue, 1 Aug 2006 18:39:49 +0000 (GMT) +Received: from [192.168.1.10] ([84.19.128.181]) + by alimail.net (alimail.net [10.1.8.71]) (MDaemon.PRO.v8.0.4.R) + with ESMTP id md50000713450.msg + for ; Tue, 01 Aug 2006 20:38:40 +0200 +In-Reply-To: <4d6d2c130608011109k2759ae60wd6dd89bff2e8e4a9@mail.gmail.com> +References: <4d6d2c130608011109k2759ae60wd6dd89bff2e8e4a9@mail.gmail.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Cc: pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Niklas Johansson +Subject: Re: How to speed up this "translation" query? +Date: Tue, 1 Aug 2006 20:38:38 +0200 +To: tlm +X-Mailer: Apple Mail (2.752.2) +X-Spam-Processed: alimail.net, Tue, 01 Aug 2006 20:38:40 +0200 + (not processed: message from trusted or authenticated source) +X-MDRemoteIP: 84.19.128.181 +X-Return-Path: spot@tele2.se +X-MDaemon-Deliver-To: pgsql-performance@postgresql.org +Reply-To: spot@tele2.se +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/12 +X-Sequence-Number: 20197 + + +On 1 aug 2006, at 20.09, tlm wrote: +> SELECT q3.translation, q2.otherstuff +> FROM +> ( +> SELECT INPUT.word, q1.meaning_id, INPUT.otherstuff +> FROM +> INPUT +> INNER JOIN +> ( +> SELECT translation, meaning_id +> FROM TRANS +> WHERE translation IN (SELECT word FROM INPUT) +> ) AS q1 +> ON INPUT.word = q1.translation +> ) AS q2 +> LEFT JOIN +> ( +> SELECT translation, meaning_id +> FROM TRANS +> WHERE language_id=5 +> ) AS q3 +> ON q2.meaning_id=q3.meaning_id; + +Maybe I'm not following you properly, but I think you've made things +a little bit more complicated than they need to be. The nested sub- +selects look a little nasty. + +Now, you didn't provide any explain output but I think the following +SQL will achieve the same result, and hopefully produce a better plan: + +SELECT t2.translation, i.otherstuff +FROM input i INNER JOIN trans t ON i.word=t.translation +INNER JOIN trans t2 ON t.meaning_id=t2.meaning_id +WHERE t2.language_id=5; + +The query will also benefit from indices on trans.meaning_id and +trans.language_id. Also make sure the tables are vacuumed and +analyzed, to allow the planner to make good estimates. + + + +Sincerely, + +Niklas Johansson + + + + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 18:50:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 996509FB218 + for ; + Tue, 1 Aug 2006 18:50:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 44918-05 for + ; + Tue, 1 Aug 2006 18:50:00 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.de [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id 37FF79FB20E + for ; + Tue, 1 Aug 2006 18:49:58 -0300 (ADT) +Received: (qmail invoked by alias); 01 Aug 2006 21:49:56 -0000 +Received: from dslb-084-057-008-210.pools.arcor-ip.net (EHLO ltmku) + [84.57.8.210] + by mail.gmx.net (mp032) with SMTP; 01 Aug 2006 23:49:56 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: +Subject: XFS filessystem for Datawarehousing +Date: Tue, 1 Aug 2006 23:49:56 +0200 +Message-ID: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/13 +X-Sequence-Number: 20198 + +I intend to test Postgres/Bizgres for DWH use. I want to use XFS filesystem to get the best possible performance at FS +level(correct me if I am wrong !). + +Is anyone using XFS for storing/retrieving relatively large amount of data (~ 200GB)? + +If yes, what about the performance and stability of XFS. +I am especially interested in recommendations about XFS mount options and mkfs.xfs options. +My setup will be roughly this: +1) 4 SCSI HDD , 128GB each, +2) RAID 0 on the four SCSI HDD disks using LVM (software RAID) + +There are two other SATA HDD in the server. Server has 2 physical CPUs (XEON at 3 GHz), 4 Logical CPUs, 8 GB RAM, OS += SLES9 SP3 + +My questions: +1) Should I place external XFS journal on separate device ? +2) What should be the journal buffer size (logbsize) ? +3) How many journal buffers (logbufs) should I configure ? +4) How many allocations groups (for mkfs.xfs) should I configure +5) Is it wortj settion noatime ? +6) What I/O scheduler(elevators) should I use (massive sequencial reads) +7) What is the ideal stripe unit and width (for a RAID device) ? + +I will appreciate any options, suggestions, pointers. + +Best Regards. +Milen Kulev + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 19:19:56 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 32C679FB2B9 + for ; + Tue, 1 Aug 2006 19:19:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 50954-03 for + ; + Tue, 1 Aug 2006 19:19:49 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.net [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id 10EB69FB1D4 + for ; + Tue, 1 Aug 2006 19:19:48 -0300 (ADT) +Received: (qmail invoked by alias); 01 Aug 2006 22:19:46 -0000 +Received: from dslb-084-057-006-224.pools.arcor-ip.net (EHLO ltmku) + [84.57.6.224] + by mail.gmx.net (mp010) with SMTP; 02 Aug 2006 00:19:46 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: +Subject: FW: XFS filessystem for Datawarehousing -2 +Date: Wed, 2 Aug 2006 00:19:46 +0200 +Message-ID: <014401c6b5b8$98926a20$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.067 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/14 +X-Sequence-Number: 20199 + +Sorry, forgot to ask: +What is the recommended/best PG block size for DWH database? 16k, 32k, 64k ? +What hsould be the relation between XFS/RAID stripe size and PG block size ? + +Best Regards. +Milen Kulev + + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Milen Kulev +Sent: Tuesday, August 01, 2006 11:50 PM +To: pgsql-performance@postgresql.org +Subject: [PERFORM] XFS filessystem for Datawarehousing + + +I intend to test Postgres/Bizgres for DWH use. I want to use XFS filesystem to get the best possible performance at FS +level(correct me if I am wrong !). + +Is anyone using XFS for storing/retrieving relatively large amount of data (~ 200GB)? + +If yes, what about the performance and stability of XFS. +I am especially interested in recommendations about XFS mount options and mkfs.xfs options. My setup will be roughly +this: +1) 4 SCSI HDD , 128GB each, +2) RAID 0 on the four SCSI HDD disks using LVM (software RAID) + +There are two other SATA HDD in the server. Server has 2 physical CPUs (XEON at 3 GHz), 4 Logical CPUs, 8 GB RAM, OS += SLES9 SP3 + +My questions: +1) Should I place external XFS journal on separate device ? +2) What should be the journal buffer size (logbsize) ? +3) How many journal buffers (logbufs) should I configure ? +4) How many allocations groups (for mkfs.xfs) should I configure +5) Is it wortj settion noatime ? +6) What I/O scheduler(elevators) should I use (massive sequencial reads) +7) What is the ideal stripe unit and width (for a RAID device) ? + +I will appreciate any options, suggestions, pointers. + +Best Regards. +Milen Kulev + + +---------------------------(end of broadcast)--------------------------- +TIP 4: Have you searched our list archives? + + http://archives.postgresql.org + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 20:47:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1EC6B9FB37C + for ; + Tue, 1 Aug 2006 20:47:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 59882-08 for + ; + Tue, 1 Aug 2006 20:46:57 -0300 (ADT) +X-Greylist: delayed 00:59:57.072456 by SQLgrey- +Received: from mx1.neopolitan.us (mx1.neopolitan.us [65.87.16.224]) + by postgresql.org (Postfix) with ESMTP id 49B1C9FB1C3 + for ; + Tue, 1 Aug 2006 20:46:57 -0300 (ADT) +Received: from [71.131.197.149] (account jrogers@neopolitan.com HELO + [192.168.2.87]) by mx1.neopolitan.us (CommuniGate Pro SMTP 4.2.10) + with ESMTP-TLS id 13559684; Tue, 01 Aug 2006 15:46:56 -0700 +In-Reply-To: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> +References: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +X-Priority: 3 (Normal) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Cc: "Pgsql-Performance ((E-mail))" +Content-Transfer-Encoding: 7bit +From: "J. Andrew Rogers" +Subject: Re: XFS filessystem for Datawarehousing +Date: Tue, 1 Aug 2006 15:46:54 -0700 +To: "Milen Kulev" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/17 +X-Sequence-Number: 20202 + + +On Aug 1, 2006, at 2:49 PM, Milen Kulev wrote: +> Is anyone using XFS for storing/retrieving relatively large amount +> of data (~ 200GB)? + + +Yes, we've been using it on Linux since v2.4 (currently v2.6) and it +has been rock solid on our database servers (Opterons, running in +both 32-bit and 64-bit mode). Our databases are not quite 200GB +(maybe 75GB for a big one currently), but ballpark enough that the +experience is probably valid. We also have a few terabyte+ non- +database XFS file servers too. + +Performance has been very good even with nearly full file systems, +and reliability has been perfect so far. Some of those file systems +get used pretty hard for months or years non-stop. Comparatively, I +can only tell you that XFS tends to be significantly faster than +Ext3, but we never did any serious file system tuning either. + +Knowing nothing else, my experience would suggest that XFS is a fine +and safe choice for your application. + + +J. Andrew Rogers + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 20:00:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6242F9FB380 + for ; + Tue, 1 Aug 2006 20:00:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 55931-10 for + ; + Tue, 1 Aug 2006 20:00:00 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.de [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id 89A0C9FB382 + for ; + Tue, 1 Aug 2006 19:59:59 -0300 (ADT) +Received: (qmail invoked by alias); 01 Aug 2006 22:59:57 -0000 +Received: from dslb-084-057-006-224.pools.arcor-ip.net (EHLO ltmku) + [84.57.6.224] + by mail.gmx.net (mp030) with SMTP; 02 Aug 2006 00:59:57 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: "'J. Andrew Rogers'" +Cc: "'Pgsql-Performance \(\(E-mail\)\)'" +Subject: Re: XFS filessystem for Datawarehousing +Date: Wed, 2 Aug 2006 00:59:56 +0200 +Message-ID: <014701c6b5be$3587be20$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +In-Reply-To: +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.126 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/15 +X-Sequence-Number: 20200 + +Hi Andrew, +Thank you for your prompt reply. +Are you using some special XFS options ? +I mean special values for logbuffers bufferiosize , extent size preallocations etc ? +I will have only 6 big tables and about 20 other relatively small (fact aggregation) tables (~ 10-20 GB each). +I believe it should be a a good idea to use as much contigious chunks of space (from OS point of view) as possible in +order to make full table scans as fast as possible. + + +Best Regards, +Milen Kulev + +-----Original Message----- +From: J. Andrew Rogers [mailto:jrogers@neopolitan.com] +Sent: Wednesday, August 02, 2006 12:47 AM +To: Milen Kulev +Cc: Pgsql-Performance ((E-mail)) +Subject: Re: [PERFORM] XFS filessystem for Datawarehousing + + + +On Aug 1, 2006, at 2:49 PM, Milen Kulev wrote: +> Is anyone using XFS for storing/retrieving relatively large amount +> of data (~ 200GB)? + + +Yes, we've been using it on Linux since v2.4 (currently v2.6) and it +has been rock solid on our database servers (Opterons, running in +both 32-bit and 64-bit mode). Our databases are not quite 200GB +(maybe 75GB for a big one currently), but ballpark enough that the +experience is probably valid. We also have a few terabyte+ non- +database XFS file servers too. + +Performance has been very good even with nearly full file systems, +and reliability has been perfect so far. Some of those file systems +get used pretty hard for months or years non-stop. Comparatively, I +can only tell you that XFS tends to be significantly faster than +Ext3, but we never did any serious file system tuning either. + +Knowing nothing else, my experience would suggest that XFS is a fine +and safe choice for your application. + + +J. Andrew Rogers + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 20:07:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 742D69FB1D4 + for ; + Tue, 1 Aug 2006 20:07:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 58545-02 for + ; + Tue, 1 Aug 2006 20:07:21 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from web88003.mail.re2.yahoo.com (web88003.mail.re2.yahoo.com + [206.190.37.190]) + by postgresql.org (Postfix) with SMTP id 51A979FB1C3 + for ; + Tue, 1 Aug 2006 20:07:21 -0300 (ADT) +Received: (qmail 82779 invoked by uid 60001); 1 Aug 2006 23:07:11 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=LPoPSH/JXfxDZ6dV567G650W+D4t0YKczyd3v4zmKd/JIBgGH4KO/Z3hFgpTHkILYNnMC/gOmyc54bqbLByU1d1ym80jju6Wi1pVa+AhzwKyQDD+sBFtTTkFZlMvwM66OzVL7DCTD9I1xMkCs9P5IMvw/oWwopS4bLqmKskhiyI= + ; +Message-ID: <20060801230711.82777.qmail@web88003.mail.re2.yahoo.com> +Received: from [216.16.241.206] by web88003.mail.re2.yahoo.com via HTTP; + Tue, 01 Aug 2006 19:07:11 EDT +Date: Tue, 1 Aug 2006 19:07:11 -0400 (EDT) +From: H Hale +Subject: Re: sub select performance due to seq scans +To: pgsql-performance@postgresql.org +In-Reply-To: <20060731160902.37302.qmail@web88007.mail.re2.yahoo.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-1643884357-1154473631=:80469" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.204 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, HTML_40_50, HTML_MESSAGE +X-Spam-Level: *** +X-Archive-Number: 200608/16 +X-Sequence-Number: 20201 + +--0-1643884357-1154473631=:80469 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Not sure if this helps solve the problem but... + (see below) + + As new records are added Indexes are used for awhile and then at some point postgres switches to seq scan. It is repeatable. + + Any suggestions/comments to try and solve this are welcome. Thanks + + Data is as follows: + capsa.flatommemberrelation 1458 records + capsa.flatommemberrelation(srcobj) 3 distinct + capsa.flatommemberrelation(dstobj) 730 distinct + capsa.flatomfilesysentry 732 records + capsa.flatommemberrelation(objectid) 732 distinct + + capsa=# set enable_seqscan=on; + SET + Time: 0.599 ms + capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409'); + QUERY PLAN + ---------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=196.01..196.02 rows=1 width=0) (actual time=965.420..965.422 rows=1 loops=1) + -> Nested Loop IN Join (cost=0.00..194.19 rows=728 width=0) (actual time=3.373..964.371 rows=729 loops=1) + Join Filter: ("outer".objectid = "inner".dstobj) + -> Seq Scan on flatomfilesysentry (cost=0.00..65.28 rows=728 width=16) (actual time=0.007..1.505 rows=732 loops=1) + -> Seq Scan on flatommemberrelation (cost=0.00..55.12 rows=725 width=16) (actual time=0.004..0.848 rows=366 loops=732) + Filter: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid) + Total runtime: 965.492 ms + (7 rows) + + Time: 966.806 ms + +----------------------------------------------------------------------------------------------------------- + capsa=# set enable_seqscan=off; + SET + Time: 0.419 ms + capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409'); + QUERY PLAN + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=24847.73..24847.74 rows=1 width=0) (actual time=24.859..24.860 rows=1 loops=1) + -> Nested Loop (cost=90.05..24845.91 rows=728 width=0) (actual time=2.946..23.640 rows=729 loops=1) + -> Unique (cost=88.04..91.67 rows=363 width=16) (actual time=2.917..6.671 rows=729 loops=1) + -> Sort (cost=88.04..89.86 rows=725 width=16) (actual time=2.914..3.998 rows=729 loops=1) + Sort Key: flatommemberrelation.dstobj + -> Bitmap Heap Scan on flatommemberrelation (cost=7.54..53.60 rows=725 width=16) (actual time=0.260..1.411 rows=729 loops=1) + Recheck Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid) + -> Bitmap Index Scan on capsa_flatommemberrelation_srcobj_idx (cost=0.00..7.54 rows=725 width=0) (actual time=0.244..0.244 rows=729 loops=1) + Index Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid) + -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..63.64 rows=364 width=16) (actual time=0.014..0.015 rows=1 loops=729) + Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj) + -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=364 width=0) (actual time=0.009..0.009 rows=1 loops=729) + Index Cond: (flatomfilesysentry.objectid = "outer".dstobj) + Total runtime: 25.101 ms + (14 rows) + + Time: 26.878 ms + + + + + + +H Hale wrote: Tom, + + It is unique. + + Indexes: + "flatomfilesysentry_pkey" PRIMARY KEY, btree (objectid) + "capsa_flatomfilesysentry_name_idx" btree (name) + Foreign-key constraints: + "objectid" FOREIGN KEY (objectid) REFERENCES capsa_sys.master(objectid) ON DELETE CASCADE + + +Tom Lane wrote: H Hale writes: +> -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..274.38 rows=3238 width=30) (actual time=0.011..0.013 rows=1 loops=6473) +> Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj) +> -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=3238 width=0) (actual time=0.007..0.007 rows=1 loops=6473) +> Index Cond: (flatomfilesysentry.objectid = "outer".dstobj) + +Well, there's our estimation failure: 3238 rows expected, one row +actual. + +What is the data distribution of flatomfilesysentry.objectid? +It looks from this example like it is unique or nearly so, +but the planner evidently does not think that. + + regards, tom lane + +---------------------------(end of broadcast)--------------------------- +TIP 5: don't forget to increase your free space map settings + + + +--0-1643884357-1154473631=:80469 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Not sure if this helps solve the problem but...
(see below)

As new records are added Indexes are used for awhile  and then at some point postgres switches to seq scan. It is repeatable. 

Any suggestions/comments to try and solve this are welcome.  Thanks

Data is as follows:
capsa.flatommemberrelation 1458 records
capsa.flatommemberrelation(srcobj)  3 distinct
capsa.flatommemberrelation(dstobj)  730 distinct
capsa.flatomfilesysentry 732 records
capsa.flatommemberrelation(objectid)  732 distinct

capsa=# set enable_seqscan=on;
SET
Time: 0.599 ms
capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409');
+                                                             QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=196.01..196.02 rows=1 width=0) (actual time=965.420..965.422 rows=1 loops=1)
   ->  Nested Loop IN Join  (cost=0.00..194.19 rows=728 width=0) (actual time=3.373..964.371 rows=729 loops=1)
         Join Filter: ("outer".objectid = "inner".dstobj)
         ->  Seq Scan on flatomfilesysentry  (cost=0.00..65.28 rows=728 + width=16) (actual time=0.007..1.505 rows=732 loops=1)
         ->  Seq Scan on flatommemberrelation  (cost=0.00..55.12 rows=725 width=16) (actual time=0.004..0.848 rows=366 loops=732)
               Filter: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid)
 Total runtime: 965.492 ms
(7 rows)

Time: 966.806 ms

-----------------------------------------------------------------------------------------------------------
capsa=# set enable_seqscan=off;
SET
Time: 0.419 ms
capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409');
+                                                                                 QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=24847.73..24847.74 rows=1 width=0) (actual time=24.859..24.860 rows=1 loops=1)
   ->  Nested Loop  (cost=90.05..24845.91 rows=728 width=0) (actual time=2.946..23.640 rows=729 loops=1)
         ->  Unique  + (cost=88.04..91.67 rows=363 width=16) (actual time=2.917..6.671 rows=729 loops=1)
               ->  Sort  (cost=88.04..89.86 rows=725 width=16) (actual time=2.914..3.998 rows=729 loops=1)
                     Sort Key: flatommemberrelation.dstobj
                     ->  Bitmap Heap Scan on flatommemberrelation  (cost=7.54..53.60 rows=725 width=16) (actual time=0.260..1.411 rows=729 loops=1)
                           Recheck Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid)
+                            ->  Bitmap Index Scan on capsa_flatommemberrelation_srcobj_idx  (cost=0.00..7.54 rows=725 width=0) (actual time=0.244..0.244 rows=729 loops=1)
                                 Index Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid)
         ->  Bitmap Heap Scan on flatomfilesysentry  (cost=2.00..63.64 rows=364 width=16) (actual time=0.014..0.015 rows=1 loops=729)
               Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj)
+                ->  Bitmap Index Scan on flatomfilesysentry_pkey  (cost=0.00..2.00 rows=364 width=0) (actual time=0.009..0.009 rows=1 loops=729)
                     Index Cond: (flatomfilesysentry.objectid = "outer".dstobj)
 Total runtime: 25.101 ms
(14 rows)

Time: 26.878 ms






H Hale <hhale21@rogers.com> wrote:
Tom,

It is unique.

Indexes:
    "flatomfilesysentry_pkey" PRIMARY KEY, btree (objectid)
    "capsa_flatomfilesysentry_name_idx" btree (name)
Foreign-key constraints:
    "objectid" FOREIGN KEY (objectid) REFERENCES + capsa_sys.master(objectid) ON DELETE CASCADE


Tom Lane <tgl@sss.pgh.pa.us> wrote:
H Hale writes:
> -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..274.38 rows=3238 width=30) (actual time=0.011..0.013 rows=1 loops=6473)
> Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj)
> -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=3238 width=0) (actual time=0.007..0.007 rows=1 loops=6473)
> Index Cond: (flatomfilesysentry.objectid = "outer".dstobj)

Well, there's our estimation failure: 3238 rows expected, one row
actual.

What is the data distribution of flatomfilesysentry.objectid?
It looks from this example like it is unique or nearly so,
but the planner evidently does not think that.

+ regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


+--0-1643884357-1154473631=:80469-- + +From pgsql-performance-owner@postgresql.org Tue Aug 1 21:42:51 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5A9BE9FB1B9 + for ; + Tue, 1 Aug 2006 21:42:51 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 65931-03 for + ; + Tue, 1 Aug 2006 21:42:46 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 4F5F99FB1C3 + for ; + Tue, 1 Aug 2006 21:42:46 -0300 (ADT) +Received: from alvh.no-ip.org (200-126-100-4.bk7-dsl.surnet.cl + [200.126.100.4]) + (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k720gSxu028530; + Tue, 1 Aug 2006 17:42:29 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 87E3CC2F879; Tue, 1 Aug 2006 20:42:23 -0400 (CLT) +Date: Tue, 1 Aug 2006 20:42:23 -0400 +From: Alvaro Herrera +To: "J. Andrew Rogers" +Cc: Milen Kulev , + "Pgsql-Performance ((E-mail))" +Subject: Re: XFS filessystem for Datawarehousing +Message-ID: <20060802004223.GE20401@alvh.no-ip.org> +Mail-Followup-To: "J. Andrew Rogers" , + Milen Kulev , + "Pgsql-Performance ((E-mail))" +References: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> + +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 01 Aug 2006 17:42:33 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.895 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/18 +X-Sequence-Number: 20203 + +J. Andrew Rogers wrote: +> +> On Aug 1, 2006, at 2:49 PM, Milen Kulev wrote: +> >Is anyone using XFS for storing/retrieving relatively large amount +> >of data (~ 200GB)? +> +> +> Yes, we've been using it on Linux since v2.4 (currently v2.6) and it +> has been rock solid on our database servers (Opterons, running in +> both 32-bit and 64-bit mode). Our databases are not quite 200GB +> (maybe 75GB for a big one currently), but ballpark enough that the +> experience is probably valid. We also have a few terabyte+ non- +> database XFS file servers too. +> +> Performance has been very good even with nearly full file systems, +> and reliability has been perfect so far. Some of those file systems +> get used pretty hard for months or years non-stop. Comparatively, I +> can only tell you that XFS tends to be significantly faster than +> Ext3, but we never did any serious file system tuning either. + +Most likely ext3 was used on the default configuration, which logs data +operations as well as metadata, which is what XFS logs. I don't think +I've seen any credible comparison between XFS and ext3 with the +metadata-only journal option. + +On the other hand I don't think it makes sense to journal data on a +PostgreSQL environment. Metadata is enough, given that we log data on +WAL anyway. + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +PostgreSQL Replication, Consulting, Custom Development, 24x7 support + +From pgsql-performance-owner@postgresql.org Tue Aug 1 22:17:17 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C953B9FB37E + for ; + Tue, 1 Aug 2006 22:17:15 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 68246-05 for + ; + Tue, 1 Aug 2006 22:17:12 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.183]) + by postgresql.org (Postfix) with ESMTP id 8F0029FB36A + for ; + Tue, 1 Aug 2006 22:17:12 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id 39so1352120pyu + for ; + Tue, 01 Aug 2006 18:17:03 -0700 (PDT) +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=YC2czwhNW1Hox0OWW+idLx8NGor/M4Goy8HbGcQ1ykQmYVa7rtG5uLOWsYAUkUsqefIHLJmyv62TreMs3epgardGwof3tgRbpokatcUoBVqSTbvZpTXmii9KzhQ8HZ0SS0NIGvOGBoXnyb+ZYh6fR9A9kQr0bAa9hhW8IOmW1Ag= +Received: by 10.65.176.7 with SMTP id d7mr119896qbp; + Tue, 01 Aug 2006 18:17:02 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Tue, 1 Aug 2006 18:17:02 -0700 (PDT) +Message-ID: +Date: Tue, 1 Aug 2006 21:17:02 -0400 +From: "Merlin Moncure" +To: "George Pavlov" +Subject: Re: PITR performance overhead? +Cc: pgsql-performance@postgresql.org +In-Reply-To: + <8C5B026B51B6854CBE88121DBF097A863329F2@ehost010-33.exch010.intermedia.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <20060731170833.GH2900@mathom.us> + <8C5B026B51B6854CBE88121DBF097A863329F2@ehost010-33.exch010.intermedia.net> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.697 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/19 +X-Sequence-Number: 20204 + +On 8/1/06, George Pavlov wrote: +> I am looking for some general guidelines on what is the performance +> overhead of enabling point-in-time recovery (archive_command config) on +> an 8.1 database. Obviously it will depend on a multitude of factors, but +> some broad-brush statements and/or anecdotal evidence will suffice. +> Should one worry about its performance implications? Also, what can one +> do to mitigate it? + +pitr is extremely cheap both in performance drag and administation +overhead for the benefits it provides. it comes almost for free, just +make sure you can handle all the wal files and do sane backup +scheduling. in fact, pitr can actually reduce the load on a server +due to running less frequent backups. if your server is heavy i/o +loaded, it might take a bit of planning. + +merlin + +From pgsql-performance-owner@postgresql.org Tue Aug 1 23:06:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 0A3589FB208 + for ; + Tue, 1 Aug 2006 23:06:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 73565-01 for + ; + Tue, 1 Aug 2006 23:06:38 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from linda-2.paradise.net.nz (bm-2a.paradise.net.nz + [203.96.152.181]) + by postgresql.org (Postfix) with ESMTP id DC7A29FB1B8 + for ; + Tue, 1 Aug 2006 23:06:38 -0300 (ADT) +Received: from smtp-2.paradise.net.nz + (tclsnelb1-src-1.paradise.net.nz [203.96.152.172]) by + linda-2.paradise.net.nz (Paradise.net.nz) with ESMTP id + <0J3C004SWLV0ZH@linda-2.paradise.net.nz> for + pgsql-performance@postgresql.org; Wed, 02 Aug 2006 14:06:36 +1200 (NZST) +Received: from [192.168.1.11] + (218-101-28-176.dsl.clear.net.nz [218.101.28.176]) by + smtp-2.paradise.net.nz (Postfix) with ESMTP id 9DA943427A3; + Wed, 02 Aug 2006 14:06:35 +1200 (NZST) +Date: Wed, 02 Aug 2006 14:06:11 +1200 +From: Mark Kirkwood +Subject: Re: XFS filessystem for Datawarehousing +In-reply-to: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> +To: Milen Kulev +Cc: pgsql-performance@postgresql.org +Message-id: <44D00893.4060804@paradise.net.nz> +MIME-version: 1.0 +Content-type: text/plain; format=flowed; charset=ISO-8859-1 +Content-transfer-encoding: 7bit +User-Agent: Thunderbird 1.5.0.4 (X11/20060704) +References: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.033 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/20 +X-Sequence-Number: 20205 + +Milen Kulev wrote: + +> Is anyone using XFS for storing/retrieving relatively large amount of data (~ 200GB)? +> + +Yes, but not for that large - only about 40-50 GB of database data. + +> If yes, what about the performance and stability of XFS. + +I'm pretty happy with the performance, particularly read (get 215MB/s +sequential 8K reads from 4 (P)ATA drives setup as software RAID 0). I +have always found XFS very stable (used it on servers for several years). + +> I am especially interested in recommendations about XFS mount options and mkfs.xfs options. +> My setup will be roughly this: +> 1) 4 SCSI HDD , 128GB each, +> 2) RAID 0 on the four SCSI HDD disks using LVM (software RAID) +> + +> +> My questions: +> 1) Should I place external XFS journal on separate device ? +> 2) What should be the journal buffer size (logbsize) ? +> 3) How many journal buffers (logbufs) should I configure ? +> 4) How many allocations groups (for mkfs.xfs) should I configure +> 5) Is it wortj settion noatime ? +> 6) What I/O scheduler(elevators) should I use (massive sequencial reads) +> 7) What is the ideal stripe unit and width (for a RAID device) ? +> +> + +1-3) I have not done any experimentation with where to put the journal, +or its buffer size / number of them (well worth doing I suspect tho). + +4) I left it at the default. + +5) I use noatime, but have not measured if there is any impact if I +leave it off. + +6) deadline scheduler seemed to give slightly better performance for +sequential performance. + +7) I tried out stripe width 2,4 (with 4 disks), and they seemed to give +the same results. Stripe unit of 256K (tested 32K, 64K, 128K) seemed to +give the best sequential performance. My software raid stripe size was +matched to this in each case. + + +I'll be interested to hear what you discover :-) + +Cheers + +Mark + +From pgsql-performance-owner@postgresql.org Tue Aug 1 23:42:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5F0C69FA508 + for ; + Tue, 1 Aug 2006 23:42:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 76004-01 for + ; + Tue, 1 Aug 2006 23:42:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id 5981C9FB0D1 + for ; + Tue, 1 Aug 2006 23:42:47 -0300 (ADT) +Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Tue, 01 Aug 2006 22:42:40 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 Aug + 2006 22:42:40 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Wed, 2 Aug + 2006 02:42:39 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Tue, 01 Aug 2006 19:42:37 -0700 +Subject: Re: XFS filessystem for Datawarehousing +From: "Luke Lonergan" +To: "Milen Kulev" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] XFS filessystem for Datawarehousing +Thread-Index: Aca13VCGjuuYgSHQEduMOAAWy4o9DA== +In-Reply-To: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 02 Aug 2006 02:42:40.0611 (UTC) + FILETIME=[52AD0B30:01C6B5DD] +X-WSS-ID: 68CECEAA3782645684-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.668 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/21 +X-Sequence-Number: 20206 + +Milen, + +On 8/1/06 2:49 PM, "Milen Kulev" wrote: + +> Is anyone using XFS for storing/retrieving relatively large amount of data (~ +> 200GB)? + +I concur with the previous poster's experiences with one additional +observation: + +We have had instabilities with XFS with software RAID (md) on 32-bit Xeons +running RedHat4 U3 with the Centos 4.3 unsupported SMP kernel. XFS would +occasionally kernel panic under load. + +We have had no problems with XFS running on the same OS/kernel on 64-bit +under heavy workloads for weeks of continuous usage. Each server (of 16 +total) had four XFS filesystems, each with 250GB of table data (no indexes) +on them, total of 16 Terabytes. We tested with the TPC-H schema and +queries. + +We use the default settings for XFS. + +Also - be aware that LVM has a serious performance bottleneck at about +600MB/s - if you are working below that threshold, you may not notice the +issue, maybe some increase in CPU consumption as you approach it. + +- Luke + + + +From pgsql-performance-owner@postgresql.org Tue Aug 1 23:44:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 084E29FB0D1 + for ; + Tue, 1 Aug 2006 23:44:42 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 73308-10 for + ; + Tue, 1 Aug 2006 23:44:33 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) + by postgresql.org (Postfix) with ESMTP id DB42C9FA508 + for ; + Tue, 1 Aug 2006 23:44:33 -0300 (ADT) +Received: from 172.16.1.110 by mail.Mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D1)); Tue, 01 Aug 2006 22:44:24 -0400 +X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 Aug + 2006 22:44:24 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Wed, 2 Aug + 2006 02:44:23 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Tue, 01 Aug 2006 19:44:20 -0700 +Subject: Re: XFS filessystem for Datawarehousing -2 +From: "Luke Lonergan" +To: "Milen Kulev" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] XFS filessystem for Datawarehousing -2 +Thread-Index: Aca13Y3qzK5QDyHQEduMOAAWy4o9DA== +In-Reply-To: <014401c6b5b8$98926a20$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 02 Aug 2006 02:44:24.0346 (UTC) + FILETIME=[9081BFA0:01C6B5DD] +X-WSS-ID: 68CECE0211K1031731-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.662 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/22 +X-Sequence-Number: 20207 + +Milen, + +On 8/1/06 3:19 PM, "Milen Kulev" wrote: + +> Sorry, forgot to ask: +> What is the recommended/best PG block size for DWH database? 16k, 32k, 64k +> ? +> What hsould be the relation between XFS/RAID stripe size and PG block size ? + +We have found that the page size in PG starts to matter only at very high +disk performance levels around 1000MB/s. Other posters have talked about +maintenance tasks improving in performance, but I haven't seen it. + +- Luke + + + +From pgsql-performance-owner@postgresql.org Wed Aug 2 00:15:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 849319FB383 + for ; + Wed, 2 Aug 2006 00:15:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 77628-09 for + ; + Wed, 2 Aug 2006 00:15:13 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id CF3009FB381 + for ; + Wed, 2 Aug 2006 00:15:12 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k723FBDO029158; + Tue, 1 Aug 2006 23:15:11 -0400 (EDT) +To: Eugeny N Dzhurinsky +cc: pgsql-performance@postgresql.org +Subject: Re: Query/database optimization +In-reply-to: <20060801131837.GC4221@office.redwerk.com> +References: <20060801131837.GC4221@office.redwerk.com> +Comments: In-reply-to Eugeny N Dzhurinsky + message dated "Tue, 01 Aug 2006 16:18:37 +0300" +Date: Tue, 01 Aug 2006 23:15:11 -0400 +Message-ID: <29157.1154488511@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.181 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/23 +X-Sequence-Number: 20208 + +Eugeny N Dzhurinsky writes: +> [slow query] + +The bulk of your time seems to be going into this indexscan: + +> -> Index Scan using task_scheduler_icustomer_id on task_scheduler ts (cost=2.03..11.51 rows=1 width=51) (actual time=2.785..2.785 rows=0 loops=4161) +> Index Cond: ("outer".customer_id = ts.customer_id) +> Filter: ((get_available_pages(task_id, customer_id) > 0) AND ((get_check_period(task_id, next_check) IS NULL) OR ((date_part('epoch'::text, get_check_period(task_id, next_check)) - date_part('epoch'::text, (timenow())::timestamp without time zone)) < 3600::double precision)) AND (status <> 1) AND ((((start_time)::time with time zone < ('now'::text)::time(6) with time zone) AND ((stop_time)::time with time zone > ('now'::text)::time(6) with time zone)) OR ((start_time IS NULL) AND (stop_time IS NULL))) AND (NOT (hashed subplan))) +> SubPlan +> -> Unique (cost=2.02..2.03 rows=1 width=4) (actual time=0.617..0.631 rows=3 loops=1) +> ... + +I kinda doubt that the index search itself is that slow --- doubtless +the problem comes from having to evaluate that filter condition on a lot +of rows. How fast are those functions you're calling? + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 2 07:56:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C3A229FB252 + for ; + Wed, 2 Aug 2006 07:56:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 22379-06 for + ; + Wed, 2 Aug 2006 07:56:20 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from office.redwerk.com (office.redwerk.com [85.90.206.104]) + by postgresql.org (Postfix) with ESMTP id C97F69FB24F + for ; + Wed, 2 Aug 2006 07:56:20 -0300 (ADT) +Received: from bofh by office.redwerk.com with local (Exim 4.62 (FreeBSD)) + (envelope-from ) id 1G8EOk-0000gp-3w + for pgsql-performance@postgresql.org; Wed, 02 Aug 2006 13:56:22 +0300 +Date: Wed, 2 Aug 2006 13:56:22 +0300 +From: Eugeny N Dzhurinsky +To: pgsql-performance@postgresql.org +Subject: Re: Query/database optimization +Message-ID: <20060802105622.GA2627@office.redwerk.com> +References: <20060801131837.GC4221@office.redwerk.com> + <29157.1154488511@sss.pgh.pa.us> +MIME-Version: 1.0 +Content-Type: text/plain; charset=koi8-r +Content-Disposition: inline +In-Reply-To: <29157.1154488511@sss.pgh.pa.us> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/24 +X-Sequence-Number: 20209 + +On Tue, Aug 01, 2006 at 11:15:11PM -0400, Tom Lane wrote: +> Eugeny N Dzhurinsky writes: +> > [slow query] +> The bulk of your time seems to be going into this indexscan: +> > -> Index Scan using task_scheduler_icustomer_id on task_scheduler ts (cost=2.03..11.51 rows=1 width=51) (actual time=2.785..2.785 rows=0 loops=4161) +> > Index Cond: ("outer".customer_id = ts.customer_id) +> > Filter: ((get_available_pages(task_id, customer_id) > 0) AND ((get_check_period(task_id, next_check) IS NULL) OR ((date_part('epoch'::text, get_check_period(task_id, next_check)) - date_part('epoch'::text, (timenow())::timestamp without time zone)) < 3600::double precision)) AND (status <> 1) AND ((((start_time)::time with time zone < ('now'::text)::time(6) with time zone) AND ((stop_time)::time with time zone > ('now'::text)::time(6) with time zone)) OR ((start_time IS NULL) AND (stop_time IS NULL))) AND (NOT (hashed subplan))) +> > SubPlan +> > -> Unique (cost=2.02..2.03 rows=1 width=4) (actual time=0.617..0.631 rows=3 loops=1) +> > ... +> +> I kinda doubt that the index search itself is that slow --- doubtless +> the problem comes from having to evaluate that filter condition on a lot +> of rows. How fast are those functions you're calling? + +Well, not really fast, especially get_available_pages + +there is special table with history of changes, and there is a view for latest +changes per task, and this function selects all records from a view for given +ID, then calculates sum of pages of tasks and then calculates number of +available pages as number of allowed pages deduct number of processed pages. + +probably there is bottleneck in this view selection? + +-- +Eugene N Dzhurinsky + +From pgsql-performance-owner@postgresql.org Wed Aug 2 09:17:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CCBA79FB254 + for ; + Wed, 2 Aug 2006 09:17:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 40364-06 for + ; + Wed, 2 Aug 2006 09:17:34 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from web88001.mail.re2.yahoo.com (web88001.mail.re2.yahoo.com + [206.190.37.188]) + by postgresql.org (Postfix) with SMTP id 7E49B9FAC9B + for ; + Wed, 2 Aug 2006 09:17:33 -0300 (ADT) +Received: (qmail 94128 invoked by uid 60001); 2 Aug 2006 12:17:32 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=pCxfB/EUeaOzdTfbNgMcyB8wCa0TRbqyrBuNRczzTGIuddqlRZPM3kRmndwGs196JQ496FrQL8e2/LCgIoHAHbOZnMkfrBMcg4+fbX8AG4IrEAmpX3+cO81QBseos8OIfsgIf30z1g5F0IPE/gNrT7hpUYY1CefPt76obGgMFvg= + ; +Message-ID: <20060802121732.94126.qmail@web88001.mail.re2.yahoo.com> +Received: from [72.140.115.81] by web88001.mail.re2.yahoo.com via HTTP; + Wed, 02 Aug 2006 08:17:32 EDT +Date: Wed, 2 Aug 2006 08:17:32 -0400 (EDT) +From: H Hale +Subject: Re: sub select performance due to seq scans +To: pgsql-performance@postgresql.org +In-Reply-To: <20060801230711.82777.qmail@web88003.mail.re2.yahoo.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-1259675330-1154521052=:91922" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.096 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, HTML_30_40, HTML_MESSAGE +X-Spam-Level: ** +X-Archive-Number: 200608/25 +X-Sequence-Number: 20210 + +--0-1259675330-1154521052=:91922 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + + + +Initial testing was with data that essentially looks like a single collection with many items. +I then changed this to have 60 collections of 50 items. +The result, much better (but not optimum) use of indexs, but a seq scan still +used. + +Turning seq scan off, all indexes where used. +Query was much faster (1.5ms vs 300ms). + +I have tried to increase stats collection... + +alter table capsa.flatommemberrelation column srcobj set statistics 1000; +alter table capsa.flatommemberrelation column dstobj set statistics 1000; +alter table capsa.flatommemberrelation column objectid set statistics 1000; +alter table capsa.flatomfilesysentry column objectid set statistics 1000; +vacuum full analyze; +Experimented with many postgres memory parameters. +No difference. + +Is seq scan off the solution here? +My tests are with a relatively small number of records. +My concern here is what happens with 100,000's of records and seq scan off? +I will find out shortly... + +Does anyone know of of any know issues with the query planner? + + + Explain analyze results below. + + +capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where +objectid in (select dstobj from capsa.flatommemberrelation where +srcobj='5bdef74c-21d3-11db-9a20-001143214409'); + +QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=742380.16..742380.17 rows=1 width=0) (actual +time=1520.269..1520.270 rows=1 loops=1) + -> Nested Loop (cost=878.91..742355.41 rows=9899 width=0) (actual +time=41.516..1520.076 rows=56 loops=1) + Join Filter: ("inner".objectid = "outer".dstobj) + -> Unique (cost=437.03..453.67 rows=3329 width=16) (actual +time=0.241..0.624 rows=56 loops=1) + -> Sort (cost=437.03..445.35 rows=3329 width=16) (actual +time=0.237..0.346 rows=56 loops=1) + Sort Key: flatommemberrelation.dstobj + -> Bitmap Heap Scan on flatommemberrelation +(cost=30.65..242.26 rows=3329 width=16) (actual time=0.053..0.135 rows=56 +loops=1) + Recheck Cond: (srcobj = +'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid) + -> Bitmap Index Scan on +capsa_flatommemberrelation_srcobj_idx (cost=0.00..30.65 rows=3329 width=0) +(actual time=0.044..0.044 rows=56 loops=1) + Index Cond: (srcobj = +'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid) + -> Materialize (cost=441.89..540.88 rows=9899 width=16) (actual +time=0.011..14.918 rows=9899 loops=56) + -> Seq Scan on flatomfilesysentry (cost=0.00..431.99 rows=9899 +width=16) (actual time=0.005..19.601 rows=9899 loops=1) + Total runtime: 1521.040 ms +(13 rows) + +capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where +objectid in (select dstobj from capsa.flatommemberrelation where +srcobj='5bdef74c-21d3-11db-9a20-001143214409'); + +QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=1486472.45..1486472.46 rows=1 width=0) (actual +time=2.112..2.113 rows=1 loops=1) + -> Nested Loop (cost=439.03..1486447.70 rows=9899 width=0) (actual +time=0.307..2.019 rows=56 loops=1) + -> Unique (cost=437.03..453.67 rows=3329 width=16) (actual +time=0.236..0.482 rows=56 loops=1) + -> Sort (cost=437.03..445.35 rows=3329 width=16) (actual +time=0.233..0.306 rows=56 loops=1) + Sort Key: flatommemberrelation.dstobj + -> Bitmap Heap Scan on flatommemberrelation +(cost=30.65..242.26 rows=3329 width=16) (actual time=0.047..0.132 rows=56 +loops=1) + Recheck Cond: (srcobj = +'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid) + -> Bitmap Index Scan on +capsa_flatommemberrelation_srcobj_idx (cost=0.00..30.65 rows=3329 width=0) +(actual time=0.038..0.038 rows=56 loops=1) + Index Cond: (srcobj = +'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid) + -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..384.50 +rows=4950 width=16) (actual time=0.019..0.020 rows=1 loops=56) + Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj) + -> Bitmap Index Scan on flatomfilesysentry_pkey +(cost=0.00..2.00 rows=4950 width=0) (actual time=0.014..0.014 rows=1 loops=56) + Index Cond: (flatomfilesysentry.objectid = "outer".dstobj) + Total runtime: 2.258 ms +(14 rows) + + + H Hale wrote: Not sure if this helps solve the problem but... + (see below) + + As new records are added Indexes are used for awhile and then at some point postgres switches to seq scan. It is repeatable. + + Any suggestions/comments to try and solve this are welcome. Thanks + + Data is as follows: + capsa.flatommemberrelation 1458 records + capsa.flatommemberrelation(srcobj) 3 distinct + capsa.flatommemberrelation(dstobj) 730 distinct + capsa.flatomfilesysentry 732 records + capsa.flatommemberrelation(objectid) 732 distinct + + capsa=# set enable_seqscan=on; + SET + Time: 0.599 ms + capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409'); + QUERY PLAN + ---------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=196.01..196.02 rows=1 width=0) (actual time=965.420..965.422 rows=1 loops=1) + -> Nested Loop IN Join (cost=0.00..194.19 rows=728 width=0) (actual time=3.373..964.371 rows=729 loops=1) + Join Filter: ("outer".objectid = "inner".dstobj) + -> Seq Scan on flatomfilesysentry (cost=0.00..65.28 rows=728 width=16) (actual time=0.007..1.505 rows=732 loops=1) + -> Seq Scan on flatommemberrelation (cost=0.00..55.12 rows=725 width=16) (actual time=0.004..0.848 rows=366 loops=732) + Filter: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid) + Total runtime: 965.492 ms + (7 rows) + + Time: 966.806 ms + +----------------------------------------------------------------------------------------------------------- + capsa=# set enable_seqscan=off; + SET + Time: 0.419 ms + capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409'); + QUERY PLAN + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=24847.73..24847.74 rows=1 width=0) (actual time=24.859..24.860 rows=1 loops=1) + -> Nested Loop (cost=90.05..24845.91 rows=728 width=0) (actual time=2.946..23.640 rows=729 loops=1) + -> Unique (cost=88.04..91.67 rows=363 width=16) (actual time=2.917..6.671 rows=729 loops=1) + -> Sort (cost=88.04..89.86 rows=725 width=16) (actual time=2.914..3.998 rows=729 loops=1) + Sort Key: flatommemberrelation.dstobj + -> Bitmap Heap Scan on flatommemberrelation (cost=7.54..53.60 rows=725 width=16) (actual time=0.260..1.411 rows=729 loops=1) + Recheck Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid) + -> Bitmap Index Scan on capsa_flatommemberrelation_srcobj_idx (cost=0.00..7.54 rows=725 width=0) (actual time=0.244..0.244 rows=729 loops=1) + Index Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid) + -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..63.64 rows=364 width=16) (actual time=0.014..0.015 rows=1 loops=729) + Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj) + -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=364 width=0) (actual time=0.009..0.009 rows=1 loops=729) + Index Cond: (flatomfilesysentry.objectid = "outer".dstobj) + Total runtime: 25.101 ms + (14 rows) + + Time: 26.878 ms + + + + + + +H Hale wrote: Tom, + + It is unique. + + Indexes: + "flatomfilesysentry_pkey" PRIMARY KEY, btree (objectid) + "capsa_flatomfilesysentry_name_idx" btree (name) + Foreign-key constraints: + "objectid" FOREIGN KEY (objectid) REFERENCES capsa_sys.master(objectid) ON DELETE CASCADE + + +Tom Lane wrote: H Hale writes: +> -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..274.38 rows=3238 width=30) (actual time=0.011..0.013 rows=1 loops=6473) +> Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj) +> -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=3238 width=0) (actual time=0.007..0.007 rows=1 loops=6473) +> Index Cond: (flatomfilesysentry.objectid = "outer".dstobj) + +Well, there's our estimation failure: 3238 rows expected, one row +actual. + +What is the data distribution of flatomfilesysentry.objectid? +It looks from this example like it is unique or nearly so, +but the planner evidently does not think that. + + regards, tom lane + +---------------------------(end of broadcast)--------------------------- +TIP 5: don't forget to increase your free space map settings + + + + + +--0-1259675330-1154521052=:91922 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +
Initial testing was with data that essentially looks like a single collection with many items. 
I then changed this to have 60 collections of 50 items.
The result, much better (but not optimum) use of indexs, but a seq scan still
used.

Turning seq scan off, all indexes where used.
Query was much faster (1.5ms vs 300ms).

I have tried to increase stats collection...

alter table capsa.flatommemberrelation column srcobj set statistics 1000;
alter table capsa.flatommemberrelation column dstobj set statistics 1000;
alter table capsa.flatommemberrelation column objectid set statistics 1000;
alter table capsa.flatomfilesysentry column objectid set statistics 1000;
vacuum full analyze;
Experimented with many postgres memory parameters.
No difference.

Is seq scan off the solution here?
My tests are with a relatively small number of records.
My concern here is what happens with 100,000's + of records and seq scan off?
I will find out shortly...

Does anyone know of of any know issues with the query planner?

Explain analyze results below.

capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where
objectid in (select dstobj from capsa.flatommemberrelation where
srcobj='5bdef74c-21d3-11db-9a20-001143214409');

QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=742380.16..742380.17 rows=1 width=0) (actual
time=1520.269..1520.270 rows=1 loops=1)
-> Nested Loop (cost=878.91..742355.41 rows=9899 width=0) (actual
time=41.516..1520.076 rows=56 loops=1)
Join + Filter: ("inner".objectid = "outer".dstobj)
-> Unique (cost=437.03..453.67 rows=3329 width=16) (actual
time=0.241..0.624 rows=56 loops=1)
-> Sort (cost=437.03..445.35 rows=3329 width=16) (actual
time=0.237..0.346 rows=56 loops=1)
Sort Key: flatommemberrelation.dstobj
-> Bitmap Heap Scan on flatommemberrelation
(cost=30.65..242.26 rows=3329 width=16) (actual time=0.053..0.135 rows=56
loops=1)
Recheck Cond: (srcobj =
'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid)
-> Bitmap Index Scan on
capsa_flatommemberrelation_srcobj_idx (cost=0.00..30.65 rows=3329 width=0)
(actual time=0.044..0.044 rows=56 loops=1)
Index Cond: (srcobj =
'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid)
-> Materialize (cost=441.89..540.88 rows=9899 width=16) + (actual
time=0.011..14.918 rows=9899 loops=56)
-> Seq Scan on flatomfilesysentry (cost=0.00..431.99 rows=9899
width=16) (actual time=0.005..19.601 rows=9899 loops=1)
Total runtime: 1521.040 ms
(13 rows)

capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where
objectid in (select dstobj from capsa.flatommemberrelation where
srcobj='5bdef74c-21d3-11db-9a20-001143214409');

QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=1486472.45..1486472.46 rows=1 width=0) (actual
time=2.112..2.113 rows=1 loops=1)
-> Nested Loop (cost=439.03..1486447.70 rows=9899 width=0) (actual
time=0.307..2.019 + rows=56 loops=1)
-> Unique (cost=437.03..453.67 rows=3329 width=16) (actual
time=0.236..0.482 rows=56 loops=1)
-> Sort (cost=437.03..445.35 rows=3329 width=16) (actual
time=0.233..0.306 rows=56 loops=1)
Sort Key: flatommemberrelation.dstobj
-> Bitmap Heap Scan on flatommemberrelation
(cost=30.65..242.26 rows=3329 width=16) (actual time=0.047..0.132 rows=56
loops=1)
Recheck Cond: (srcobj =
'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid)
-> Bitmap Index Scan on
capsa_flatommemberrelation_srcobj_idx (cost=0.00..30.65 rows=3329 width=0)
(actual time=0.038..0.038 rows=56 loops=1)
Index Cond: (srcobj =
'5bdef74c-21d3-11db-9a20-001143214409'::capsa_sys.uuid)
-> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..384.50
rows=4950 width=16) + (actual time=0.019..0.020 rows=1 loops=56)
Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj)
-> Bitmap Index Scan on flatomfilesysentry_pkey
(cost=0.00..2.00 rows=4950 width=0) (actual time=0.014..0.014 rows=1 loops=56)
Index Cond: (flatomfilesysentry.objectid = "outer".dstobj)
Total runtime: 2.258 ms
(14 rows)


H Hale <hhale21@rogers.com> wrote:
Not sure if this helps solve the problem but...
(see below)

As new records are added Indexes are used for awhile  and then at some point postgres switches to seq scan. It is repeatable. 

Any suggestions/comments to try and solve this are welcome.  Thanks

Data is as follows:
capsa.flatommemberrelation 1458 records
+ capsa.flatommemberrelation(srcobj)  3 distinct
capsa.flatommemberrelation(dstobj)  730 distinct
capsa.flatomfilesysentry 732 records
capsa.flatommemberrelation(objectid)  732 distinct

capsa=# set enable_seqscan=on;
SET
Time: 0.599 ms
capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409');
                                                            QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------
+  Aggregate  (cost=196.01..196.02 rows=1 width=0) (actual time=965.420..965.422 rows=1 loops=1)
   ->  Nested Loop IN Join  (cost=0.00..194.19 rows=728 width=0) (actual time=3.373..964.371 rows=729 loops=1)
         Join Filter: ("outer".objectid = "inner".dstobj)
         ->  Seq Scan on flatomfilesysentry  (cost=0.00..65.28 rows=728 width=16) (actual time=0.007..1.505 rows=732 loops=1)
         ->  Seq Scan on flatommemberrelation  (cost=0.00..55.12 rows=725 width=16) (actual time=0.004..0.848 rows=366 loops=732)
               Filter: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid)
 Total runtime: 965.492 ms
(7 rows)

Time: 966.806 ms
+
-----------------------------------------------------------------------------------------------------------
capsa=# set enable_seqscan=off;
SET
Time: 0.419 ms
capsa=# explain analyze select count(*) from capsa.flatomfilesysentry where objectid in (select dstobj from capsa.flatommemberrelation where srcobj='9e5943e0-219f-11db-8504-001143214409');
                                                                                QUERY PLAN
+ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=24847.73..24847.74 rows=1 width=0) (actual time=24.859..24.860 rows=1 loops=1)
   ->  Nested Loop  (cost=90.05..24845.91 rows=728 width=0) (actual time=2.946..23.640 rows=729 loops=1)
         ->  Unique  (cost=88.04..91.67 rows=363 width=16) (actual time=2.917..6.671 rows=729 loops=1)
               ->  Sort  (cost=88.04..89.86 rows=725 width=16) (actual time=2.914..3.998 rows=729 loops=1)
                     Sort Key: flatommemberrelation.dstobj
+                      ->  Bitmap Heap Scan on flatommemberrelation  (cost=7.54..53.60 rows=725 width=16) (actual time=0.260..1.411 rows=729 loops=1)
                           Recheck Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid)
                           ->  Bitmap Index Scan on capsa_flatommemberrelation_srcobj_idx  (cost=0.00..7.54 rows=725 width=0) (actual time=0.244..0.244 rows=729 loops=1)
+                                  Index Cond: (srcobj = '9e5943e0-219f-11db-8504-001143214409'::capsa_sys.uuid)
         ->  Bitmap Heap Scan on flatomfilesysentry  (cost=2.00..63.64 rows=364 width=16) (actual time=0.014..0.015 rows=1 loops=729)
               Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj)
               ->  Bitmap Index Scan on flatomfilesysentry_pkey  (cost=0.00..2.00 rows=364 width=0) (actual time=0.009..0.009 rows=1 loops=729)
                     Index Cond: + (flatomfilesysentry.objectid = "outer".dstobj)
 Total runtime: 25.101 ms
(14 rows)

Time: 26.878 ms






H Hale <hhale21@rogers.com> wrote:
Tom,

It is unique.

Indexes:
    "flatomfilesysentry_pkey" PRIMARY KEY, btree (objectid)
    "capsa_flatomfilesysentry_name_idx" btree (name)
Foreign-key constraints:
    "objectid" FOREIGN KEY (objectid) REFERENCES capsa_sys.master(objectid) ON DELETE CASCADE


Tom Lane <tgl@sss.pgh.pa.us> wrote:
H Hale writes:
> -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..274.38 rows=3238 width=30) (actual + time=0.011..0.013 rows=1 loops=6473)
> Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj)
> -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=3238 width=0) (actual time=0.007..0.007 rows=1 loops=6473)
> Index Cond: (flatomfilesysentry.objectid = "outer".dstobj)

Well, there's our estimation failure: 3238 rows expected, one row
actual.

What is the data distribution of flatomfilesysentry.objectid?
It looks from this example like it is unique or nearly so,
but the planner evidently does not think that.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings




+--0-1259675330-1154521052=:91922-- + +From pgsql-performance-owner@postgresql.org Wed Aug 2 13:48:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D4D959FA6B0 + for ; + Wed, 2 Aug 2006 13:48:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 80441-01 for + ; + Wed, 2 Aug 2006 16:48:20 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id CC7B09FA6AF + for ; + Wed, 2 Aug 2006 13:48:19 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Wed, 2 Aug 2006 16:48:16 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 02 Aug 2006 11:48:16 -0500 +Subject: Re: sub select performance due to seq scans +From: Scott Marlowe +To: H Hale +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060802121732.94126.qmail@web88001.mail.re2.yahoo.com> +References: <20060802121732.94126.qmail@web88001.mail.re2.yahoo.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1154537296.7882.59.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Wed, 02 Aug 2006 11:48:16 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY +X-Spam-Level: *** +X-Archive-Number: 200608/26 +X-Sequence-Number: 20211 + +On Wed, 2006-08-02 at 07:17, H Hale wrote: +> Initial testing was with data that essentially looks like a single collection with many items. +> I then changed this to have 60 collections of 50 items. +> The result, much better (but not optimum) use of indexs, but a seq scan still +> used. +> +> Turning seq scan off, all indexes where used. +> Query was much faster (1.5ms vs 300ms). +> +> I have tried to increase stats collection... +> +> alter table capsa.flatommemberrelation column srcobj set statistics 1000; +> alter table capsa.flatommemberrelation column dstobj set statistics 1000; +> alter table capsa.flatommemberrelation column objectid set statistics 1000; +> alter table capsa.flatomfilesysentry column objectid set statistics 1000; +> vacuum full analyze; +> Experimented with many postgres memory parameters. +> No difference. +> +> Is seq scan off the solution here? + +It almost never is the right answer. + +> My tests are with a relatively small number of records. +> My concern here is what happens with 100,000's +> of records and seq scan off? + +What you need to do is tune PostgreSQL to match your predicted usage +patterns. + +Will most or all of your dataset always fit in RAM? Then you can tune +random_page_cost down near 1.0 normally for large memory / small data +set servers, 1.2 to 1.4 is about optimal. There will still be times +when seq scan is a win. You can build a test data set of about the size +you'll expect to run in the future, and take a handful of the queries +you'll be running, and use more and less versions of those queries and +explain analyze to get an idea of about where random_page_cost should +be. Make sure analyze has been run and that the statistics are fairly +accurate. + +effective_cache_size should be set to some reasonable size based on the +steady state size of your machine's kernel cache + disk buffers, +preferably before you tune random_page_cost too much. + +There are other numbers you can tune as well (the cpu cost ones in +particular). If you find yourself needing values of random_page_cost at +1.0 or below to get the planner to make the right choices, then you've +got issues. Otherwise, if a number between 1.2 and 2.0 make it work +right, you're likely set for a while. + +From pgsql-performance-owner@postgresql.org Wed Aug 2 18:00:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E67E59FB233 + for ; + Wed, 2 Aug 2006 18:00:02 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 36927-02 for + ; + Wed, 2 Aug 2006 20:59:41 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.net [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id 441A29FB21E + for ; + Wed, 2 Aug 2006 17:59:41 -0300 (ADT) +Received: (qmail invoked by alias); 02 Aug 2006 20:59:38 -0000 +Received: from dslb-084-057-001-183.pools.arcor-ip.net (EHLO ltmku) + [84.57.1.183] + by mail.gmx.net (mp039) with SMTP; 02 Aug 2006 22:59:38 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: "'Luke Lonergan'" , + +Subject: Re: XFS filessystem for Datawarehousing +Date: Wed, 2 Aug 2006 22:59:34 +0200 +Message-ID: <01cb01c6b676$8ef67330$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +In-Reply-To: +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/27 +X-Sequence-Number: 20212 + +Hi Like, Mark , Alvaro and Andrew, + +Thank you very much for sharing you experience with me. +I want to compare DHW performance of PG/Bizgres on different filesystems and difffrent +Block sizes. + +The hardware will be free for me in a week or too (at a moment another project is running on it) and then I will test +diffrenet setups and will post the results. + +I MUST (sorry, no other choice) use SLES6 R3, 64 bit. I am not sure at all that I will get enough budget to get +approapriate RAID controller, and that is why I intent to use software RAID. + +I am pretty exited whether XFS will clearly outpertform ETX3 (no default setups for both are planned !). I am not sure +whether is it worth to include JFS in comparison too ... + + +Best Regards, +Milen Kulev + +-----Original Message----- +From: Luke Lonergan [mailto:llonergan@greenplum.com] +Sent: Wednesday, August 02, 2006 4:43 AM +To: Milen Kulev; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] XFS filessystem for Datawarehousing + + +Milen, + +On 8/1/06 2:49 PM, "Milen Kulev" wrote: + +> Is anyone using XFS for storing/retrieving relatively large amount of +> data (~ 200GB)? + +I concur with the previous poster's experiences with one additional +observation: + +We have had instabilities with XFS with software RAID (md) on 32-bit Xeons running RedHat4 U3 with the Centos 4.3 +unsupported SMP kernel. XFS would occasionally kernel panic under load. + +We have had no problems with XFS running on the same OS/kernel on 64-bit under heavy workloads for weeks of continuous +usage. Each server (of 16 +total) had four XFS filesystems, each with 250GB of table data (no indexes) on them, total of 16 Terabytes. We tested +with the TPC-H schema and queries. + +We use the default settings for XFS. + +Also - be aware that LVM has a serious performance bottleneck at about 600MB/s - if you are working below that +threshold, you may not notice the issue, maybe some increase in CPU consumption as you approach it. + +- Luke + + + +From pgsql-performance-owner@postgresql.org Wed Aug 2 18:26:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 249AA9FB23B + for ; + Wed, 2 Aug 2006 18:26:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 89612-05 for + ; + Wed, 2 Aug 2006 18:26:45 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.187]) + by postgresql.org (Postfix) with ESMTP id 7A0B79FB233 + for ; + Wed, 2 Aug 2006 18:26:44 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id p77so806510nfc + for ; + Wed, 02 Aug 2006 14:26:39 -0700 (PDT) +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:references; + b=uOCU7tCYoMmYWkebSdZ4qDKrbhLwURwrLaZNBognpdiKgCZD0yIlHCAH1bMXDtBntop7YkwH5K7YeCMSwAE4SQ0kaNFZVZnILglHOB0X/+Ruq4GTSE1/LW23QsqUm1CxLxME1zsDHJBfhvqDHqKExGoRunujaMMWMJFwv9uNwso= +Received: by 10.78.145.5 with SMTP id s5mr365108hud; + Wed, 02 Aug 2006 14:26:39 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Wed, 2 Aug 2006 14:26:39 -0700 (PDT) +Message-ID: <721b21dc0608021426p26d2a79ap37e0f55b2328b453@mail.gmail.com> +Date: Wed, 2 Aug 2006 14:26:39 -0700 +From: "Steve Poe" +To: "Milen Kulev" +Subject: Re: XFS filessystem for Datawarehousing +Cc: pgsql-performance@postgresql.org +In-Reply-To: <01cb01c6b676$8ef67330$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_111974_21094075.1154553999435" +References: + <01cb01c6b676$8ef67330$0a00a8c0@trivadis.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/28 +X-Sequence-Number: 20213 + +------=_Part_111974_21094075.1154553999435 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Milen, + +For the past year, I have been running odbc-bench on a dual-opteron with +4GB of RAM using a 8GB sample data. I found the performance difference +between EXT3, JFS, and XFS is +/- 5-8%. This could be written-off as +"noise" just for normal server performance flux. If you plan on using the +default kernel, ext3 will likely perform best (what I found). When I added +my own kernel, ext3 performed fair. What I've had to consider is what does +each file system offer me as far as data integrity goes. + +You'll find greater ROI on performance by investing your time in other areas +than chasing down a few percentage point (like I have done). If you could +borrow more RAM and/or more discs for your tests, Testing newer kernels and +read-ahead patches may benefit you as well. + +Best of luck. + +Steve Poe + + + +On 8/2/06, Milen Kulev wrote: +> +> Hi Like, Mark , Alvaro and Andrew, +> +> Thank you very much for sharing you experience with me. +> I want to compare DHW performance of PG/Bizgres on different filesystems +> and difffrent +> Block sizes. +> +> The hardware will be free for me in a week or too (at a moment another +> project is running on it) and then I will test +> diffrenet setups and will post the results. +> +> I MUST (sorry, no other choice) use SLES6 R3, 64 bit. I am not sure at all +> that I will get enough budget to get +> approapriate RAID controller, and that is why I intent to use software +> RAID. +> +> I am pretty exited whether XFS will clearly outpertform ETX3 (no default +> setups for both are planned !). I am not sure +> whether is it worth to include JFS in comparison too ... +> +> +> Best Regards, +> Milen Kulev +> +> -----Original Message----- +> From: Luke Lonergan [mailto:llonergan@greenplum.com] +> Sent: Wednesday, August 02, 2006 4:43 AM +> To: Milen Kulev; pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] XFS filessystem for Datawarehousing +> +> +> Milen, +> +> On 8/1/06 2:49 PM, "Milen Kulev" wrote: +> +> > Is anyone using XFS for storing/retrieving relatively large amount of +> > data (~ 200GB)? +> +> I concur with the previous poster's experiences with one additional +> observation: +> +> We have had instabilities with XFS with software RAID (md) on 32-bit Xeons +> running RedHat4 U3 with the Centos 4.3 +> unsupported SMP kernel. XFS would occasionally kernel panic under load. +> +> We have had no problems with XFS running on the same OS/kernel on 64-bit +> under heavy workloads for weeks of continuous +> usage. Each server (of 16 +> total) had four XFS filesystems, each with 250GB of table data (no +> indexes) on them, total of 16 Terabytes. We tested +> with the TPC-H schema and queries. +> +> We use the default settings for XFS. +> +> Also - be aware that LVM has a serious performance bottleneck at about +> 600MB/s - if you are working below that +> threshold, you may not notice the issue, maybe some increase in CPU +> consumption as you approach it. +> +> - Luke +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> + +------=_Part_111974_21094075.1154553999435 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Milen,
+
+For the past  year, I have been running odbc-bench on a +dual-opteron with 4GB of RAM using a 8GB sample data. I found the +performance difference between EXT3, JFS, and XFS  is +/- 5-8%. +This could be written-off as "noise" just for normal server performance +flux. If you plan on using the default kernel, ext3 will likely perform +best (what I found). When I added my own kernel, ext3 performed fair. +What I've had to consider is what does each file system offer me as far +as  data integrity goes. 
+
+You'll find greater ROI on performance by investing your time in other +areas than chasing down a few percentage point (like I have +done).  If you could borrow more RAM and/or more discs for your +tests,  Testing newer kernels and read-ahead patches may benefit +you as well.
+
+Best of luck.
+
+Steve Poe
+
+

On 8/2/06, Milen Kulev <makulev@gmx.net> wrote:
+Hi Like, Mark , Alvaro and Andrew,

Thank you very much for sharing you experience with me.
I want to compare DHW performance of PG/Bizgres on different filesystems and difffrent
Block sizes.

The hardware will be free for me in a week or too (at a moment another project is running on it) and then I will test +
diffrenet setups and will post the results.

I MUST (sorry, no other choice) use SLES6 R3, 64 bit. I am not sure at all that I will get enough budget to get
approapriate RAID controller, and that is why I intent to use software RAID. +

I +am pretty exited whether XFS will clearly outpertform ETX3 (no default +setups for both are planned !).  I am not sure
whether is it worth to include JFS in comparison too ...


Best  Regards,
Milen Kulev

-----Original Message-----
From: Luke Lonergan [mailto: +llonergan@greenplum.com]
Sent: Wednesday, August 02, 2006 4:43 AM
To: Milen Kulev; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] XFS filessystem for Datawarehousing +


Milen,

On 8/1/06 2:49 PM, "Milen Kulev" <makulev@gmx.net> wrote:

> Is anyone using XFS for storing/retrieving relatively large amount of
+> data  (~ 200GB)?

I concur with the previous poster's experiences with one additional
observation:

We have had instabilities with XFS with software RAID (md) on 32-bit Xeons running RedHat4 U3 with the Centos +4.3
unsupported SMP kernel.  XFS would occasionally kernel panic under load.

We have had no problems with XFS running on the same OS/kernel on 64-bit under heavy workloads for weeks of continuous
usage.  Each server (of 16 +
total) had four XFS filesystems, each with 250GB of table data (no indexes) on them, total of 16 Terabytes.  We tested
with the TPC-H schema and queries.

We use the default settings for XFS.

Also - be aware that LVM has a serious performance bottleneck at about 600MB/s - if you are working below that +
threshold, you may not notice the issue, maybe some increase in CPU consumption as you approach it.

- Luke



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ? +

               http://www.postgresql.org/docs/faq

+ +------=_Part_111974_21094075.1154553999435-- + +From pgsql-performance-owner@postgresql.org Wed Aug 2 18:44:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id F00809FB23B + for ; + Wed, 2 Aug 2006 18:44:21 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 93371-01 for + ; + Wed, 2 Aug 2006 18:44:13 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.de [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id DC90D9FB233 + for ; + Wed, 2 Aug 2006 18:44:13 -0300 (ADT) +Received: (qmail invoked by alias); 02 Aug 2006 21:44:10 -0000 +Received: from dslb-084-057-001-183.pools.arcor-ip.net (EHLO ltmku) + [84.57.1.183] + by mail.gmx.net (mp031) with SMTP; 02 Aug 2006 23:44:10 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: "'Steve Poe'" +Cc: +Subject: Re: XFS filessystem for Datawarehousing +Date: Wed, 2 Aug 2006 23:44:06 +0200 +Message-ID: <01ec01c6b67c$c76717a0$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_01ED_01C6B68D.8AEFE7A0" +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +In-Reply-To: <721b21dc0608021426p26d2a79ap37e0f55b2328b453@mail.gmail.com> +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.316 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/29 +X-Sequence-Number: 20214 + +This is a multi-part message in MIME format. + +------=_NextPart_000_01ED_01C6B68D.8AEFE7A0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi Steve,=20 +I hope that performance between EXT3 and XFS is not only 5-8% . Such = +a small difference could be interpreted as +"noise", as you already mentioned. +I want to give many filesystem a try. Stability is also a concern, but I = +don't want to favour any FS over another . +=20 +Best Regards. +MIlen Kulev +=20 + +-----Original Message----- +From: Steve Poe [mailto:steve.poe@gmail.com]=20 +Sent: Wednesday, August 02, 2006 11:27 PM +To: Milen Kulev +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] XFS filessystem for Datawarehousing + + +Milen, + +For the past year, I have been running odbc-bench on a dual-opteron = +with 4GB of RAM using a 8GB sample data. I found +the performance difference between EXT3, JFS, and XFS is +/- 5-8%. This = +could be written-off as "noise" just for normal +server performance flux. If you plan on using the default kernel, ext3 = +will likely perform best (what I found). When I +added my own kernel, ext3 performed fair. What I've had to consider is = +what does each file system offer me as far as +data integrity goes. =20 + +You'll find greater ROI on performance by investing your time in other = +areas than chasing down a few percentage point +(like I have done). If you could borrow more RAM and/or more discs for = +your tests, Testing newer kernels and +read-ahead patches may benefit you as well. + +Best of luck. + +Steve Poe + + + + +On 8/2/06, Milen Kulev wrote:=20 + +Hi Like, Mark , Alvaro and Andrew, + +Thank you very much for sharing you experience with me. +I want to compare DHW performance of PG/Bizgres on different filesystems = +and difffrent +Block sizes. + +The hardware will be free for me in a week or too (at a moment another = +project is running on it) and then I will test=20 +diffrenet setups and will post the results. + +I MUST (sorry, no other choice) use SLES6 R3, 64 bit. I am not sure at = +all that I will get enough budget to get +approapriate RAID controller, and that is why I intent to use software = +RAID.=20 + +I am pretty exited whether XFS will clearly outpertform ETX3 (no default = +setups for both are planned !). I am not sure +whether is it worth to include JFS in comparison too ... + + +Best Regards, +Milen Kulev + +-----Original Message----- +From: Luke Lonergan [mailto: llonergan@greenplum.com = + ] +Sent: Wednesday, August 02, 2006 4:43 AM +To: Milen Kulev; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] XFS filessystem for Datawarehousing=20 + + +Milen, + +On 8/1/06 2:49 PM, "Milen Kulev" wrote: + +> Is anyone using XFS for storing/retrieving relatively large amount of +> data (~ 200GB)? + +I concur with the previous poster's experiences with one additional +observation: + +We have had instabilities with XFS with software RAID (md) on 32-bit = +Xeons running RedHat4 U3 with the Centos 4.3 +unsupported SMP kernel. XFS would occasionally kernel panic under load. + +We have had no problems with XFS running on the same OS/kernel on 64-bit = +under heavy workloads for weeks of continuous +usage. Each server (of 16=20 +total) had four XFS filesystems, each with 250GB of table data (no = +indexes) on them, total of 16 Terabytes. We tested +with the TPC-H schema and queries. + +We use the default settings for XFS. + +Also - be aware that LVM has a serious performance bottleneck at about = +600MB/s - if you are working below that=20 +threshold, you may not notice the issue, maybe some increase in CPU = +consumption as you approach it. + +- Luke + + + +---------------------------(end of broadcast)--------------------------- +TIP 3: Have you checked our extensive FAQ?=20 + + http://www.postgresql.org/docs/faq + + + + +------=_NextPart_000_01ED_01C6B68D.8AEFE7A0 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + +Nachricht + + + +
Hi=20 +Steve,
+
I hope=20 +that  performance between  EXT3 and XFS is not only  5-8% = +. Such=20 +a small difference could be interpreted  as "noise", as you already = + +mentioned.
+
I want=20 +to give many filesystem a try. Stability is also a concern, but I don't = +want to=20 +favour any FS over another .
+
 
+
Best=20 +Regards.
+
MIlen=20 +Kulev
+
 
+
+
+
-----Original Message-----
From: Steve Poe=20 + [mailto:steve.poe@gmail.com]
Sent: Wednesday, August 02, = +2006 11:27=20 + PM
To: Milen Kulev
Cc:=20 + pgsql-performance@postgresql.org
Subject: Re: [PERFORM] XFS=20 + filessystem for Datawarehousing

Milen,

For = +the=20 + past  year, I have been running odbc-bench on a dual-opteron with = +4GB of=20 + RAM using a 8GB sample data. I found the performance difference = +between EXT3,=20 + JFS, and XFS  is +/- 5-8%. This could be written-off as "noise" = +just for=20 + normal server performance flux. If you plan on using the default = +kernel, ext3=20 + will likely perform best (what I found). When I added my own kernel, = +ext3=20 + performed fair. What I've had to consider is what does each file = +system offer=20 + me as far as  data integrity goes. 

You'll find = +greater ROI=20 + on performance by investing your time in other areas than chasing down = +a few=20 + percentage point (like I have done).  If you could borrow more = +RAM and/or=20 + more discs for your tests,  Testing newer kernels and read-ahead = +patches=20 + may benefit you as well.

Best of luck.

Steve = +Poe



+
On 8/2/06, Milen=20 + Kulev <makulev@gmx.net>=20 + wrote: +
Hi=20 + Like, Mark , Alvaro and Andrew,

Thank you very much for = +sharing you=20 + experience with me.
I want to compare DHW performance of = +PG/Bizgres on=20 + different filesystems and difffrent
Block sizes.

The = +hardware will=20 + be free for me in a week or too (at a moment another project is = +running on=20 + it) and then I will test
diffrenet setups and will post the=20 + results.

I MUST (sorry, no other choice) use SLES6 R3, 64 = +bit. I am=20 + not sure at all that I will get enough budget to get
approapriate = +RAID=20 + controller, and that is why I intent to use software RAID.

I = +am=20 + pretty exited whether XFS will clearly outpertform ETX3 (no default = +setups=20 + for both are planned !).  I am not sure
whether is it = +worth to=20 + include JFS in comparison too=20 + ...


Best  Regards,
Milen = +Kulev

-----Original=20 + Message-----
From: Luke Lonergan [mailto: = +llonergan@greenplum.com]
Sent:=20 + Wednesday, August 02, 2006 4:43 AM
To: Milen Kulev; pgsql-performance@postgr= +esql.org
Subject:=20 + Re: [PERFORM] XFS filessystem for Datawarehousing=20 +


Milen,

On 8/1/06 2:49 PM, "Milen Kulev" <makulev@gmx.net> = +wrote:

> Is=20 + anyone using XFS for storing/retrieving relatively large amount = +of
>=20 + data  (~ 200GB)?

I concur with the previous = +poster's=20 + experiences with one additional
observation:

We have had=20 + instabilities with XFS with software RAID (md) on 32-bit Xeons = +running=20 + RedHat4 U3 with the Centos 4.3
unsupported SMP = +kernel.  XFS=20 + would occasionally kernel panic under load.

We have had no = +problems=20 + with XFS running on the same OS/kernel on 64-bit under heavy = +workloads for=20 + weeks of continuous
usage.  Each server (of 16 = +
total) had=20 + four XFS filesystems, each with 250GB of table data (no indexes) on = +them,=20 + total of 16 Terabytes.  We tested
with the TPC-H schema = +and=20 + queries.

We use the default settings for XFS.

Also - = +be aware=20 + that LVM has a serious performance bottleneck at about 600MB/s - if = +you are=20 + working below that
threshold, you may not notice the issue, = +maybe some=20 + increase in CPU consumption as you approach it.

-=20 + Luke



---------------------------(end of=20 + broadcast)---------------------------
TIP 3: Have you checked our = + + extensive FAQ?=20 + = +

           = +;   =20 + http://www.postgresql.org/doc= +s/faq

+ +------=_NextPart_000_01ED_01C6B68D.8AEFE7A0-- + + +From pgsql-performance-owner@postgresql.org Wed Aug 2 20:04:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B70509FB1DE + for ; + Wed, 2 Aug 2006 20:04:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 98567-03 for + ; + Wed, 2 Aug 2006 20:04:04 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id 00AB39FB1DD + for ; + Wed, 2 Aug 2006 20:04:04 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id E8072308EE; Thu, 3 Aug 2006 01:04:02 +0200 (MET DST) +From: Chris Browne +X-Newsgroups: pgsql.performance +Subject: Re: XFS filessystem for Datawarehousing +Date: Wed, 02 Aug 2006 18:43:38 -0400 +Organization: cbbrowne Computing Inc +Lines: 34 +Message-ID: <603bcekbc5.fsf@dba2.int.libertyrms.com> +References: + <01cb01c6b676$8ef67330$0a00a8c0@trivadis.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Complaints-To: usenet@news.hub.org +User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.19 (linux) +Cancel-Lock: sha1:gNG+XUn9s7qm4SzrCDs6g0FWoXI= +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.391 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/30 +X-Sequence-Number: 20215 + +makulev@gmx.net ("Milen Kulev") writes: +> I am pretty exited whether XFS will clearly outpertform ETX3 (no +> default setups for both are planned !). I am not sure whether is it +> worth to include JFS in comparison too ... + +I did some benchmarking about 2 years ago, and found that JFS was a +few percent faster than XFS which was a few percent faster than ext3, +on a "huge amounts of writes" workload. + +That the difference was only a few percent made us draw the conclusion +that FS performance was fairly much irrelevant. It is of *vastly* +more importance whether the filesystem will survive power outages and +the like, and, actually, Linux hasn't fared as well with that as I'd +like. :-( + +The differences are small enough that what you should *actually* test +for is NOT PERFORMANCE. + +You should instead test for reliability. + +- Turn off the power when the DB is under load, and see how well it + survives. + +- Pull the fibrechannel cable, and see if the filesystem (and + database) survives when under load. + +If you find that XFS is 4% faster, that's likely a *terrible* +trade-off if it only survives power outage half as often as (say) +ext3. +-- +(reverse (concatenate 'string "gro.gultn" "@" "enworbbc")) +http://cbbrowne.com/info/wp.html +"C combines the power of assembler language with the convenience of +assembler language." -- Unknown + +From pgsql-performance-owner@postgresql.org Wed Aug 2 20:34:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 4A8C99FB328 + for ; + Wed, 2 Aug 2006 20:34:15 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 03966-01 for + ; + Wed, 2 Aug 2006 20:34:04 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) + by postgresql.org (Postfix) with ESMTP id 768DD9FB28E + for ; + Wed, 2 Aug 2006 20:34:05 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.113.236]) + by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J3E00HVL9G6DNE7@vms042.mailsrvcs.net> for + pgsql-performance@postgresql.org; Wed, 02 Aug 2006 18:33:43 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id 9D7276FA9A for + ; + Wed, 02 Aug 2006 19:33:41 -0400 (EDT) +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 BqdrIyQ8mD8d for ; Wed, + 02 Aug 2006 19:33:40 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 8814D6FA9C; Wed, 02 Aug 2006 19:33:39 -0400 (EDT) +Date: Wed, 02 Aug 2006 19:33:39 -0400 +From: Michael Stone +Subject: Re: XFS filessystem for Datawarehousing +In-reply-to: <721b21dc0608021426p26d2a79ap37e0f55b2328b453@mail.gmail.com> +To: pgsql-performance@postgresql.org +Mail-followup-to: pgsql-performance@postgresql.org +Message-id: <20060802233336.GN2900@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: + <01cb01c6b676$8ef67330$0a00a8c0@trivadis.com> + <721b21dc0608021426p26d2a79ap37e0f55b2328b453@mail.gmail.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.249 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/31 +X-Sequence-Number: 20216 + +On Wed, Aug 02, 2006 at 02:26:39PM -0700, Steve Poe wrote: +>For the past year, I have been running odbc-bench on a dual-opteron with +>4GB of RAM using a 8GB sample data. I found the performance difference +>between EXT3, JFS, and XFS is +/- 5-8%. + +That's not surprising when your db is only 2x your RAM. You'll find that +filesystem performance is much more important when your database is 10x+ +your RAM (which is often the case once your database heads toward a TB). + +>Testing newer kernels and read-ahead patches may benefit you as well. + +I've been really impressed by the adaptive readahead patches with +postgres. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Thu Aug 3 01:05:24 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 794239FB27C + for ; + Thu, 3 Aug 2006 01:05:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 23811-01 for + ; + Thu, 3 Aug 2006 01:05:18 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw07.mi8.com [63.240.6.48]) + by postgresql.org (Postfix) with ESMTP id A09019FB1D7 + for ; + Thu, 3 Aug 2006 01:05:18 -0300 (ADT) +Received: from 172.16.1.112 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D7)); Thu, 03 Aug 2006 00:05:07 -0400 +X-Server-Uuid: 17BC2F4D-0B9D-4912-A444-324158EA6520 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 3 Aug + 2006 00:05:07 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Thu, 3 Aug + 2006 04:05:06 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Wed, 02 Aug 2006 21:05:05 -0700 +Subject: Re: XFS filessystem for Datawarehousing +From: "Luke Lonergan" +To: "Michael Stone" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] XFS filessystem for Datawarehousing +Thread-Index: Aca2sgAsPnbm4iKlEdu+hAAWy4o9DA== +In-Reply-To: <20060802233336.GN2900@mathom.us> +MIME-Version: 1.0 +X-OriginalArrivalTime: 03 Aug 2006 04:05:07.0511 (UTC) + FILETIME=[01ABD470:01C6B6B2] +X-WSS-ID: 68CFAA793DO689171-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.658 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/32 +X-Sequence-Number: 20217 + +Again - the performance difference increases as the disk speed increases. + +Our experience is that we went from 300MB/s to 475MB/s when moving from ext3 +to xfs. + +- Luke + + +On 8/2/06 4:33 PM, "Michael Stone" wrote: + +> On Wed, Aug 02, 2006 at 02:26:39PM -0700, Steve Poe wrote: +>> For the past year, I have been running odbc-bench on a dual-opteron with +>> 4GB of RAM using a 8GB sample data. I found the performance difference +>> between EXT3, JFS, and XFS is +/- 5-8%. +> +> That's not surprising when your db is only 2x your RAM. You'll find that +> filesystem performance is much more important when your database is 10x+ +> your RAM (which is often the case once your database heads toward a TB). +> +>> Testing newer kernels and read-ahead patches may benefit you as well. +> +> I've been really impressed by the adaptive readahead patches with +> postgres. +> +> Mike Stone +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: explain analyze is your friend +> + + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 01:47:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 29C7D9FB280 + for ; + Thu, 3 Aug 2006 01:47:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 15823-02 for + ; + Thu, 3 Aug 2006 04:46:44 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.200]) + by postgresql.org (Postfix) with ESMTP id D2AB99FB20E + for ; + Thu, 3 Aug 2006 01:46:43 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so441503nzd + for ; + Wed, 02 Aug 2006 21:46:41 -0700 (PDT) +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=ntSwUtLP1xYx3k0sAyDgOeSzDo7KZqLFLrlnBlGjOzml4sjZ6+dE8DvIGDWHsurzxzTUVg2P4EN4klt4Ar9PGqk34CLVB9CWtmiWvglsQSVe3s9lLvIEVe5KNzd/+yo6uHxzhfSRRw03cSxH3MpHG5UI4gxvn7n/DFBcrFC6hSQ= +Received: by 10.65.59.19 with SMTP id m19mr2502647qbk; + Wed, 02 Aug 2006 21:46:41 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Wed, 2 Aug 2006 21:46:41 -0700 (PDT) +Message-ID: +Date: Thu, 3 Aug 2006 00:46:41 -0400 +From: "Merlin Moncure" +To: "Alex Turner" +Subject: Re: RAID stripe size question +Cc: "Ron Peacetree" , + "Mikael Carneholm" , + pgsql-performance@postgresql.org +In-Reply-To: <33c6269f0607172121i1b6610b1j3fc686d4132f880b@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: + <13498289.1153192075696.JavaMail.root@elwamui-huard.atl.sa.earthlink.net> + <33c6269f0607172121i1b6610b1j3fc686d4132f880b@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/33 +X-Sequence-Number: 20218 + +On 7/18/06, Alex Turner wrote: +> Remember when it comes to OLTP, massive serial throughput is not gonna help +> you, it's low seek times, which is why people still buy 15k RPM drives, and +> why you don't necessarily need a honking SAS/SATA controller which can +> harness the full 1066MB/sec of your PCI-X bus, or more for PCIe. Of course, + +hm. i'm starting to look seriously at SAS to take things to the next +level. it's really not all that expensive, cheaper than scsi even, +and you can mix/match sata/sas drives in the better enclosures. the +real wild card here is the raid controller. i still think raptors are +the best bang for the buck and SAS gives me everything i like about +sata and scsi in one package. + +moving a gigabyte around/sec on the server, attached or no, is pretty +heavy lifting on x86 hardware. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 3 01:52:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1548A9FB282 + for ; + Thu, 3 Aug 2006 01:52:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28260-04 for + ; + Thu, 3 Aug 2006 01:52:24 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) + by postgresql.org (Postfix) with ESMTP id CA8F89FB280 + for ; + Thu, 3 Aug 2006 01:52:25 -0300 (ADT) +Received: from 172.16.1.148 by mail.Mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D1)); Thu, 03 Aug 2006 00:52:15 -0400 +X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 3 Aug + 2006 00:52:15 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: RAID stripe size question +Date: Thu, 3 Aug 2006 00:51:06 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D03F0D7F6@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] RAID stripe size question +Thread-Index: Aca2t/ZEMBcK20PUQL6H03d9Nv3FuAAAAJ2w +From: "Luke Lonergan" +To: "Merlin Moncure" , + "Alex Turner" +cc: "Ron Peacetree" , + "Mikael Carneholm" , + pgsql-performance@postgresql.org +X-OriginalArrivalTime: 03 Aug 2006 04:52:15.0792 (UTC) + FILETIME=[97754300:01C6B6B8] +X-WSS-ID: 68CF5F7511K1663798-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/34 +X-Sequence-Number: 20219 + +Merlin, + +> moving a gigabyte around/sec on the server, attached or no,=20 +> is pretty heavy lifting on x86 hardware. + +Maybe so, but we're doing 2GB/s plus on Sun/Thumper with software RAID +and 36 disks and 1GB/s on a HW RAID with 16 disks, all SATA. + +WRT seek performance, we're doing 2500 seeks per second on the +Sun/Thumper on 36 disks. You might do better with 15K RPM disks and +great controllers, but I haven't seen it reported yet. + +BTW - I'm curious about the HP P600 SAS host based RAID controller - it +has very good specs, but is the Linux driver solid? + +- Luke + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 02:09:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A5E599FB29A + for ; + Thu, 3 Aug 2006 02:09:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 05788-09 for + ; + Thu, 3 Aug 2006 05:09:27 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.200]) + by postgresql.org (Postfix) with ESMTP id 2140E9FB292 + for ; + Thu, 3 Aug 2006 02:09:26 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so441782nzd + for ; + Wed, 02 Aug 2006 22:09:22 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; + b=iTNybRbJFFyV/jNHk2xdTsW75Oz4qpLtca3zftpNEv08zquTl/vuSY6vbkQiQiR632cX2tWX3AyUNaF9M7NC9VzVVARXDejV1iluH5byqNWgWWT6ZPS+tRLSb1EnNkGN76RvlJOvaL+9MqeY2wb5DsemdJTPhETH9vMkmQGOeZs= +Received: by 10.65.114.11 with SMTP id r11mr2555974qbm; + Wed, 02 Aug 2006 22:09:22 -0700 (PDT) +Received: by 10.64.179.18 with HTTP; Wed, 2 Aug 2006 22:08:52 -0700 (PDT) +Message-ID: <5f820f750608022208ka5a2f81t4ac39d583685daf3@mail.gmail.com> +Date: Thu, 3 Aug 2006 01:08:52 -0400 +From: "Denis Lussier" +To: "Florian Weimer" +Subject: Re: Performances with new Intel Core* processors +Cc: "Arjen van der Meijden" , + "Merlin Moncure" , + "Jonathan Ballet" , pgsql-performance@postgresql.org +In-Reply-To: <8264hchq4a.fsf@mid.bfk.de> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_67392_24977663.1154581732780" +References: <44CDFD44.8080307@multani.info> + + <44CE3023.3020402@tweakers.net> <8264hchq4a.fsf@mid.bfk.de> +X-Google-Sender-Auth: db3fbdea2492b8fe +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=4.191 tagged_above=0 required=5 tests=HTML_30_40, + HTML_MESSAGE, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: **** +X-Archive-Number: 200608/35 +X-Sequence-Number: 20220 + +------=_Part_67392_24977663.1154581732780 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +My theory, based entirely on what I have read in this thread, is that a low +end server (really a small workstation) with an Intel Dual Core CPU is +likely an excellent PG choice for the lowest end. + +I'll try to snag an Intel Dual Core workstation in the near future and +report back DBT2 scores comparing it to a similarly equiped 1 socket AMD +dual core workstation. I'll keep the data size small to fit entirely in +RAM so the DBT2 isn't it's usual disk bound dog when you run it the "right" +way (according to tpc-c guidelines). + +--Denis + Dweeb from EnterpriseDB + +On 8/1/06, Florian Weimer wrote: +> +> * Arjen van der Meijden: +> +> > For a database system, however, processors hardly ever are the main +> > bottleneck, are they? +> +> Not directly, but the choice of processor influences which +> chipsets/mainboards are available, which in turn has some impact on +> the number of RAM slots. (According to our hardware supplier, beyound +> 8 GB, the price per GB goes up sharply.) Unfortunately, it seems that +> the Core 2 Duo mainboards do not change that much in this area. +> +> -- +> Florian Weimer +> BFK edv-consulting GmbH http://www.bfk.de/ +> Durlacher Allee 47 tel: +49-721-96201-1 +> D-76131 Karlsruhe fax: +49-721-96201-99 +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + +------=_Part_67392_24977663.1154581732780 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +My theory, based entirely on what I have read in this thread, is that a low end server (really a small workstation) with an Intel Dual Core CPU is likely an excellent PG choice for the lowest end.

I'll try to snag an Intel Dual Core workstation in the near future and report back DBT2 scores comparing it to a similarly equiped 1 socket AMD dual core workstation.   I'll keep the data size small to fit entirely in RAM so the DBT2 isn't it's usual disk bound dog when you run it the "right" way (according to tpc-c guidelines). +

--Denis
   Dweeb from EnterpriseDB

On 8/1/06, Florian Weimer <fweimer@bfk.de> wrote:
+* Arjen van der Meijden:

> For a database system, however, processors hardly ever are the main
> bottleneck, are they?

Not directly, but the choice of processor influences which
chipsets/mainboards are available, which in turn has some impact on +
the number of RAM slots.  (According to our hardware supplier, beyound
8 GB, the price per GB goes up sharply.)  Unfortunately, it seems that
the Core 2 Duo mainboards do not change that much in this area.

+--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Durlacher Allee 47            tel: +49-721-96201-1 +
D-76131 Karlsruhe             fax: +49-721-96201-99

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not +
       match

+ +------=_Part_67392_24977663.1154581732780-- + +From pgsql-performance-owner@postgresql.org Thu Aug 3 02:22:38 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 969E69FB292 + for ; + Thu, 3 Aug 2006 02:22:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 29213-09 for + ; + Thu, 3 Aug 2006 02:22:28 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.179]) + by postgresql.org (Postfix) with ESMTP id C040E9FA48E + for ; + Thu, 3 Aug 2006 02:22:29 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id b36so361583pyb + for ; + Wed, 02 Aug 2006 22:22:27 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; + b=TeHScmsSkf0tEVjCkFssBcLM5/4M5njldi+O92ZiYRAV7xyZE6S+L4UXvdRr3bQ7Q301IubzckcmZaewZFbkpMUPJLWeOgl5Jl66TCIRA8Bp5srwdXGSwkxdv5DW6VCTXHFQJt2BV2DCkk7SRPNomg3BHfetBbIS/70JX7XRj/k= +Received: by 10.65.59.20 with SMTP id m20mr2606721qbk; + Wed, 02 Aug 2006 22:22:26 -0700 (PDT) +Received: by 10.64.179.18 with HTTP; Wed, 2 Aug 2006 22:21:56 -0700 (PDT) +Message-ID: <5f820f750608022221s69e6d593oa9778a759a625bc4@mail.gmail.com> +Date: Thu, 3 Aug 2006 01:21:56 -0400 +From: "Denis Lussier" +To: "Merlin Moncure" +Subject: Re: PITR performance overhead? +Cc: "George Pavlov" , pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_67428_14286649.1154582516665" +References: <20060731170833.GH2900@mathom.us> + <8C5B026B51B6854CBE88121DBF097A863329F2@ehost010-33.exch010.intermedia.net> + +X-Google-Sender-Auth: c8141ec67f412ffa +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.383 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/36 +X-Sequence-Number: 20221 + +------=_Part_67428_14286649.1154582516665 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +If your server is heavily I/O bound AND you care about your data AND your +are throwing out your WAL files in the middle of the day... You are headed +for a cliff. + +I'm sure this doesn't apply to anyone on this thread, just a general +reminder to all you DBA's out there who sometimes are too busy to implement +PITR until after a disaster strikes. I know that in the past I've +personally been guilty of this on several occasions. + +--Denis + EnterpriseDB (yeah, rah, rah...) + +On 8/1/06, Merlin Moncure wrote: +> +> On 8/1/06, George Pavlov wrote: +> > I am looking for some general guidelines on what is the performance +> > overhead of enabling point-in-time recovery (archive_command config) on +> > an 8.1 database. Obviously it will depend on a multitude of factors, but +> > some broad-brush statements and/or anecdotal evidence will suffice. +> > Should one worry about its performance implications? Also, what can one +> > do to mitigate it? +> +> pitr is extremely cheap both in performance drag and administation +> overhead for the benefits it provides. it comes almost for free, just +> make sure you can handle all the wal files and do sane backup +> scheduling. in fact, pitr can actually reduce the load on a server +> due to running less frequent backups. if your server is heavy i/o +> loaded, it might take a bit of planning. +> +> merlin +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + +------=_Part_67428_14286649.1154582516665 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +If your server is heavily I/O bound AND you care about your data AND your are throwing out your WAL files in the middle of the day...  You are headed for a cliff.  

I'm sure this doesn't apply to anyone on this thread, just a general reminder to all you DBA's out there who sometimes are too busy to implement PITR until after a disaster strikes.   I know that in the past I've personally been guilty of this on several occasions. +

--Denis
  EnterpriseDB (yeah, rah, rah...)

On 8/1/06, Merlin Moncure <mmoncure@gmail.com> wrote: +
On 8/1/06, George Pavlov <gpavlov@mynewplace.com +> wrote:
> I am looking for some general guidelines on what is the performance
> overhead of enabling point-in-time recovery (archive_command config) on
> an 8.1 database. Obviously it will depend on a multitude of factors, but +
> some broad-brush statements and/or anecdotal evidence will suffice.
> Should one worry about its performance implications? Also, what can one
> do to mitigate it?

pitr is extremely cheap both in performance drag and administation +
overhead for the benefits it provides.  it comes almost for free, just
make sure you can handle all the wal files and do sane backup
scheduling.  in fact, pitr can actually reduce the load on a server
due to running less frequent backups.  if your server is heavy i/o +
loaded, it might take a bit of planning.

merlin

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               +http://archives.postgresql.org

+ +------=_Part_67428_14286649.1154582516665-- + +From pgsql-performance-owner@postgresql.org Thu Aug 3 02:36:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id EA1299FB29E + for ; + Thu, 3 Aug 2006 02:36:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 34604-02 for + ; + Thu, 3 Aug 2006 02:36:44 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.197]) + by postgresql.org (Postfix) with ESMTP id 74AE69FB29A + for ; + Thu, 3 Aug 2006 02:36:45 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so442208nzd + for ; + Wed, 02 Aug 2006 22:36:40 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; + b=pOvZtf8l0E1NNl6KrbhFQwVGXyirRSVPPHCiPSsxN8BU7Tf/hysAidcN7fOFbaUoU6V/ywZws5sTGxlI2lLLpKz3iKv0c4qPsjzwAFFeb6ny2etyTgg2U0ej/NpUfr0DTeKR5mTdyH052q8W+MfNGZGA2a3kpMKyGhZu1F3gXWA= +Received: by 10.65.112.5 with SMTP id p5mr2571469qbm; + Wed, 02 Aug 2006 22:36:40 -0700 (PDT) +Received: by 10.64.179.18 with HTTP; Wed, 2 Aug 2006 22:36:10 -0700 (PDT) +Message-ID: <5f820f750608022236yd8dd6escce3bb849b91bddb@mail.gmail.com> +Date: Thu, 3 Aug 2006 01:36:10 -0400 +From: "Denis Lussier" +To: "Luke Lonergan" +Subject: Re: XFS filessystem for Datawarehousing -2 +Cc: "Milen Kulev" , pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_67512_30951560.1154583370571" +References: <014401c6b5b8$98926a20$0a00a8c0@trivadis.com> + +X-Google-Sender-Auth: 6507723b2c1d39ff +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.544 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/37 +X-Sequence-Number: 20222 + +------=_Part_67512_30951560.1154583370571 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I was kinda thinking that making the Block Size configurable at InitDB time +would be a nice & simple enhancement for PG 8.3. My own personal rule of +thumb for sizing is 8k for OLTP, 16k for mixed use, & 32k for DWH. + +I have no personal experience with XFS, but, I've seen numerous internal +edb-postgres test results that show that of all file systems... OCFS +2.0seems to be quite good for PG update intensive apps (especially on +64 bit +machines). + +On 8/1/06, Luke Lonergan wrote: +> +> Milen, +> +> On 8/1/06 3:19 PM, "Milen Kulev" wrote: +> +> > Sorry, forgot to ask: +> > What is the recommended/best PG block size for DWH database? 16k, +> 32k, 64k +> > ? +> > What hsould be the relation between XFS/RAID stripe size and PG block +> size ? +> +> We have found that the page size in PG starts to matter only at very high +> disk performance levels around 1000MB/s. Other posters have talked about +> maintenance tasks improving in performance, but I haven't seen it. +> +> - Luke +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + +------=_Part_67512_30951560.1154583370571 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +
I was kinda thinking that making the Block Size configurable at InitDB time would be a nice & simple enhancement for PG 8.3.  My own personal rule of thumb for sizing is 8k for OLTP, 16k for mixed use, & 32k for DWH. +

I have no personal experience with XFS, but, I've seen numerous internal edb-postgres test results that show that of all file systems... OCFS 2.0 seems to be quite good for PG update intensive apps (especially on 64 bit machines). +

On 8/1/06, Luke Lonergan <llonergan@greenplum.com> wrote:
+Milen,

On 8/1/06 3:19 PM, "Milen Kulev" <makulev@gmx.net> wrote:

> Sorry, forgot to ask:
> What is the recommended/best  PG block size for DWH  database?  16k, 32k, 64k +
> ?
> What hsould be the relation  between XFS/RAID stripe size and PG block size ?

We have found that the page size in PG starts to matter only at very high
disk performance levels around 1000MB/s.  Other posters have talked about +
maintenance tasks improving in performance, but I haven't seen it.

- Luke



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
+
               http://archives.postgresql.org

+ +------=_Part_67512_30951560.1154583370571-- + +From pgsql-performance-owner@postgresql.org Thu Aug 3 04:11:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3248C9FB2A0 + for ; + Thu, 3 Aug 2006 04:11:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60474-03 for + ; + Thu, 3 Aug 2006 04:11:18 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from smtp3.smiths.com (smtp3.smiths.com [192.208.34.52]) + by postgresql.org (Postfix) with ESMTP id 9C7EA9FB282 + for ; + Thu, 3 Aug 2006 04:11:19 -0300 (ADT) +Received: from COSSMGIMS04.EMAIL.CORP.TLD (unknown [10.225.225.147]) + by smtp3.smiths.com (Postfix) with ESMTP id 7926832B1F + for ; + Thu, 3 Aug 2006 01:11:16 -0600 (MDT) +Received: from COSSMGMBX04.EMAIL.CORP.TLD ([10.225.225.26]) by + COSSMGFEB03.EMAIL.CORP.TLD with Microsoft SMTPSVC(6.0.3790.1830); + Thu, 3 Aug 2006 01:11:15 -0600 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +Subject: Re: XFS filessystem for Datawarehousing +Date: Thu, 3 Aug 2006 01:10:39 -0600 +Message-ID: + +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Re: [PERFORM] XFS filessystem for Datawarehousing +Thread-Index: Aca2dsPOgVLjRB41TYuO9gZerJT3uwAUyXvA +From: "Koth, Christian (DWBI)" +To: "Milen Kulev" +Cc: +X-OriginalArrivalTime: 03 Aug 2006 07:11:15.0714 (UTC) + FILETIME=[02705E20:01C6B6CC] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/38 +X-Sequence-Number: 20223 + + +Milen, + +> XFS, EXT3, JFS +For what reason are you planning to use a journaling FS? I think using WAL,= + fsyncing every transaction and using a journaling FS is tautologous. And= + if you have problems using EXT2 you can just add the journal later without= + loosing data. +My tests using EXT2 showed a performance boost up to 50% on INSERTs. + +Christian + +> I am pretty exited whether XFS will clearly outpertform ETX3=0D +> (no default setups for both are planned !). I am not sure +> whether is it worth to include JFS in comparison too ... +>=0D +>=0D +> Best Regards, +> Milen Kulev +>=0D + +****************************************** +The information contained in, or attached to, this e-mail, may contain= + confidential information and is intended solely for the use of the= + individual or entity to whom they are addressed and may be subject to= + legal privilege. If you have received this e-mail in error you should= + notify the sender immediately by reply e-mail, delete the message from= + your system and notify your system manager. Please do not copy it for any= + purpose, or disclose its contents to any other person. The views or= + opinions presented in this e-mail are solely those of the author and do= + not necessarily represent those of the company. The recipient should= + check this e-mail and any attachments for the presence of viruses. The= + company accepts no liability for any damage caused, directly or= + indirectly, by any virus transmitted in this email. +****************************************** + +From pgsql-performance-owner@postgresql.org Thu Aug 3 04:17:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 0DF419FB2A0 + for ; + Thu, 3 Aug 2006 04:17:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60760-05 for + ; + Thu, 3 Aug 2006 04:17:17 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx00.ext.bfk.de (mx00.ext.bfk.de [217.29.46.125]) + by postgresql.org (Postfix) with ESMTP id BC7F99FB282 + for ; + Thu, 3 Aug 2006 04:17:18 -0300 (ADT) +Received: from fweimer by bfk.de with local id 1G8XSC-0007Ik-Pe; + Thu, 03 Aug 2006 09:17:12 +0200 +To: "Koth, Christian (DWBI)" +Cc: "Milen Kulev" , +Subject: Re: XFS filessystem for Datawarehousing +References: + +From: Florian Weimer +Date: Thu, 03 Aug 2006 09:17:12 +0200 +In-Reply-To: + + (Christian Koth's message of "Thu, 3 Aug 2006 01:10:39 -0600") +Message-ID: <8264haffuv.fsf@mid.bfk.de> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.014 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/39 +X-Sequence-Number: 20224 + +* Christian Koth: + +> For what reason are you planning to use a journaling FS? I think +> using WAL, fsyncing every transaction and using a journaling FS is +> tautologous. + +The journal is absolutely required to preserve the integrity of the +file system's own on-disk data structures after a crash. Even if +you've got a trustworthy file system checker (there are surprisingly +few of them, especially for advanced file systems without fixed data +structure locations), running it after a crash usually leads to +unacceptably high downtime. + +-- +Florian Weimer +BFK edv-consulting GmbH http://www.bfk.de/ +Durlacher Allee 47 tel: +49-721-96201-1 +D-76131 Karlsruhe fax: +49-721-96201-99 + +From pgsql-performance-owner@postgresql.org Thu Aug 3 06:41:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 932649FB285 + for ; + Thu, 3 Aug 2006 06:41:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 27436-04 for + ; + Thu, 3 Aug 2006 09:40:49 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) + by postgresql.org (Postfix) with ESMTP id 3FF9E9FB282 + for ; + Thu, 3 Aug 2006 06:40:48 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.113.236]) + by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J3F003Q31IPP961@vms048.mailsrvcs.net> for + pgsql-performance@postgresql.org; Thu, 03 Aug 2006 04:40:02 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id E3B736FA67 for + ; + Thu, 03 Aug 2006 05:39:59 -0400 (EDT) +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 xwJKyXsw0aOJ for ; Thu, + 03 Aug 2006 05:39:58 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 91CEA6FAAA; Thu, 03 Aug 2006 05:39:56 -0400 (EDT) +Date: Thu, 03 Aug 2006 05:39:56 -0400 +From: Michael Stone +Subject: Re: XFS filessystem for Datawarehousing +In-reply-to: + +To: pgsql-performance@postgresql.org +Mail-followup-to: pgsql-performance@postgresql.org +Message-id: <20060803093953.GP2900@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: + +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/40 +X-Sequence-Number: 20225 + +On Thu, Aug 03, 2006 at 01:10:39AM -0600, Koth, Christian (DWBI) wrote: +>For what reason are you planning to use a journaling FS? I think using WAL, fsyncing every transaction and using a journaling FS is tautologous. And if you have problems using EXT2 you can just add the journal later without loosing data. +>My tests using EXT2 showed a performance boost up to 50% on INSERTs. + +The requirements for the WAL filesystem and for the data filesystem are +different. Having the WAL on a small ext2 filesystem makes sense and is +good for performance. Having the data on a huge ext2 filesystem is a +horrible idea, because you'll fsck forever if there's a crash, and +because ext2 isn't a great performer for large filesystems. I typically +have a couple-gig ext2 WAL paired with a couple of couple-hundred-gig +xfs data & index partitions. Note that the guarantees of a journaling fs +like xfs have nothing to do with the kind of journaling done by the WAL, +and each has its place on a postgres system. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Thu Aug 3 13:12:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 77F899FB336 + for ; + Thu, 3 Aug 2006 13:12:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 79782-03 for + ; + Thu, 3 Aug 2006 16:12:19 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail2.dbitech.ca (radius.wavefire.com [64.141.13.252]) + by postgresql.org (Postfix) with SMTP id AB9EC9FB37B + for ; + Thu, 3 Aug 2006 13:12:18 -0300 (ADT) +Received: (qmail 27690 invoked from network); 3 Aug 2006 16:14:48 -0000 +Received: from archeron.wavefire.com (64.141.15.246) + by radius.wavefire.com with SMTP; 3 Aug 2006 16:14:48 -0000 +From: Wade Klaver +Reply-To: archeron@wavefire.com +To: pgsql-performance@postgresql.org +Subject: unsubscribe +Date: Thu, 3 Aug 2006 09:03:23 -0700 +User-Agent: KMail/1.9.1 +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +Message-Id: <200608030903.23811.archeron@wavefire.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/41 +X-Sequence-Number: 20226 + +unsubscribe +-- +Wade Klaver +Wavefire Technologies Corporation +GPG Public Key at http://archeron.wavefire.com + +/"\ ASCII Ribbon Campaign . +\ / - NO HTML/RTF in e-mail . + X - NO Word docs in e-mail . +/ \ ----------------------------------------------------------------- + +From pgsql-performance-owner@postgresql.org Thu Aug 3 13:39:56 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D51A89FB1CF + for ; + Thu, 3 Aug 2006 13:39:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 45981-07 for + ; + Thu, 3 Aug 2006 13:39:51 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id EDADD9FA50D + for ; + Thu, 3 Aug 2006 13:39:50 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k73GdlBu020306; + Thu, 3 Aug 2006 12:39:49 -0400 (EDT) +To: Richard Rowell +cc: pgsql-performance@postgresql.org +Subject: Re: Strange behaviour +In-reply-to: <1154036222.22231.40.camel@meowth> +References: <1154036222.22231.40.camel@meowth> +Comments: In-reply-to Richard Rowell + message dated "Thu, 27 Jul 2006 17:37:02 -0400" +Date: Thu, 03 Aug 2006 12:39:46 -0400 +Message-ID: <20305.1154623186@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.167 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/42 +X-Sequence-Number: 20227 + +Richard Rowell writes: +> We are using a BI tool that generates some rather ugly queries. One of +> the ugly queries is taking much longer to return thin I think it +> should. +> (http://www.bowmansystems.com/~richard/full.analyze) +> Can anyone shed any light on what is going on here? + +Seems like you have some bad rowcount estimates leading to poor plan +selection. Most of the problem looks to be coming from the FunctionScan +nodes, wherein the planner doesn't have any real way to estimate how +many rows come out. You might look into whether you can replace those +functions with views, so that the planner isn't dealing with "black boxes". + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 3 16:14:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from wm.hub.org (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5869F9FB259 + for ; + Thu, 3 Aug 2006 16:14:12 -0300 (ADT) +Received: from maia (wm.hub.org [200.46.204.128]) + by wm.hub.org (Postfix) with ESMTP id 4D623DF999C + for ; + Thu, 3 Aug 2006 19:14:12 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 46F759FB205 + for ; + Thu, 3 Aug 2006 15:33:41 -0300 (ADT) +Received: from [192.168.100.248] (router.journyx.com [66.219.41.226]) + (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by noel.decibel.org (Postfix) with ESMTP id B9A0D56435 + for ; + Thu, 3 Aug 2006 13:33:39 -0500 (CDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Transfer-Encoding: 7bit +Message-Id: +Content-Type: text/plain; charset=US-ASCII; format=flowed +To: PGSQL Performance +From: Jim Nasby +Subject: +Date: Thu, 3 Aug 2006 13:33:35 -0500 +X-Mailer: Apple Mail (2.752.2) +X-Archive-Number: 200608/43 +X-Sequence-Number: 20228 + +I'm at a client who's an ASP; they've written their app such that each +customer gets their own database. Rigth now they're at nearly 200 +databases, and were thinking that they "must be the largest PostgreSQL +install in the world". :) After taking them down a notch or two, I +started wondering how many sites could beat 200 databases in a single +cluster. I'm sure there's any number that can, though 200 databases in a +cluster certainly isn't mainstream. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + + + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 16:19:10 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 7AF599FB24D + for ; + Thu, 3 Aug 2006 16:19:09 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 33092-01 for + ; + Thu, 3 Aug 2006 19:19:00 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from cassarossa.samfundet.no (cassarossa.samfundet.no + [129.241.93.19]) + by postgresql.org (Postfix) with ESMTP id 8A6689FB205 + for ; + Thu, 3 Aug 2006 16:19:00 -0300 (ADT) +Received: from [2001:700:300:dc0f:216:3eff:fe40:5a47] (helo=trofast.sesse.net) + by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1G8iif-0005VM-4K + for pgsql-performance@postgresql.org; Thu, 03 Aug 2006 21:18:58 +0200 +Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) + id 1G8ifC-0005xS-00 + for ; Thu, 03 Aug 2006 21:15:22 +0200 +Date: Thu, 3 Aug 2006 21:15:22 +0200 +From: "Steinar H. Gunderson" +To: pgsql-performance@postgresql.org +Subject: Re: +Message-ID: <20060803191522.GA22878@uio.no> +Mail-Followup-To: pgsql-performance@postgresql.org +References: +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +In-Reply-To: +X-Operating-System: Linux 2.6.16trofastxen on a x86_64 +X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/44 +X-Sequence-Number: 20229 + +On Thu, Aug 03, 2006 at 01:33:35PM -0500, Jim Nasby wrote: +> I'm at a client who's an ASP; they've written their app such that each +> customer gets their own database. Rigth now they're at nearly 200 +> databases, and were thinking that they "must be the largest PostgreSQL +> install in the world". :) After taking them down a notch or two, I +> started wondering how many sites could beat 200 databases in a single +> cluster. I'm sure there's any number that can, though 200 databases in a +> cluster certainly isn't mainstream. + +cassarossa:~> psql -h sql -l | grep 'rows)' +(137 rows) + +That's our measly student society. :-) + +/* Steinar */ +-- +Homepage: http://www.sesse.net/ + +From pgsql-performance-owner@postgresql.org Thu Aug 3 16:29:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5CCAC9FB24D + for ; + Thu, 3 Aug 2006 16:29:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60365-07 for + ; + Thu, 3 Aug 2006 16:29:44 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.192]) + by postgresql.org (Postfix) with ESMTP id 2E4349FB205 + for ; + Thu, 3 Aug 2006 16:29:43 -0300 (ADT) +Received: by wx-out-0102.google.com with SMTP id t13so1139933wxc + for ; + Thu, 03 Aug 2006 12:29:43 -0700 (PDT) +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:references; + b=IDxmn8OJX09k7wkrXD8UZdBp53czDIWSa3DzBnusUB9p52eiZv+8jbUoi57t0Q11+EM/YLPftqJOZ0O7SnQ8kuviN0EOGhlyu8EDDDLmwITXB7j5azD9rCjcogEWPozn44jdSt/xEx9wS1opb/KbxyLxWoVnGVfISJxV494HlwA= +Received: by 10.70.32.10 with SMTP id f10mr3682228wxf; + Thu, 03 Aug 2006 12:29:43 -0700 (PDT) +Received: by 10.70.73.6 with HTTP; Thu, 3 Aug 2006 12:29:42 -0700 (PDT) +Message-ID: <1d219a6f0608031229r15868fb4p37ba030c591a25e1@mail.gmail.com> +Date: Thu, 3 Aug 2006 15:29:42 -0400 +From: "Chris Hoover" +To: "Jim Nasby" +Subject: Re: +Cc: "PGSQL Performance" +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_83725_23926613.1154633382954" +References: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.994 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/45 +X-Sequence-Number: 20230 + +------=_Part_83725_23926613.1154633382954 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I've got 226 customer databases in one cluster. Works like a champ with +8.1.3. I have 3 additional PostgreSQL servers with our largest customers on +them. They have between 10 and 30 databases. The smallest of my servers +has 261GB's worth of db's in the cluster, and the largest is 400GB's. + +BTW, our application is an asp application also. + +Just some fun numbers for you. + +Chris + +P.S. + +Thanks to all of the PostgreSQL developers for the great work and for +providing the awesome support. + +On 8/3/06, Jim Nasby wrote: +> +> I'm at a client who's an ASP; they've written their app such that each +> customer gets their own database. Rigth now they're at nearly 200 +> databases, and were thinking that they "must be the largest PostgreSQL +> install in the world". :) After taking them down a notch or two, I +> started wondering how many sites could beat 200 databases in a single +> cluster. I'm sure there's any number that can, though 200 databases in a +> cluster certainly isn't mainstream. +> -- +> Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +> Pervasive Software http://pervasive.com work: 512-231-6117 +> vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 +> +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + +------=_Part_83725_23926613.1154633382954 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I've got 226 customer databases in one cluster.  Works like a champ with 8.1.3.  I have 3 additional PostgreSQL servers with our largest customers on them.  They have between 10 and 30 databases.  The smallest of my servers has 261GB's worth of db's in the cluster, and the largest is 400GB's. +

BTW, our application is an asp application also.

Just some fun numbers for you.

Chris

P.S.

Thanks to all of the PostgreSQL developers for the great work and for providing the awesome support. +

On 8/3/06, Jim Nasby <jnasby@pervasive.com> wrote:
+I'm at a client who's an ASP; they've written their app such that each
customer gets their own database. Rigth now they're at nearly 200
databases, and were thinking that they "must be the largest PostgreSQL
+install in the world". :) After taking them down a notch or two, I
started wondering how many sites could beat 200 databases in a single
cluster. I'm sure there's any number that can, though 200 databases in a
+cluster certainly isn't mainstream.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com +    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461




---------------------------(end of broadcast)--------------------------- +
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

+ +------=_Part_83725_23926613.1154633382954-- + +From pgsql-performance-owner@postgresql.org Thu Aug 3 16:49:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6E06C9FB259 + for ; + Thu, 3 Aug 2006 16:49:52 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 32863-09 for + ; + Thu, 3 Aug 2006 19:49:47 +0000 (UTC) +X-Greylist: delayed 00:18:41.456225 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id A24519FB26F + for ; + Thu, 3 Aug 2006 16:49:47 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mailhost.intellivid.com (mailhost.intellivid.com + [64.32.200.11]) + by svr4.postgresql.org (Postfix) with ESMTP id 46BCD5AFB28 + for ; + Thu, 3 Aug 2006 19:31:03 +0000 (GMT) +Received: from newmail (localhost [127.0.0.1]) + by newmail.intellivid.com (Postfix) with ESMTP id 33C5AF18192; + Thu, 3 Aug 2006 15:31:01 -0400 (EDT) +Received: from vega.intellivid.com (vega.intellivid.com [192.168.2.80]) + by newmail.intellivid.com (Postfix) with ESMTP id 352B3F18191; + Thu, 3 Aug 2006 15:30:40 -0400 (EDT) +Subject: Re: +From: Ian Westmacott +To: "Steinar H. Gunderson" +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060803191522.GA22878@uio.no> +References: + <20060803191522.GA22878@uio.no> +Content-Type: text/plain +Organization: IntelliVid Corp. +Date: Thu, 03 Aug 2006 15:30:40 -0400 +Message-Id: <1154633440.12111.10.camel@vega.intellivid.com> +Mime-Version: 1.0 +X-Mailer: Evolution 2.6.0 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/47 +X-Sequence-Number: 20232 + +is that all? + + psql -l | grep 'rows)' +(2016 rows) + +On Thu, 2006-08-03 at 21:15 +0200, Steinar H. Gunderson wrote: +> On Thu, Aug 03, 2006 at 01:33:35PM -0500, Jim Nasby wrote: +> > I'm at a client who's an ASP; they've written their app such that each +> > customer gets their own database. Rigth now they're at nearly 200 +> > databases, and were thinking that they "must be the largest PostgreSQL +> > install in the world". :) After taking them down a notch or two, I +> > started wondering how many sites could beat 200 databases in a single +> > cluster. I'm sure there's any number that can, though 200 databases in a +> > cluster certainly isn't mainstream. +> +> cassarossa:~> psql -h sql -l | grep 'rows)' +> (137 rows) +> +> That's our measly student society. :-) +> +> /* Steinar */ + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 16:44:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 0391A9FB26A + for ; + Thu, 3 Aug 2006 16:44:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 59841-10 for + ; + Thu, 3 Aug 2006 16:44:33 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.net [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id 1B7079FB259 + for ; + Thu, 3 Aug 2006 16:44:32 -0300 (ADT) +Received: (qmail invoked by alias); 03 Aug 2006 19:44:30 -0000 +Received: from dslb-084-057-048-060.pools.arcor-ip.net (EHLO ltmku) + [84.57.48.60] + by mail.gmx.net (mp002) with SMTP; 03 Aug 2006 21:44:30 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: "'Luke Lonergan'" , + "'Michael Stone'" , + +Subject: Re: XFS filessystem for Datawarehousing +Date: Thu, 3 Aug 2006 21:44:27 +0200 +Message-ID: <024701c6b735$3b3fbb60$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +In-Reply-To: +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.088 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/46 +X-Sequence-Number: 20231 + +Hi Luke, +That is ~ 50% increase !! Amazing... +How many reader processes did you have to get this results ? + +Regards. Milen + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Luke Lonergan +Sent: Thursday, August 03, 2006 6:05 AM +To: Michael Stone; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] XFS filessystem for Datawarehousing + + +Again - the performance difference increases as the disk speed increases. + +Our experience is that we went from 300MB/s to 475MB/s when moving from ext3 to xfs. + +- Luke + + +On 8/2/06 4:33 PM, "Michael Stone" wrote: + +> On Wed, Aug 02, 2006 at 02:26:39PM -0700, Steve Poe wrote: +>> For the past year, I have been running odbc-bench on a dual-opteron +>> with 4GB of RAM using a 8GB sample data. I found the performance +>> difference between EXT3, JFS, and XFS is +/- 5-8%. +> +> That's not surprising when your db is only 2x your RAM. You'll find +> that filesystem performance is much more important when your database +> is 10x+ your RAM (which is often the case once your database heads +> toward a TB). +> +>> Testing newer kernels and read-ahead patches may benefit you as well. +> +> I've been really impressed by the adaptive readahead patches with +> postgres. +> +> Mike Stone +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 6: explain analyze is your friend +> + + + +---------------------------(end of broadcast)--------------------------- +TIP 5: don't forget to increase your free space map settings + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 16:56:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 848499FB26F + for ; + Thu, 3 Aug 2006 16:56:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 41610-01 for + ; + Thu, 3 Aug 2006 19:56:27 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.de [213.165.64.21]) + by postgresql.org (Postfix) with SMTP id AF6919FB259 + for ; + Thu, 3 Aug 2006 16:56:24 -0300 (ADT) +Received: (qmail invoked by alias); 03 Aug 2006 19:56:22 -0000 +Received: from dslb-084-057-048-060.pools.arcor-ip.net (EHLO ltmku) + [84.57.48.60] + by mail.gmx.net (mp035) with SMTP; 03 Aug 2006 21:56:22 +0200 +X-Authenticated: #23352258 +From: "Milen Kulev" +To: "'Denis Lussier'" , + "'Luke Lonergan'" +Cc: +Subject: Re: XFS filessystem for Datawarehousing -2 +Date: Thu, 3 Aug 2006 21:56:19 +0200 +Message-ID: <024801c6b736$e3505ed0$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0249_01C6B747.A6D92ED0" +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 +In-Reply-To: <5f820f750608022236yd8dd6escce3bb849b91bddb@mail.gmail.com> +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.269 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/48 +X-Sequence-Number: 20233 + +This is a multi-part message in MIME format. + +------=_NextPart_000_0249_01C6B747.A6D92ED0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi Dennis,=20 +I am just cusrios to try PG with different block sizes ;) I don't know = +how much performance the bigger block size will +bring (I mean 32k or 64k , for example, for DWH applikations). +I am surprised to hear that OCFS2.0 (or any her FS usind direct I/O) = +performs well with PG. A month ago I have +performed a simple test with Veritas FS, with and than without cache = +(e.g. direct I/O). I have started 1 , then 2, , +then 3, then 4 parallel INSERT processes.=20 +Veritas FS WITH FS cache outperformed the direct I/O version by factor = +2-2.5 ! +I haven't tested woth OCFS2.0 though. I am not sure that OCFS2.0 is the = +good choice for PG data and index +filesystems. +For WAL -> perhaps. +=20 +Best Regards. Milen=20 + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org = +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Denis = +Lussier +Sent: Thursday, August 03, 2006 7:36 AM +To: Luke Lonergan +Cc: Milen Kulev; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] XFS filessystem for Datawarehousing -2 + + + +I was kinda thinking that making the Block Size configurable at InitDB = +time would be a nice & simple enhancement for PG +8.3. My own personal rule of thumb for sizing is 8k for OLTP, 16k for = +mixed use, & 32k for DWH.=20 + +I have no personal experience with XFS, but, I've seen numerous internal = +edb-postgres test results that show that of all +file systems... OCFS 2.0 seems to be quite good for PG update intensive = +apps (especially on 64 bit machines).=20 + + +On 8/1/06, Luke Lonergan wrote:=20 + +Milen, + +On 8/1/06 3:19 PM, "Milen Kulev" wrote: + +> Sorry, forgot to ask: +> What is the recommended/best PG block size for DWH database? 16k, = +32k, 64k=20 +> ? +> What hsould be the relation between XFS/RAID stripe size and PG block = +size ? + +We have found that the page size in PG starts to matter only at very = +high +disk performance levels around 1000MB/s. Other posters have talked = +about=20 +maintenance tasks improving in performance, but I haven't seen it. + +- Luke + + + +---------------------------(end of broadcast)--------------------------- +TIP 4: Have you searched our list archives? + + http://archives.postgresql.org + + + + +------=_NextPart_000_0249_01C6B747.A6D92ED0 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + +Nachricht + + + +
Hi=20 +Dennis,
+
I am=20 +just cusrios to try PG with different block sizes ;)  I don't=20 +know how much performance the bigger block size will bring (I = +mean 32k=20 +or 64k , for example, for DWH applikations).
+
I am=20 +surprised to hear that OCFS2.0 (or any her FS usind direct I/O) = +performs=20 +well  with PG. A month ago I have performed a simple = +test=20 +with Veritas FS, with and than without cache (e.g. direct=20 +I/O).  I have started  1  , then 2, , = +then 3,=20 +then 4 parallel INSERT processes. 
+
Veritas FS WITH FS cache outperformed the direct I/O = +version by=20 +factor 2-2.5 !
+
I=20 +haven't tested woth OCFS2.0 though. I am not sure that OCFS2.0 is  = +the good=20 +choice  for  PG data and index=20 +filesystems.
+
For=20 +WAL -> perhaps.
+
 
+
Best=20 +Regards. Milen
+
+
+
-----Original Message-----
From:=20 + pgsql-performance-owner@postgresql.org=20 + [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of = +Denis=20 + Lussier
Sent: Thursday, August 03, 2006 7:36 = +AM
To: Luke=20 + Lonergan
Cc: Milen Kulev;=20 + pgsql-performance@postgresql.org
Subject: Re: [PERFORM] XFS=20 + filessystem for Datawarehousing -2


I was kinda = + + thinking that making the Block Size configurable at InitDB time would = +be a=20 + nice & simple enhancement for PG 8.3.  My own personal rule = +of thumb=20 + for sizing is 8k for OLTP, 16k for mixed use, & 32k for DWH. = +

I=20 + have no personal experience with XFS, but, I've seen numerous internal = + + edb-postgres test results that show that of all file systems... OCFS = +2.0 seems=20 + to be quite good for PG update intensive apps (especially on 64 bit = +machines).=20 +

+
On 8/1/06, Luke=20 + Lonergan <llonergan@greenplum.com>=20 + wrote: +
Milen,

On=20 + 8/1/06 3:19 PM, "Milen Kulev" <makulev@gmx.net> = +wrote:

>=20 + Sorry, forgot to ask:
> What is the = +recommended/best  PG=20 + block size for DWH  database?  16k, 32k, 64k = +
>=20 + ?
> What hsould be the relation  between XFS/RAID = +stripe=20 + size and PG block size ?

We have found that the page size in = +PG=20 + starts to matter only at very high
disk performance levels around = + + 1000MB/s.  Other posters have talked about
maintenance = +tasks=20 + improving in performance, but I haven't seen it.

-=20 + Luke



---------------------------(end of=20 + broadcast)---------------------------
TIP 4: Have you searched = +our list=20 + = +archives?

         &n= +bsp;    =20 + http://archives.postgresql.org

+ +------=_NextPart_000_0249_01C6B747.A6D92ED0-- + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 17:31:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D7F1F9FA2A7 + for ; + Thu, 3 Aug 2006 17:31:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 49213-04 for + ; + Thu, 3 Aug 2006 20:31:26 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.198]) + by postgresql.org (Postfix) with ESMTP id E526A9FB2AA + for ; + Thu, 3 Aug 2006 17:31:25 -0300 (ADT) +Received: by wx-out-0102.google.com with SMTP id t13so1157762wxc + for ; + Thu, 03 Aug 2006 13:31:25 -0700 (PDT) +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:references; + b=DyA3j0JJr2a9X5uicK9y+yreBAegzxA7dw9aN9we2aMJkU1v1sFErwyaHFYRVvgAdsGOZsaUKYEI/t9gQlFfzkCbIHM11xxn9GUGFEfigCovxhTNib1Crvrfu79cL7NptmqEtkykhKNFbMB2xwlVEto3vEN1DzLlKb1i+EzQx28= +Received: by 10.70.89.1 with SMTP id m1mr3733557wxb; + Thu, 03 Aug 2006 13:31:25 -0700 (PDT) +Received: by 10.70.73.6 with HTTP; Thu, 3 Aug 2006 13:31:24 -0700 (PDT) +Message-ID: <1d219a6f0608031331p350affeem2773df18abdd2443@mail.gmail.com> +Date: Thu, 3 Aug 2006 16:31:24 -0400 +From: "Chris Hoover" +To: "Ian Westmacott" +Subject: Re: +Cc: "Steinar H. Gunderson" , + pgsql-performance@postgresql.org +In-Reply-To: <1154633440.12111.10.camel@vega.intellivid.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_84872_18009305.1154637084920" +References: + <20060803191522.GA22878@uio.no> + <1154633440.12111.10.camel@vega.intellivid.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.574 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/49 +X-Sequence-Number: 20234 + +------=_Part_84872_18009305.1154637084920 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Just curious, is this a production server? Also, how large is the total +cluster on disk? + +On 8/3/06, Ian Westmacott wrote: +> +> is that all? +> +> psql -l | grep 'rows)' +> (2016 rows) +> +> On Thu, 2006-08-03 at 21:15 +0200, Steinar H. Gunderson wrote: +> > On Thu, Aug 03, 2006 at 01:33:35PM -0500, Jim Nasby wrote: +> > > I'm at a client who's an ASP; they've written their app such that each +> > > customer gets their own database. Rigth now they're at nearly 200 +> > > databases, and were thinking that they "must be the largest PostgreSQL +> > > install in the world". :) After taking them down a notch or two, I +> > > started wondering how many sites could beat 200 databases in a single +> > > cluster. I'm sure there's any number that can, though 200 databases in +> a +> > > cluster certainly isn't mainstream. +> > +> > cassarossa:~> psql -h sql -l | grep 'rows)' +> > (137 rows) +> > +> > That's our measly student society. :-) +> > +> > /* Steinar */ +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + +------=_Part_84872_18009305.1154637084920 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Just curious, is this a production server?  Also, how large is the total cluster on disk?

On 8/3/06, Ian Westmacott < +ianw@intellivid.com> wrote:
is that all?

psql -l | grep 'rows)'
(2016 rows) +

On Thu, 2006-08-03 at 21:15 +0200, Steinar H. Gunderson wrote:
> On Thu, Aug 03, 2006 at 01:33:35PM -0500, Jim Nasby wrote:
> > I'm at a client who's an ASP; they've written their app such that each +
> > customer gets their own database. Rigth now they're at nearly 200
> > databases, and were thinking that they "must be the largest PostgreSQL
> > install in the world". :) After taking them down a notch or two, I +
> > started wondering how many sites could beat 200 databases in a single
> > cluster. I'm sure there's any number that can, though 200 databases in a
> > cluster certainly isn't mainstream.
+>
> cassarossa:~> psql -h sql -l | grep 'rows)'
> (137 rows)
>
> That's our measly student society. :-)
>
> /* Steinar */


---------------------------(end of broadcast)--------------------------- +
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

+ +------=_Part_84872_18009305.1154637084920-- + +From pgsql-performance-owner@postgresql.org Thu Aug 3 17:36:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B172D9FA2D3 + for ; + Thu, 3 Aug 2006 17:36:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 65834-09 for + ; + Thu, 3 Aug 2006 17:36:35 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.198]) + by postgresql.org (Postfix) with ESMTP id 597289FB1CF + for ; + Thu, 3 Aug 2006 17:36:35 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so534142nzd + for ; + Thu, 03 Aug 2006 13:36:33 -0700 (PDT) +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=rNIziygcjqjileFBuIokAPHPl6CjQGmjgFJmMz3/c7Ui1tVoKUpkBXJKCGBT2UdqYmv8+l6ZXNpo5JKF+O6HhxyqgrkldeRhwj14qlS4QNtpoaBtsRsdolOAAXkydTEYRXGKLzI1D/KgJQjFF4XRmQr58tCif6p4d2+AiQn/J0k= +Received: by 10.64.241.3 with SMTP id o3mr3290934qbh; + Thu, 03 Aug 2006 13:36:29 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Thu, 3 Aug 2006 13:36:29 -0700 (PDT) +Message-ID: +Date: Thu, 3 Aug 2006 16:36:29 -0400 +From: "Merlin Moncure" +To: "Luke Lonergan" +Subject: Re: RAID stripe size question +Cc: "Alex Turner" , "Ron Peacetree" , + "Mikael Carneholm" , + pgsql-performance@postgresql.org +In-Reply-To: <3E37B936B592014B978C4415F90D662D03F0D7F6@MI8NYCMAIL06.Mi8.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <3E37B936B592014B978C4415F90D662D03F0D7F6@MI8NYCMAIL06.Mi8.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.518 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/50 +X-Sequence-Number: 20235 + +On 8/3/06, Luke Lonergan wrote: +> Merlin, +> +> > moving a gigabyte around/sec on the server, attached or no, +> > is pretty heavy lifting on x86 hardware. + +> Maybe so, but we're doing 2GB/s plus on Sun/Thumper with software RAID +> and 36 disks and 1GB/s on a HW RAID with 16 disks, all SATA. + +that is pretty amazing, that works out to 55 mb/sec/drive, close to +theoretical maximums. are you using pci-e sata controller and raptors +im guessing? this is doubly impressive if we are talking raid 5 here. + do you find that software raid is generally better than hardware at +the highend? how much does this tax the cpu? + +> WRT seek performance, we're doing 2500 seeks per second on the +> Sun/Thumper on 36 disks. You might do better with 15K RPM disks and +> great controllers, but I haven't seen it reported yet. + +thats pretty amazing too. only a highly optimized raid system can +pull this off. + +> BTW - I'm curious about the HP P600 SAS host based RAID controller - it +> has very good specs, but is the Linux driver solid? + +have no clue. i sure hope i dont go through the same headaches as +with ibm scsi drivers (rebranded adaptec btw). sas looks really +promising however. the adaptec sas gear is so cheap it might be worth +it to just buy some and see what it can do. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 10 15:52:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B696D9FA2D3 + for ; + Thu, 3 Aug 2006 17:43:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 66876-05 for + ; + Thu, 3 Aug 2006 17:43:05 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id C9A7B9FB1CF + for ; + Thu, 3 Aug 2006 17:43:05 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id D97A330F59; Thu, 3 Aug 2006 22:43:04 +0200 (MET DST) +From: "contact1981" +X-Newsgroups: pgsql.performance +Subject: Migrating data from DB2 to SQL Server +Date: 3 Aug 2006 13:42:58 -0700 +Organization: http://groups.google.com +Lines: 14 +Message-ID: <1154637778.693657.161630@i3g2000cwc.googlegroups.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset="iso-8859-1" +X-Complaints-To: groups-abuse@google.com +User-Agent: G2/0.2 +X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; + .NET CLR 2.0.50727; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) +Complaints-To: groups-abuse@google.com +Injection-Info: i3g2000cwc.googlegroups.com; posting-host=64.211.109.170; + posting-account=XEHiDg0AAAB5T-Uln53DncS9BSpNYjWo +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/192 +X-Sequence-Number: 20377 + +Hello, + +I am trying to migrate data from a DB2 database to SQL Server 2005 +database. Does anyone know about any migration tool that does that? I + +have heard about DB2 Migration Tool kit, but I think you can only +migrate data to a DB2 database with that. Thank you. + + +Sincerely, + + +Eldhose Cyriac + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 17:57:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D1C869FB0D1 + for ; + Thu, 3 Aug 2006 17:57:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 56812-02 for + ; + Thu, 3 Aug 2006 20:57:04 +0000 (UTC) +X-Greylist: delayed 01:25:59.629214 by SQLgrey- +Received: from mailhost.intellivid.com (mailhost.intellivid.com + [64.32.200.11]) + by postgresql.org (Postfix) with ESMTP id 27F8D9FA2A9 + for ; + Thu, 3 Aug 2006 17:57:01 -0300 (ADT) +Received: from newmail (localhost [127.0.0.1]) + by newmail.intellivid.com (Postfix) with ESMTP id D92A4F18191; + Thu, 3 Aug 2006 16:57:00 -0400 (EDT) +Received: from vega.intellivid.com (vega.intellivid.com [192.168.2.80]) + by newmail.intellivid.com (Postfix) with ESMTP id 55E30F18191; + Thu, 3 Aug 2006 16:55:37 -0400 (EDT) +Subject: Re: +From: Ian Westmacott +To: Chris Hoover +Cc: pgsql-performance@postgresql.org +In-Reply-To: <1d219a6f0608031331p350affeem2773df18abdd2443@mail.gmail.com> +References: + <20060803191522.GA22878@uio.no> + <1154633440.12111.10.camel@vega.intellivid.com> + <1d219a6f0608031331p350affeem2773df18abdd2443@mail.gmail.com> +Content-Type: text/plain +Organization: IntelliVid Corp. +Date: Thu, 03 Aug 2006 16:55:37 -0400 +Message-Id: <1154638537.12111.23.camel@vega.intellivid.com> +Mime-Version: 1.0 +X-Mailer: Evolution 2.6.0 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/51 +X-Sequence-Number: 20236 + +No, this is a test server used for regression testing. Relatively +small (hundreds of GB) and quiet (dozen connections) in the Postgres +universe. + +On Thu, 2006-08-03 at 16:31 -0400, Chris Hoover wrote: +> Just curious, is this a production server? Also, how large is the +> total cluster on disk? +> +> On 8/3/06, Ian Westmacott wrote: +> is that all? +> +> psql -l | grep 'rows)' +> (2016 rows) +> +> On Thu, 2006-08-03 at 21:15 +0200, Steinar H. Gunderson wrote: +> > On Thu, Aug 03, 2006 at 01:33:35PM -0500, Jim Nasby wrote: +> > > I'm at a client who's an ASP; they've written their app +> such that each +> > > customer gets their own database. Rigth now they're at +> nearly 200 +> > > databases, and were thinking that they "must be the +> largest PostgreSQL +> > > install in the world". :) After taking them down a notch +> or two, I +> > > started wondering how many sites could beat 200 databases +> in a single +> > > cluster. I'm sure there's any number that can, though 200 +> databases in a +> > > cluster certainly isn't mainstream. +> > +> > cassarossa:~> psql -h sql -l | grep 'rows)' +> > (137 rows) +> > +> > That's our measly student society. :-) +> > +> > /* Steinar */ +> +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + + +From pgsql-performance-owner@postgresql.org Thu Aug 3 18:04:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 2A8FD9FA2D3 + for ; + Thu, 3 Aug 2006 18:04:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 54161-07 for + ; + Thu, 3 Aug 2006 21:04:05 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id A5E179FA2A9 + for ; + Thu, 3 Aug 2006 18:04:04 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id BF6BC30F59; Thu, 3 Aug 2006 23:04:02 +0200 (MET DST) +From: Chris Browne +X-Newsgroups: pgsql.performance +Subject: Re: XFS filessystem for Datawarehousing -2 +Date: Thu, 03 Aug 2006 17:00:04 -0400 +Organization: cbbrowne Computing Inc +Lines: 25 +Message-ID: <60hd0tilgr.fsf@dba2.int.libertyrms.com> +References: <014401c6b5b8$98926a20$0a00a8c0@trivadis.com> + + <5f820f750608022236yd8dd6escce3bb849b91bddb@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Complaints-To: usenet@news.hub.org +User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.19 (linux) +Cancel-Lock: sha1:MXWWtMmATBe3HrBEORrl5o0JDUI= +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/52 +X-Sequence-Number: 20237 + +denisl@enterprisedb.com ("Denis Lussier") writes: +> I have no personal experience with XFS, but, I've seen numerous +> internal edb-postgres test results that show that of all file +> systems... OCFS 2.0 seems to be quite good for PG update intensive +> apps (especially on 64 bit machines). + +I have been curious about OCFS for some time; it sounded like a case +where there could possibly be some useful semantic changes to +filesystem functionality, notably that: + + - atime is pretty irrelevant; + - it might try to work with pretty fixed block sizes (8K, perhaps?) + rather than try to be efficient at handling tiny files + +It sounds like it ought to be able to be a good fit. + +Of course, with a big warning sticker of "what is required for Oracle +to work properly is implemented, anything more is not a guarantee" on +it, who's going to trust it? +-- +select 'cbbrowne' || '@' || 'cbbrowne.com'; +http://www.ntlug.org/~cbbrowne/oses.html +"There isn't any reason why Linux can't be implemented as an +enterprise computing solution. Find out what you've been missing +while you've been rebooting Windows NT." - Infoworld + +From pgsql-performance-owner@postgresql.org Thu Aug 10 15:52:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D0F139FB212 + for ; + Thu, 3 Aug 2006 20:39:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 79051-02 for + ; + Thu, 3 Aug 2006 20:39:40 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web30304.mail.mud.yahoo.com (web30304.mail.mud.yahoo.com + [68.142.200.97]) by postgresql.org (Postfix) with SMTP id D7BCA9FA383 + for ; + Thu, 3 Aug 2006 20:39:40 -0300 (ADT) +Received: (qmail 75403 invoked by uid 60001); 3 Aug 2006 23:39:39 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=hN0RMTieEFv55on2qiaAfEWmMyfc1sKzEhkaxl0bl4mFrwVfQ9ghUoet/9ypaj2rETGCpCB6xPZrh7E8Sn3ApGLDrzVrh1qO2P2Kp0KEbWfEp9ph1diPg1lOPZKVPLSczG3KGNKxPskgDsT8z+Hunj3wnyaeJxz1CN0GCC9LjwM= + ; +Message-ID: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +Received: from [201.211.98.244] by web30304.mail.mud.yahoo.com via HTTP; + Thu, 03 Aug 2006 16:39:39 PDT +Date: Thu, 3 Aug 2006 16:39:39 -0700 (PDT) +From: hansell baran +Subject: slow transfer speeds with PostgreSQL +To: pgsql-performance@postgresql.org +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-313331203-1154648379=:72004" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=4.151 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, + HTML_00_10, HTML_MESSAGE +X-Spam-Level: **** +X-Archive-Number: 200608/193 +X-Sequence-Number: 20378 + +--0-313331203-1154648379=:72004 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi. I'm new at using PostgreSQL. +Where I work, all databases were built with MS Access. The Access files are hosted by computers with Windows 2000 and Windows + +XP. A new server is on its way and only Open Source Software is going to be installed. The OS is going to be SUSE Linux 10.1 + +and we are making comparisons between MySQL, PostgreSQL and MS Access. We installed MySQL and PostgreSQL on both SUSE and + +Windows XP (MySQL & PostgreSQL DO NOT run at the same time)(There is one HDD for Windows and one for Linux) +The "Test Server" in which we install the DBMS has the following characteristics: + +CPU speed = 1.3 GHz +RAM = 512 MB +HDD = 40 GB + +The biggest table has 544371 rows(tuples?) with 55 rows. All fields are float8. Only 1 is varchar(255) and 1 timestamp. +We query the MS Access databases through Visual Basic Programs and ODBC Drivers. We made a Visual Basic program that uses ADO + +to connect to ALL three DBMS using ODBC drivers. + +When we run the following query "SELECT * FROM big_table", we get the following resutls: + +MS Access +- Execution time ~ 51 seconds (Depending on the client machine, it can go as low as 20 seconds) +- Network Utilization ~ 80 Mbps (According to Windows Task Manager) + +MySQL 5.0 (under Windows) +- Execution time ~ 630 seconds +- Network Utilization ~ 8 Mbps + +PostgreSQL 8.1 (under Windows) +- Execution time ~ 290 seconds) +- Network Utilization ~ 13 Mbps + + +MS Access (under Linux. MS Access files are in the Linux computer which has the SAMBA server running. The client computer has + +a mapped network drive that conects to the Linux files.) +- Execution time ~ 55 seconds (Depending on the client machine, it can go as low as 20 seconds) +- Network Utilization ~ 76 Mbps (According to Windows Task Manager) + +MySQL 5.0(under Linux) +- Execution time ~ 440 seconds +- Network Utilization ~ 11 Mbps + +PostgreSQL 8.1(under Linux) +- Execution time ~ 180 seconds) +- Network Utilization ~ 18 Mbps + + +Very different results are obtained if a the query "SELECT * from big_table ORDER BY "some_column"". In this scenario + +PostgreSQL is faster than MS Access or MySQL by more than 100 seconds. + +We have run many other queries (not complex, at most nesting of 5 inner joins) and MS Access is always faster. We have seen + +by looking at the network activity in the Windows Task Manager that the main problem is the transfer speed. We also have + +noticed that MS Access quickly downloads the file that has the necesary information and works on it locally on the client + +computer. The queries, obviously, run faster if the client computer has more resources (CPU speed, RAM, etc.). The fact that + +the client computer does not use any resource to execute the query, only to receive the results, is one big plus for + +PostgreSQL (we think). We need,however, to improve the performance of the queries that return a lot of rows because those are + +the most used queries. + +We searched the postgresql archives, mailing lists, etc. and have tried changing the parameters of the PostgreSQL server(both + +on Linux and Windows)(We also tried with the default parameters) and changing the parameters of the ODBC driver as suggested. + +We still get aproximately the same results. We have even changed some TCP/IP parameters(only in Windows) but no improvement. + +To get to the point: Is this problem with the transfer rates a PostgreSQL server/PostgresQL ODBC driver limitation? +Is there a way to increase the transfer rates? + +Thank you very much for any help received! + +Hansell E. Baran Altuve + +P.S.: I apologize for the lenght of this post and for any missing information you might need. I will gladly hand out all the + +necessary information to receive any help with my problem. Thanks again! + + +--------------------------------- +Yahoo! Music Unlimited - Access over 1 million songs.Try it free. +--0-313331203-1154648379=:72004 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi. I'm new at using PostgreSQL.
Where I work, all databases were built with MS Access. The Access files are hosted by computers with Windows 2000 and Windows

XP. A new server is on its way and only Open Source Software is going to be installed. The OS is going to be SUSE Linux 10.1

and we are making comparisons between MySQL, PostgreSQL and MS Access. We installed MySQL and PostgreSQL on both SUSE and

Windows XP (MySQL & PostgreSQL DO NOT run at the same time)(There is one HDD for Windows and one for Linux)
The "Test Server" in which we install the DBMS has the following characteristics:

CPU speed = 1.3 GHz
RAM = 512 MB
HDD = 40 GB

The biggest table has 544371 rows(tuples?) with 55 rows. All fields are float8. Only 1 is varchar(255) and 1 timestamp.
We query the MS Access databases through Visual Basic Programs and ODBC Drivers. We made a Visual Basic program that uses ADO

to connect to ALL three DBMS using + ODBC drivers.

When we run the following query "SELECT * FROM big_table", we get the following resutls:

MS Access
- Execution time ~ 51 seconds (Depending on the client machine, it can go as low as 20 seconds)
- Network Utilization ~ 80 Mbps (According to Windows Task Manager)

MySQL 5.0 (under Windows)
- Execution time ~ 630 seconds
- Network Utilization ~ 8 Mbps

PostgreSQL 8.1 (under Windows)
- Execution time ~ 290 seconds)
- Network Utilization ~ 13 Mbps


MS Access (under Linux. MS Access files are in the Linux computer which has the SAMBA server running. The client computer has

a mapped network drive that conects to the Linux files.)
- Execution time ~ 55 seconds (Depending on the client machine, it can go as low as 20 seconds)
- Network Utilization ~ 76 Mbps (According to Windows Task Manager)

MySQL 5.0(under Linux)
- Execution time ~ 440 seconds
- Network Utilization ~ 11 + Mbps

PostgreSQL 8.1(under Linux)
- Execution time ~ 180 seconds)
- Network Utilization ~ 18 Mbps


Very different results are obtained if a the query "SELECT * from big_table ORDER BY "some_column"". In this scenario

PostgreSQL is faster than MS Access or MySQL by more than 100 seconds.

We have run many other queries (not complex, at most nesting of 5 inner joins) and MS Access is always faster. We have seen

by looking at the network activity in the Windows Task Manager that the main problem is the transfer speed. We also have

noticed that MS Access quickly downloads the file that has the necesary information and works on it locally on the client

computer. The queries, obviously, run faster if the client computer has more resources (CPU speed, RAM, etc.). The fact that

the client computer does not use any resource to execute the query, only to receive the results, is one big plus for

PostgreSQL + (we think). We need,however, to improve the performance of the queries that return a lot of rows because those are

the most used queries.

We searched the postgresql archives, mailing lists, etc. and have tried changing the parameters of the PostgreSQL server(both

on Linux and Windows)(We also tried with the default parameters) and changing the parameters of the ODBC driver as suggested.

We still get aproximately the same results. We have even changed some TCP/IP parameters(only in Windows) but no improvement.

To get to the point: Is this problem with the transfer rates a PostgreSQL server/PostgresQL ODBC driver limitation?
Is there a way to increase the transfer rates?

Thank you very much for any help received!

Hansell E. Baran Altuve

P.S.: I apologize for the lenght of this post and for any missing information you might need. I will gladly hand out all the

necessary information to receive any help with + my problem. Thanks again!

+


Yahoo! Music Unlimited - Access over 1 million songs. +Try it free. +--0-313331203-1154648379=:72004-- + +From pgsql-performance-owner@postgresql.org Fri Aug 4 00:41:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1120E9FB2F6 + for ; + Fri, 4 Aug 2006 00:41:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 05822-07 for + ; + Fri, 4 Aug 2006 00:41:33 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw07.mi8.com [63.240.6.48]) + by postgresql.org (Postfix) with ESMTP id 092E09FB2F3 + for ; + Fri, 4 Aug 2006 00:41:32 -0300 (ADT) +Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D7)); Thu, 03 Aug 2006 23:41:27 -0400 +X-Server-Uuid: 17BC2F4D-0B9D-4912-A444-324158EA6520 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 3 Aug + 2006 23:41:27 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Fri, 4 Aug + 2006 03:41:26 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Thu, 03 Aug 2006 20:41:24 -0700 +Subject: Re: XFS filessystem for Datawarehousing +From: "Luke Lonergan" +To: "Milen Kulev" , + "'Michael Stone'" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] XFS filessystem for Datawarehousing +Thread-Index: Aca3d9ubGfgq9yNrEdu0JwAWy4o9DA== +In-Reply-To: <024701c6b735$3b3fbb60$0a00a8c0@trivadis.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 04 Aug 2006 03:41:27.0273 (UTC) + FILETIME=[DD8E7590:01C6B777] +X-WSS-ID: 68CC1E6D3DO999988-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.655 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/53 +X-Sequence-Number: 20238 + +Milen, + +On 8/3/06 12:44 PM, "Milen Kulev" wrote: + +> Hi Luke, +> That is ~ 50% increase !! Amazing... +> How many reader processes did you have to get this results ? + +Just one - I'll refresh the results sometime and post. + +- Luke + + + +From pgsql-performance-owner@postgresql.org Fri Aug 4 04:37:09 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id B98EA9FB2ED + for ; + Fri, 4 Aug 2006 04:37:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 33662-08 for + ; + Fri, 4 Aug 2006 07:36:59 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from h1.bettercom.de (h1.bettercom.de [213.239.194.41]) + by postgresql.org (Postfix) with ESMTP id 331169FB2EC + for ; + Fri, 4 Aug 2006 04:36:58 -0300 (ADT) +Received: (qmail 7419 invoked by uid 208); 4 Aug 2006 07:36:57 -0000 +Received: from 213.39.204.65 by h1 (envelope-from , + uid 0) with qmail-scanner-1.23 + (clamdscan: 0.87. spamassassin: 3.04. Clear:RC:1(213.39.204.65):. + Processed in 0.029778 secs); 04 Aug 2006 07:36:57 -0000 +Received: from unknown (HELO fs-home.bettercom.de) ([213.39.204.65]) + (envelope-sender ) + by h1.bettercom.de (qmail-ldap-1.03) with SMTP + for ; 4 Aug 2006 07:36:57 -0000 +Received: (nullmailer pid 20215 invoked by uid 1000); + Fri, 04 Aug 2006 07:36:56 -0000 +From: Martin Lesser +To: pgsql-performance@postgresql.org +Subject: Re: Partitioning / constrain exlusion not working with %-operator +In-Reply-To: <13552.1154349777@sss.pgh.pa.us> (Tom Lane's message of "Mon, 31 + Jul 2006 08:42:57 -0400") +References: <87ejw27yuz.fsf@fs-home.bettercom.de> + <13552.1154349777@sss.pgh.pa.us> +X-Face: + "d[&>8')a)wbF:+L#^<_cohnX6#m5RCCeKF/6_gD(iQ9bX?xe2~Aq*!')D(1ks`?YhomOYbL3R:{4e4a]qft_]<.q/Lf4hIr,`G+LX33&TYp}XGfe~^5m$28R"$C(EwnB\n8t +Date: Fri, 04 Aug 2006 09:36:56 +0200 +Message-ID: <8764h93qav.fsf@fs-home.bettercom.de> +User-Agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.18 (linux) +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS, UPPERCASE_25_50 +X-Spam-Level: +X-Archive-Number: 200608/54 +X-Sequence-Number: 20239 + +Tom Lane writes: + +> It's usually better to use partitioning rules that have something to +> do with the WHERE-clauses you'd be using anyway. For instance, try +> to partition on ranges. + +I agree and tried to create new partitioned tables. But now I ran into +some other performance-related trouble when inserting (parts of) the old +(unpartioned) table into the new one: + +CREATE TABLE t_unparted (id1 int, cont varchar); +-- Populate table with 1000 records with id1 from 1 to 1000 and ANALYZE + +CREATE TABLE t_parted (id1 int, cont varchar); +CREATE TABLE t_parted_000 (check (id1 >=0 AND id1 < 100)) INHERITS (t_parted); +CREATE RULE ins_000 AS ON INSERT TO t_parted WHERE id1 >= 0 AND id1 < 100 DO INSTEAD INSERT INTO t_parted_000 VALUES (new.*); +-- ... 8 more tables + 8 more rules +CREATE TABLE t_parted_900 (check (id1 >=900 AND id1 < 1000)) INHERITS (t_parted); +CREATE RULE ins_900 AS ON INSERT TO t_parted WHERE id1 >= 900 AND id1 < 1000 DO INSTEAD INSERT INTO t_parted_900 VALUES (new.*); + +And now: + +EXPLAIN INSERT INTO t_parted SELECT * FROM t_parted WHERE id1>=0 AND id1<100; + + Result (cost=0.00..170.80 rows=12 width=36) + -> Append (cost=0.00..170.80 rows=12 width=36) + -> Seq Scan on t_parted (cost=0.00..85.40 rows=6 width=36) + Filter: ((id1 >= 0) AND (id1 < 100) AND (((id1 >= 0) AND (id1 < 100)) IS NOT TRUE) AND (((id1 >= 100) AND (id1 < 200)) IS NOT TRUE) AND (((id1 >= 200) AND (id1 < 300)) IS NOT TRUE) AND (((id1 >= 300) AND (id1 < 400)) IS NOT TRUE) AND (((id1 >= 400) AND (id1 < 500)) IS NOT TRUE) AND (((id1 >= 500) AND (id1 < 600)) IS NOT TRUE) AND (((id1 >= 600) AND (id1 < 700)) IS NOT TRUE) AND (((id1 >= 700) AND (id1 < 800)) IS NOT TRUE) AND (((id1 >= 800) AND (id1 < 900)) IS NOT TRUE) AND (((id1 >= 900) AND (id1 < 1000)) IS NOT TRUE)) + -> Seq Scan on t_parted_000 t_parted (cost=0.00..85.40 rows=6 width=36) + Filter: ((id1 >= 0) AND (id1 < 100) AND (((id1 >= 0) AND (id1 < 100)) IS NOT TRUE) AND (((id1 >= 100) AND (id1 < 200)) IS NOT TRUE) AND (((id1 >= 200) AND (id1 < 300)) IS NOT TRUE) AND (((id1 >= 300) AND (id1 < 400)) IS NOT TRUE) AND (((id1 >= 400) AND (id1 < 500)) IS NOT TRUE) AND (((id1 >= 500) AND (id1 < 600)) IS NOT TRUE) AND (((id1 >= 600) AND (id1 < 700)) IS NOT TRUE) AND (((id1 >= 700) AND (id1 < 800)) IS NOT TRUE) AND (((id1 >= 800) AND (id1 < 900)) IS NOT TRUE) AND (((id1 >= 900) AND (id1 < 1000)) IS NOT TRUE)) + + Result (cost=0.00..66.40 rows=12 width=36) + -> Append (cost=0.00..66.40 rows=12 width=36) + -> Seq Scan on t_parted (cost=0.00..33.20 rows=6 width=36) + Filter: ((id1 >= 0) AND (id1 < 100) AND (id1 >= 0) AND (id1 < 100)) + -> Seq Scan on t_parted_000 t_parted (cost=0.00..33.20 rows=6 width=36) + Filter: ((id1 >= 0) AND (id1 < 100) AND (id1 >= 0) AND (id1 < 100)) + ... + Result (cost=0.00..33.20 rows=6 width=36) + -> Append (cost=0.00..33.20 rows=6 width=36) + -> Seq Scan on t_parted (cost=0.00..33.20 rows=6 width=36) + Filter: ((id1 >= 0) AND (id1 < 100) AND (id1 >= 900) AND (id1 < 1000)) +(58 rows) + +The filters appended by the planner do not make any sense and cost too +much time if the old table is huge. (constraint_exclusion was ON) + +Is there a better way to partition an existing table with a large +number of rows (>100 mio)? + +TIA, Martin + +From pgsql-performance-owner@postgresql.org Fri Aug 4 05:06:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A66199FB304 + for ; + Fri, 4 Aug 2006 05:06:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 44519-03 for + ; + Fri, 4 Aug 2006 08:06:27 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.wirelesscar.com (mail.wirelesscar.com [212.209.35.30]) + by postgresql.org (Postfix) with ESMTP id 562379FB2F1 + for ; + Fri, 4 Aug 2006 05:06:25 -0300 (ADT) +Received: from sesrv12.wirelesscar.com ([192.168.10.17]) by + mail.wirelesscar.com with InterScan Messaging Security Suite; + Fri, 04 Aug 2006 10:06:19 +0200 +content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 +Subject: Re: RAID stripe size question +Date: Fri, 4 Aug 2006 10:08:05 +0200 +Message-ID: <7F10D26ECFA1FB458B89C5B4B0D72C2B4E4E05@sesrv12.wirelesscar.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] RAID stripe size question +Thread-Index: Aca2t/ZEMBcK20PUQL6H03d9Nv3FuAAAAJ2wADjNCbA= +From: "Mikael Carneholm" +To: "Luke Lonergan" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/55 +X-Sequence-Number: 20240 + +> WRT seek performance, we're doing 2500 seeks per second on the +Sun/Thumper on 36 disks. =20 + +Luke,=20 + +Have you had time to run benchmarksql against it yet? I'm just curious +about the IO seeks/s vs. transactions/minute correlation... + +/Mikael + + + + + + +From pgsql-performance-owner@postgresql.org Fri Aug 4 17:13:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DDD119FB30C + for ; + Fri, 4 Aug 2006 17:13:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 73745-01 for + ; + Fri, 4 Aug 2006 17:13:03 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.203]) + by postgresql.org (Postfix) with ESMTP id 97D509FB301 + for ; + Fri, 4 Aug 2006 17:13:03 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so94755nzd + for ; + Fri, 04 Aug 2006 13:13:00 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; + b=jMRnVSUePOkEuWlECLgA2WZDvg63NHIOCUCigILfq9h99mDaPnjo+0c3v3v0PVffeokAGmI609YsWftRabjCKQ2XokmhynsFJYm2fj/XGikfxgtZbYZnXZISsfuIqu621nEEuk3P27iBnkPjH8YB4b4MbC5c1E4tzj7PONg/XSQ= +Received: by 10.65.119.14 with SMTP id w14mr5568296qbm; + Fri, 04 Aug 2006 13:13:00 -0700 (PDT) +Received: by 10.64.179.9 with HTTP; Fri, 4 Aug 2006 13:13:00 -0700 (PDT) +Message-ID: <5f820f750608041313v542640c5q5634f91263d7e915@mail.gmail.com> +Date: Fri, 4 Aug 2006 16:13:00 -0400 +From: "Denis Lussier" +To: "Chris Browne" +Subject: Re: XFS filessystem for Datawarehousing -2 +Cc: pgsql-performance@postgresql.org +In-Reply-To: <60hd0tilgr.fsf@dba2.int.libertyrms.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_11238_9778828.1154722380366" +References: <014401c6b5b8$98926a20$0a00a8c0@trivadis.com> + + <5f820f750608022236yd8dd6escce3bb849b91bddb@mail.gmail.com> + <60hd0tilgr.fsf@dba2.int.libertyrms.com> +X-Google-Sender-Auth: 3d30b89a08552987 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.448 tagged_above=0 required=5 tests=AWL, HTML_30_40, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/56 +X-Sequence-Number: 20241 + +------=_Part_11238_9778828.1154722380366 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I agree that OCFS 2.0 is NOT a general purpose PG (or any other) solution. +My recollection is that OCFS gave about 15% performance improvements (same +as setting some aggressive switches on ext3). I assume OCFS has excellent +crash safety with its default settings but we did not test this as of yet. +OCFS now ships as one of the optional FS's that ship with Suse. That takes +care of some of the FUD created by Oracle's disclaimer below. + +OCFS 2 is much more POSIX compliant than OCFS 1. The BenchmarkSQL, DBT2, & +Regression tests we ran on OCFS 2 all worked well. The lack of full Posix +compliance did cause some problems for configuring PITR. + +--Denis http://www.enterprisedb.com + +On 8/3/06, Chris Browne wrote: +> +> +> Of course, with a big warning sticker of "what is required for Oracle +> to work properly is implemented, anything more is not a guarantee" on +> it, who's going to trust it? +> -- +> + +------=_Part_11238_9778828.1154722380366 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +
I agree that OCFS 2.0 is NOT a general purpose PG (or any other) solution.  My recollection is that OCFS gave about 15% performance improvements (same as setting some aggressive switches on ext3).   I assume OCFS has excellent crash safety with its default settings but we did not test this as of yet.  OCFS now ships as one of the optional FS's that ship with Suse.   That takes care of some of the FUD created by Oracle's disclaimer below.   +

OCFS 2 is much more POSIX compliant than OCFS 1.  The BenchmarkSQL, DBT2, & Regression tests we ran on OCFS 2 all worked well.  The lack of full Posix compliance did cause some problems for configuring PITR.
+
--Denis       http://www.enterprisedb.com

On 8/3/06, Chris Browne <cbbrowne@acm.org +> wrote:

Of course, with a big warning sticker of "what is required for Oracle +
to work properly is implemented, anything more is not a guarantee" on
it, who's going to trust it?
--

+ +------=_Part_11238_9778828.1154722380366-- + +From pgsql-performance-owner@postgresql.org Fri Aug 4 17:44:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E01179FB314 + for ; + Fri, 4 Aug 2006 17:44:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 97534-01 for + ; + Fri, 4 Aug 2006 17:44:52 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 41C6F9FB311 + for ; + Fri, 4 Aug 2006 17:44:52 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id E40B056431; Fri, 4 Aug 2006 15:44:50 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Fri, 4 Aug 2006 15:44:50 -0500 +Date: Fri, 4 Aug 2006 15:44:50 -0500 +From: "Jim C. Nasby" +To: "J. Andrew Rogers" , + Milen Kulev , + "Pgsql-Performance ((E-mail))" +Subject: Re: XFS filessystem for Datawarehousing +Message-ID: <20060804204450.GS40481@pervasive.com> +References: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> + + <20060802004223.GE20401@alvh.no-ip.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060802004223.GE20401@alvh.no-ip.org> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060804:jrogers@neopolitan.com::495ltA9zZsMTV3qs:000000000000000 + 0000000000000000000000002bmg +X-Hashcash: 1:20:060804:makulev@gmx.net::Cbm4BoHmEP038QSW:0000Ox +X-Hashcash: + 1:20:060804:pgsql-performance@postgresql.org::E8AfLymFxF6b+Yao:00000 + 0000000000000000000000004O2F +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.052 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/57 +X-Sequence-Number: 20242 + +On Tue, Aug 01, 2006 at 08:42:23PM -0400, Alvaro Herrera wrote: +> J. Andrew Rogers wrote: +> > +> > On Aug 1, 2006, at 2:49 PM, Milen Kulev wrote: +> > >Is anyone using XFS for storing/retrieving relatively large amount +> > >of data (~ 200GB)? +> > +> > +> > Yes, we've been using it on Linux since v2.4 (currently v2.6) and it +> > has been rock solid on our database servers (Opterons, running in +> > both 32-bit and 64-bit mode). Our databases are not quite 200GB +> > (maybe 75GB for a big one currently), but ballpark enough that the +> > experience is probably valid. We also have a few terabyte+ non- +> > database XFS file servers too. +> > +> > Performance has been very good even with nearly full file systems, +> > and reliability has been perfect so far. Some of those file systems +> > get used pretty hard for months or years non-stop. Comparatively, I +> > can only tell you that XFS tends to be significantly faster than +> > Ext3, but we never did any serious file system tuning either. +> +> Most likely ext3 was used on the default configuration, which logs data +> operations as well as metadata, which is what XFS logs. I don't think +> I've seen any credible comparison between XFS and ext3 with the +> metadata-only journal option. +> +> On the other hand I don't think it makes sense to journal data on a +> PostgreSQL environment. Metadata is enough, given that we log data on +> WAL anyway. + +Actually, according to http://en.wikipedia.org/wiki/Ext3 the default +journalling option for ext3 isn't to journal the data (which is actually +data=journal), but to wait until the data is written before considering +the metadata to be committed (data=ordered). +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Fri Aug 4 19:38:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 7AFE29FB0D1 + for ; + Fri, 4 Aug 2006 19:38:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 60243-09 for + ; + Fri, 4 Aug 2006 22:38:01 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.infogears.com (mail.infogears.com [69.51.90.143]) + by postgresql.org (Postfix) with ESMTP id A12969FB2AB + for ; + Fri, 4 Aug 2006 19:37:58 -0300 (ADT) +Received: from mail.infogears.com (localhost.localdomain [127.0.0.1]) + by mail.infogears.com (Postfix) with ESMTP id BD92830980A3 + for ; + Fri, 4 Aug 2006 16:37:56 -0600 (MDT) +Received: from (HELO [69.51.88.30]) () + (smtp-auth username rconover, mechanism plain) + by mail.infogears.com (qpsmtpd/0.31-dev) with ESMTP; + Fri, 04 Aug 2006 16:37:56 -0600 +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Transfer-Encoding: 7bit +Message-Id: <26497C9E-3583-4EA2-A3AD-955F31E00CC3@infogears.com> +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +To: pgsql-performance@postgresql.org +From: Rusty Conover +Subject: Query Plan - Bitmap Index Scan and Views +Date: Fri, 4 Aug 2006 16:37:55 -0600 +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/58 +X-Sequence-Number: 20243 + +Hi, + +Is there any inherent benefit of using a the IN operator versus +joining a temporary table? Should they offer near equal performance? +It appears bitmap scan's aren't done when matching across a small +temporary table. + +I have a temporary table with 5 integers in it that I'm matching +against mildly complex view that has 5 joins. I've analyzed the +database after the temporary table was created. + +Matching against the temporary table takes: 36492.836 ms. +Matching using the IN operator with the same content takes: 2.732 ms. + +These measurements are after the query has been run a few times, so +the data should be in cache. + +It would appear that the temporary table's join isn't evaluated deep +enough in the query plan to prevent the more expensive joins from +running, is there a way for force it? Could some setting be wrong +that telling the planner to make this decision? The same thing +happens when I perform the join without the view. + +select * from foo; + oid +-------- +161007 +161008 +161000 +161009 +161002 +(5 rows) + + +Plan for IN match: + +=# explain analyze select * from crawled_url_full_view where +crawled_url_full_view.oid in (161007, 161008, 161000, 161009, 161002); + + QUERY PLAN +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------- +Hash Left Join (cost=14.50..94.11 rows=5 width=538) (actual +time=1.025..1.522 rows=5 loops=1) + Hash Cond: ("outer".classification_set_id = "inner".id) + Join Filter: ("outer".classification_set_id IS NOT NULL) + -> Hash Left Join (cost=13.30..92.86 rows=5 width=526) (actual +time=0.794..1.251 rows=5 loops=1) + Hash Cond: ("outer".charset_id = "inner".id) + Join Filter: ("outer".charset_id IS NOT NULL) + -> Hash Left Join (cost=12.21..91.70 rows=5 width=515) +(actual time=0.631..1.048 rows=5 loops=1) + Hash Cond: ("outer".http_error_description_id = +"inner".id) + Join Filter: ("outer".http_error_description_id IS +NOT NULL) + -> Hash Left Join (cost=11.13..90.59 rows=5 +width=472) (actual time=0.488..0.868 rows=5 loops=1) + Hash Cond: ("outer".content_type_id = "inner".id) + Join Filter: ("outer".content_type_id IS NOT NULL) + -> Nested Loop Left Join (cost=10.02..89.41 +rows=5 width=443) (actual time=0.244..0.578 rows=5 loops=1) + Join Filter: ("outer".redirect_url_id IS +NOT NULL) + -> Nested Loop Left Join +(cost=10.02..59.56 rows=5 width=339) (actual time=0.225..0.488 rows=5 +loops=1) + -> Bitmap Heap Scan on +crawled_url (cost=10.02..29.71 rows=5 width=235) (actual +time=0.170..0.217 rows=5 loops=1) + Recheck Cond: ((oid = 161007) +OR (oid = 161008) OR (oid = 161000) OR (oid = 161009) OR (oid = 161002)) + -> BitmapOr +(cost=10.02..10.02 rows=5 width=0) (actual time=0.137..0.137 rows=0 +loops=1) + -> Bitmap Index Scan +on crawled_url_pkey (cost=0.00..2.00 rows=1 width=0) (actual +time=0.061..0.061 rows=1 loops=1) + Index Cond: (oid += 161007) + -> Bitmap Index Scan +on crawled_url_pkey (cost=0.00..2.00 rows=1 width=0) (actual +time=0.013..0.013 rows=1 loops=1) + Index Cond: (oid += 161008) + -> Bitmap Index Scan +on crawled_url_pkey (cost=0.00..2.00 rows=1 width=0) (actual +time=0.013..0.013 rows=1 loops=1) + Index Cond: (oid += 161000) + -> Bitmap Index Scan +on crawled_url_pkey (cost=0.00..2.00 rows=1 width=0) (actual +time=0.014..0.014 rows=1 loops=1) + Index Cond: (oid += 161009) + -> Bitmap Index Scan +on crawled_url_pkey (cost=0.00..2.00 rows=1 width=0) (actual +time=0.012..0.012 rows=1 loops=1) + Index Cond: (oid += 161002) + -> Index Scan using url_pkey on +url (cost=0.00..5.96 rows=1 width=108) (actual time=0.031..0.036 +rows=1 loops=5) + Index Cond: (url.url_id = +"outer".url_id) + -> Index Scan using url_pkey on url r1 +(cost=0.00..5.96 rows=1 width=108) (actual time=0.004..0.004 rows=0 +loops=5) + Index Cond: (r1.url_id = +"outer".redirect_url_id) + -> Hash (cost=1.09..1.09 rows=9 width=33) +(actual time=0.130..0.130 rows=9 loops=1) + -> Seq Scan on content_types +(cost=0.00..1.09 rows=9 width=33) (actual time=0.017..0.062 rows=9 +loops=1) + -> Hash (cost=1.06..1.06 rows=6 width=47) (actual +time=0.088..0.088 rows=6 loops=1) + -> Seq Scan on http_error_descriptions +(cost=0.00..1.06 rows=6 width=47) (actual time=0.010..0.040 rows=6 +loops=1) + -> Hash (cost=1.08..1.08 rows=8 width=15) (actual +time=0.103..0.103 rows=8 loops=1) + -> Seq Scan on charsets (cost=0.00..1.08 rows=8 +width=15) (actual time=0.011..0.048 rows=8 loops=1) + -> Hash (cost=1.16..1.16 rows=16 width=16) (actual +time=0.175..0.175 rows=16 loops=1) + -> Seq Scan on classification_sets (cost=0.00..1.16 +rows=16 width=16) (actual time=0.012..0.088 rows=16 loops=1) +Total runtime: 2.743 ms +(41 rows) + + + +Plan for temp table match: + + +=# explain analyze select * from foo, crawled_url_full_view where +crawled_url_full_view.oid = foo.oid; + + QUERY PLAN +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------ +Hash IN Join (cost=35667.15..145600.71 rows=5 width=538) (actual +time=22371.445..36482.823 rows=5 loops=1) + Hash Cond: ("outer".oid = "inner".oid) + -> Hash Left Join (cost=35666.09..143698.61 rows=380198 +width=538) (actual time=9901.782..35218.758 rows=360531 loops=1) + Hash Cond: ("outer".classification_set_id = "inner".id) + Join Filter: ("outer".classification_set_id IS NOT NULL) + -> Hash Left Join (cost=35664.89..140493.61 rows=380198 +width=526) (actual time=9901.456..32363.212 rows=360531 loops=1) + Hash Cond: ("outer".charset_id = "inner".id) + Join Filter: ("outer".charset_id IS NOT NULL) + -> Hash Left Join (cost=35663.79..135684.27 +rows=380198 width=515) (actual time=9901.257..29400.189 rows=360531 +loops=1) + Hash Cond: ("outer".http_error_description_id = +"inner".id) + Join Filter: ("outer".http_error_description_id +IS NOT NULL) + -> Hash Left Join (cost=35662.71..133782.19 +rows=380198 width=472) (actual time=9901.080..26691.473 rows=360531 +loops=1) + Hash Cond: ("outer".content_type_id = +"inner".id) + Join Filter: ("outer".content_type_id IS +NOT NULL) + -> Hash Left Join +(cost=35661.60..128972.84 rows=380198 width=443) (actual +time=9900.802..23743.323 rows=360531 loops=1) + Hash Cond: ("outer".redirect_url_id += "inner".url_id) + Join Filter: +("outer".redirect_url_id IS NOT NULL) + -> Hash Left Join +(cost=17830.80..66680.80 rows=380198 width=339) (actual +time=4592.701..14466.994 rows=360531 loops=1) + Hash Cond: ("outer".url_id = +"inner".url_id) + -> Seq Scan on crawled_url +(cost=0.00..10509.98 rows=380198 width=235) (actual +time=0.026..2976.911 rows=360531 loops=1) + -> Hash +(cost=10627.04..10627.04 rows=377104 width=108) (actual +time=4591.703..4591.703 rows=382149 loops=1) + -> Seq Scan on url +(cost=0.00..10627.04 rows=377104 width=108) (actual +time=0.041..2142.702 rows=382149 loops=1) + -> Hash (cost=10627.04..10627.04 +rows=377104 width=108) (actual time=5307.540..5307.540 rows=382149 +loops=1) + -> Seq Scan on url r1 +(cost=0.00..10627.04 rows=377104 width=108) (actual +time=0.138..2503.577 rows=382149 loops=1) + -> Hash (cost=1.09..1.09 rows=9 +width=33) (actual time=0.144..0.144 rows=9 loops=1) + -> Seq Scan on content_types +(cost=0.00..1.09 rows=9 width=33) (actual time=0.020..0.068 rows=9 +loops=1) + -> Hash (cost=1.06..1.06 rows=6 width=47) +(actual time=0.108..0.108 rows=6 loops=1) + -> Seq Scan on http_error_descriptions +(cost=0.00..1.06 rows=6 width=47) (actual time=0.015..0.049 rows=6 +loops=1) + -> Hash (cost=1.08..1.08 rows=8 width=15) (actual +time=0.129..0.129 rows=8 loops=1) + -> Seq Scan on charsets (cost=0.00..1.08 +rows=8 width=15) (actual time=0.014..0.058 rows=8 loops=1) + -> Hash (cost=1.16..1.16 rows=16 width=16) (actual +time=0.234..0.234 rows=16 loops=1) + -> Seq Scan on classification_sets (cost=0.00..1.16 +rows=16 width=16) (actual time=0.014..0.107 rows=16 loops=1) + -> Hash (cost=1.05..1.05 rows=5 width=4) (actual +time=0.092..0.092 rows=5 loops=1) + -> Seq Scan on foo (cost=0.00..1.05 rows=5 width=4) +(actual time=0.022..0.044 rows=5 loops=1) +Total runtime: 36492.836 ms +(35 rows) + + +Definition of the view: + +create view crawled_url_full_view as +select crawled_url.*, +url.url, +r1.url as redirect_url, +content_types.type as content_type, +http_error_descriptions.error as http_error_description, +charsets.name as charset, +classification_sets.name as classification_set +from crawled_url left join url on url.url_id = crawled_url.url_id +left join url as r1 on (r1.url_id = crawled_url.redirect_url_id and +crawled_url.redirect_url_id is not null) +left join content_types on (content_types.id = +crawled_url.content_type_id and crawled_url.content_type_id is not null) +left join http_error_descriptions on (http_error_descriptions.id = +crawled_url.http_error_description_id and +crawled_url.http_error_description_id is not null) +left join charsets on (charsets.id = crawled_url.charset_id and +crawled_url.charset_id is not null) +left join classification_sets on (classification_sets.id = +crawled_url.classification_set_id and +crawled_url.classification_set_id is not null); + + +Version is: PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC +gcc (GCC) 4.0.1 20050727 (Red Hat 4.0.1-5) + +work_mem=30000 +shared_buffers=5000 +effective_cache_size=15000 + +Thanks for any help, + +Rusty +-- +Rusty Conover +InfoGears Inc. +Web: http://www.infogears.com + + + + +From pgsql-performance-owner@postgresql.org Fri Aug 4 23:15:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 07BD69FB308 + for ; + Fri, 4 Aug 2006 23:15:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 58627-06 for + ; + Sat, 5 Aug 2006 02:15:29 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id A966E9FB2F3 + for ; + Fri, 4 Aug 2006 23:15:28 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k752FIB7024234; + Fri, 4 Aug 2006 22:15:18 -0400 (EDT) +To: Rusty Conover +cc: pgsql-performance@postgresql.org +Subject: Re: Query Plan - Bitmap Index Scan and Views +In-reply-to: <26497C9E-3583-4EA2-A3AD-955F31E00CC3@infogears.com> +References: <26497C9E-3583-4EA2-A3AD-955F31E00CC3@infogears.com> +Comments: In-reply-to Rusty Conover + message dated "Fri, 04 Aug 2006 16:37:55 -0600" +Date: Fri, 04 Aug 2006 22:15:18 -0400 +Message-ID: <24233.1154744118@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/59 +X-Sequence-Number: 20244 + +Rusty Conover writes: +> Is there any inherent benefit of using a the IN operator versus +> joining a temporary table? Should they offer near equal performance? +> It appears bitmap scan's aren't done when matching across a small +> temporary table. + +I believe the problem you're facing is that existing PG releases +don't know how to rearrange join order in the face of outer joins, +and your view is full of outer joins. So the join against the temp +table happens after forming the full output of the view, whereas you +desperately need it to happen at the bottom of the join stack. + +CVS tip (8.2-to-be) has some ability to rearrange outer joins, and +I'm interested to know whether it's smart enough to fix your problem. +But you have not provided enough info to let someone else duplicate +your test case. Would you be willing to download CVS or a recent +nightly snapshot and see what it does with your problem? + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Aug 4 23:57:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id CD52D9FB2C5 + for ; + Fri, 4 Aug 2006 23:57:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 74899-03 for + ; + Sat, 5 Aug 2006 02:57:00 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.infogears.com (mail.infogears.com [69.51.90.143]) + by postgresql.org (Postfix) with ESMTP id 3AEBF9FB2C1 + for ; + Fri, 4 Aug 2006 23:56:58 -0300 (ADT) +Received: from mail.infogears.com (localhost.localdomain [127.0.0.1]) + by mail.infogears.com (Postfix) with ESMTP id 5BAB7309808A; + Fri, 4 Aug 2006 20:56:56 -0600 (MDT) +Received: from (HELO [69.51.88.30]) () + (smtp-auth username rconover, mechanism plain) + by mail.infogears.com (qpsmtpd/0.31-dev) with ESMTP; + Fri, 04 Aug 2006 20:56:56 -0600 +In-Reply-To: <24233.1154744118@sss.pgh.pa.us> +References: <26497C9E-3583-4EA2-A3AD-955F31E00CC3@infogears.com> + <24233.1154744118@sss.pgh.pa.us> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: multipart/alternative; boundary=Apple-Mail-13-345755681 +Message-Id: +Cc: pgsql-performance@postgresql.org +From: Rusty Conover +Subject: Re: Query Plan - Bitmap Index Scan and Views +Date: Fri, 4 Aug 2006 20:56:54 -0600 +To: Tom Lane +X-Mailer: Apple Mail (2.752.2) +X-Virus-Checked: Checked by ClamAV on mail.infogears.com +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/60 +X-Sequence-Number: 20245 + + +--Apple-Mail-13-345755681 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + format=flowed + + +On Aug 4, 2006, at 8:15 PM, Tom Lane wrote: + +> Rusty Conover writes: +>> Is there any inherent benefit of using a the IN operator versus +>> joining a temporary table? Should they offer near equal performance? +>> It appears bitmap scan's aren't done when matching across a small +>> temporary table. +> +> I believe the problem you're facing is that existing PG releases +> don't know how to rearrange join order in the face of outer joins, +> and your view is full of outer joins. So the join against the temp +> table happens after forming the full output of the view, whereas you +> desperately need it to happen at the bottom of the join stack. +> +> CVS tip (8.2-to-be) has some ability to rearrange outer joins, and +> I'm interested to know whether it's smart enough to fix your problem. +> But you have not provided enough info to let someone else duplicate +> your test case. Would you be willing to download CVS or a recent +> nightly snapshot and see what it does with your problem? +> +> regards, tom lane + + +Absolutely, I'll attempt to run the test against the current CVS HEAD. + +Do I need to pg_dump and restore from 8.1.4? + +What other information would be helpful in the meantime? + +Thanks, + +Rusty +-- +Rusty Conover +InfoGears Inc. +Web: http://www.infogears.com + + + + +--Apple-Mail-13-345755681 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; + charset=ISO-8859-1 + +
On Aug 4, 2006, at = +8:15 PM, Tom Lane wrote:

Rusty Conover <rconover@infogears.com> = +writes:
Is there any = +inherent benefit of using a the IN operator versus =A0
joining = +a temporary table? Should they offer near equal performance?=A0 =A0
It appears bitmap scan's aren't done when matching = +across a small =A0
temporary table.

I = +believe the problem you're facing is that existing PG releases
don't know how to rearrange join order in the face = +of outer joins,
and your view is full of outer = +joins.=A0 So the join = +against the temp
table happens after forming the = +full output of the view, whereas you
desperately = +need it to happen at the bottom of the join stack.

CVS tip = +(8.2-to-be) has some ability to rearrange outer joins, and
I'm interested to know whether it's smart enough to = +fix your problem.
But you have not provided enough = +info to let someone else duplicate
your test = +case.=A0 Would you be = +willing to download CVS or a recent
nightly = +snapshot and see what it does with your problem?

regards, = +tom lane


Absolutely, I'll attempt to = +run the test against the current CVS HEAD.

Do I need to pg_dump and = +restore from 8.1.4?

What other information = +would be helpful in the meantime?

Thanks,

Rusty
--
Rusty = +Conover
InfoGears Inc.


= +

= + +--Apple-Mail-13-345755681-- + +From pgsql-performance-owner@postgresql.org Sat Aug 5 00:27:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3FCB39FB31F + for ; + Sat, 5 Aug 2006 00:27:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 83675-05 for + ; + Sat, 5 Aug 2006 03:27:17 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id A56269FB2C5 + for ; + Sat, 5 Aug 2006 00:27:16 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k753R8g8024793; + Fri, 4 Aug 2006 23:27:09 -0400 (EDT) +To: Rusty Conover +cc: pgsql-performance@postgresql.org +Subject: Re: Query Plan - Bitmap Index Scan and Views +In-reply-to: +References: <26497C9E-3583-4EA2-A3AD-955F31E00CC3@infogears.com> + <24233.1154744118@sss.pgh.pa.us> + +Comments: In-reply-to Rusty Conover + message dated "Fri, 04 Aug 2006 20:56:54 -0600" +Date: Fri, 04 Aug 2006 23:27:08 -0400 +Message-ID: <24792.1154748428@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/61 +X-Sequence-Number: 20246 + +Rusty Conover writes: +> Absolutely, I'll attempt to run the test against the current CVS HEAD. + +> Do I need to pg_dump and restore from 8.1.4? + +Yup, fraid so. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Aug 7 21:24:17 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C4A039FB206 + for ; + Mon, 7 Aug 2006 21:24:16 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 30090-07 for + ; + Tue, 8 Aug 2006 00:24:09 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.238]) + by postgresql.org (Postfix) with ESMTP id 1431D9FB1FF + for ; + Mon, 7 Aug 2006 21:24:07 -0300 (ADT) +Received: by wx-out-0506.google.com with SMTP id t13so191760wxc + for ; + Mon, 07 Aug 2006 17:24:06 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:subject:from:reply-to:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=Pr4GLhveO/jUfFdTJeBMW+Rw62L4DDOmzR1LIoSsOiwmjN/trXjBALWpV/+Bym1Wurmyb9/pRTnXwtYv96inlhYn4V4agC/RVimdR025SzuXkXRr3dQE59BtCqFUln4/R/H4mYhthQaJ+dkE7qXZSMTzWloKjtxcTRXEqfsMqkQ= +Received: by 10.70.100.14 with SMTP id x14mr9811961wxb; + Mon, 07 Aug 2006 17:24:06 -0700 (PDT) +Received: from ?10.0.0.174? ( [63.193.127.22]) + by mx.gmail.com with ESMTP id 29sm2862252wrl.2006.08.07.17.24.05; + Mon, 07 Aug 2006 17:24:05 -0700 (PDT) +Subject: Postgresql Performance on an HP DL385 and SmartArray 642 +From: Steve Poe +Reply-To: steve.poe@gmail.com +To: pgsql-performance@postgresql.org +Content-Type: text/plain +Date: Sat, 05 Aug 2006 16:10:38 -0700 +Message-Id: <1154819438.15224.24.camel@amd64-gentoo-laptop> +Mime-Version: 1.0 +X-Mailer: Evolution 2.4.2.1 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.378 tagged_above=0 required=5 + tests=DATE_IN_PAST_48_96, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/87 +X-Sequence-Number: 20272 + +I am do some consulting for an animal hospital in the Boston, MA area. +They wanted a new server to run their database on. The client wants +everything from one vendor, they wanted Dell initially, I'd advised +against it. I recommended a dual Opteron system from either Sun or HP. +They settled on a DL385 8GB of RAM with two disc U320 SCSI and a 6-disc +U320 SCSI array. I recommended they add a RAID adapter with at 128MB and +battery backup, they added a HP SmartArray 642 to connect to the drive +array in addition to the SmartArray 6i which came with the server. + +Has anyone worked with server before. I've read the SmartArray 6i is a +poor performer, I wonder if the SmartArray 642 adapter would have the +same fate? + +The database data is on the drive array(RAID10) and the pg_xlog is on +the internal RAID1 on the 6i controller. The results have been poor. + +My guess is the controllers are garbage. + +Thanks for any advice. + +Steve Poe + + + + + + + + + + + +From pgsql-novice-owner@postgresql.org Sun Aug 6 13:54:49 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 484F09FB285 + for ; + Sun, 6 Aug 2006 13:54:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 93249-04 for ; + Sun, 6 Aug 2006 13:54:39 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web51307.mail.yahoo.com (web51307.mail.yahoo.com + [206.190.38.173]) + by postgresql.org (Postfix) with SMTP id 8795E9FB292 + for ; Sun, 6 Aug 2006 13:54:39 -0300 (ADT) +Received: (qmail 35461 invoked by uid 60001); 6 Aug 2006 16:54:38 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=JNpY3uIjmDD+czbN2wKOEFVM+6MPXsx7Rx4V6QlHP3LiVcmIxwkpPjbHrP1MqyWdSL5wzdN6Z614RlqLyzu4edKtbpgtaKIftZe+FyJxqmi7CnL/iR2/SvaNUD67dUQ/akKGv5p6tZM0xq9HM1vRox6ArWQyBnk2pERH1Yc5IWI= + ; +Message-ID: <20060806165438.35459.qmail@web51307.mail.yahoo.com> +Received: from [68.211.210.180] by web51307.mail.yahoo.com via HTTP; + Sun, 06 Aug 2006 09:54:38 PDT +Date: Sun, 6 Aug 2006 09:54:38 -0700 (PDT) +From: Saranya Sivakumar +Subject: 7.3.2 pg_restore very slow +To: pgsqlperform , + pgsqlnovice +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-839312057-1154883278=:35452" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.73 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, + HTML_30_40, HTML_MESSAGE +X-Spam-Level: *** +X-Archive-Number: 200608/41 +X-Sequence-Number: 17256 + +--0-839312057-1154883278=:35452 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi All, + + I am trying to back up a full copy of one of our databases (14G) and restore it on another server. Both databases run 7.3.2 version. Though the restore completed successfully, it took 9 hours for the process to complete. The destination server runs Fedora Core 3 with 512 MB RAM and has 1 processor. I have also deferred referential intergrity checks during the restore. I tried to tune some parameters in the config file, but it still takes 9 hours. + + I have tried this same procedure to restore a full copy, but using 8.1(pg_dump and pg_restore) on a different server and that process took only 2 hours for the same database. But we are unable to migrate to 8.1 at this point and stuck with 7.3.2. + + I use a script to dump/restore. I can send the same if that information is needed. + + Please give me some pointers on what else I should be looking at to reduce the restore time using 7.3.2 version. + + Thanks, + Sincerely, + Saranya Sivakumar + + + + + + + +--------------------------------- +Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2�/min or less. +--0-839312057-1154883278=:35452 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +
Hi All,
 
I am trying to back up a full copy of one of our databases (14G) and restore it on another server. Both databases run 7.3.2 version. Though the restore completed successfully, it took 9 hours for the process to complete. The destination server runs Fedora Core 3 with 512 MB RAM and has 1 processor.  I have also deferred referential intergrity checks during the restore. I tried to tune some parameters in the config file, but it still takes 9 hours.
 
I have tried this same procedure to restore a full copy, but using 8.1(pg_dump and pg_restore) on a different server and that process took only 2 hours for the same database. But we are unable to migrate to 8.1 at this point and stuck with 7.3.2.
 
I use a script to dump/restore. I can send the same if that information is needed.
 
Please give me some + pointers on what else I should be looking at to reduce the restore time using 7.3.2 version.
 
Thanks,
Sincerely,
Saranya Sivakumar
 
 
 
 
 

+


Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2�/min or less. +--0-839312057-1154883278=:35452-- + +From pgsql-performance-owner@postgresql.org Mon Aug 7 04:59:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B3DD09FB2C8 + for ; + Mon, 7 Aug 2006 04:59:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 41004-09 for + ; + Mon, 7 Aug 2006 04:59:47 -0300 (ADT) +X-Greylist: delayed 00:25:02.527122 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id DA24E9FB2D7 + for ; + Mon, 7 Aug 2006 04:59:47 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mail.revver.com (mail.revver.com [207.7.147.37]) + by svr4.postgresql.org (Postfix) with ESMTP id 08BEF5AF04C + for ; + Mon, 7 Aug 2006 07:34:43 +0000 (GMT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.revver.com (Postfix) with ESMTP id 76F09B5C0A1 + for ; + Mon, 7 Aug 2006 00:34:42 -0700 (PDT) +Received: from mail.revver.com ([127.0.0.1]) + by localhost (neil.revver.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 17369-06 for ; + Mon, 7 Aug 2006 00:34:42 -0700 (PDT) +Received: from [192.168.1.11] (c-66-229-34-91.hsd1.ca.comcast.net + [66.229.34.91]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.revver.com (Postfix) with ESMTP id 1E7F7B5C083 + for ; + Mon, 7 Aug 2006 00:34:42 -0700 (PDT) +Message-ID: <44D6EDFA.4030802@revver.com> +Date: Mon, 07 Aug 2006 00:38:34 -0700 +From: "Donald C. Sumbry ][" +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: High Context-Switches on Linux 8.1.4 Server +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at revver.com +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/63 +X-Sequence-Number: 20248 + + +Postgres 8.1.4 +Slony 1.1.5 +Linux manny 2.6.12-10-k7-smp #1 SMP Fri Apr 28 14:17:26 UTC 2006 i686 +GNU/Linux + +We're seeing an average of 30,000 context-switches a sec. This problem +was much worse w/8.0 and got bearable with 8.1 but slowly resurfaced. +Any ideas? + +procs -----------memory---------- ---swap-- -----io---- --system-- +----cpu---- + r b swpd free buff cache si so bi bo in cs us sy +id wa + 8 2 0 392184 40248 3040628 0 0 10012 2300 3371 43436 60 +25 11 4 +10 2 0 334772 40256 3043340 0 0 2672 1892 3252 10073 84 +14 1 1 + 9 2 0 338492 40280 3051272 0 0 7960 1612 3548 22013 77 +16 4 3 +11 2 0 317040 40304 3064576 0 0 13172 1616 3870 42729 61 +21 11 7 + 7 0 0 291496 40320 3078704 0 0 14192 504 3139 52200 58 +24 12 7 + +The machine has 4 gigs of RAM, shared_buffers = 32768, max_connections = +400, and currently does around 300-500 queries a second. I can provide +more info if needed. + +-- +Sumbry][ + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 15:52:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 7CD619FB253 + for ; + Mon, 7 Aug 2006 06:48:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 48553-09 for + ; + Mon, 7 Aug 2006 06:48:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id C91F39FB223 + for ; + Mon, 7 Aug 2006 06:48:47 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id 5D49A30E1A; Mon, 7 Aug 2006 11:48:46 +0200 (MET DST) +From: "Pit M." +X-Newsgroups: pgsql.performance +Subject: Re: Migrating data from DB2 to SQL Server +Date: Mon, 07 Aug 2006 11:48:50 +0200 +Organization: Hub.Org Networking Services +Lines: 19 +Message-ID: +References: <1154637778.693657.161630@i3g2000cwc.googlegroups.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Complaints-To: usenet@news.hub.org +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +In-Reply-To: <1154637778.693657.161630@i3g2000cwc.googlegroups.com> +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/194 +X-Sequence-Number: 20379 + +contact1981 wrote: +> Hello, +> +> I am trying to migrate data from a DB2 database to SQL Server 2005 +> database. Does anyone know about any migration tool that does that? I +> +> have heard about DB2 Migration Tool kit, but I think you can only +> migrate data to a DB2 database with that. Thank you. +> +> +> Sincerely, +> +> +> Eldhose Cyriac +> + +We use SQLWays to migrate from SQL Server to PostgreSQL. + +P.M. + +From pgsql-novice-owner@postgresql.org Thu Aug 10 15:50:44 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6CB059FA69A; + Mon, 7 Aug 2006 06:56:06 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 76854-09; Mon, 7 Aug 2006 09:55:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) + by postgresql.org (Postfix) with ESMTP id 4DEFF9FA040; + Mon, 7 Aug 2006 06:55:58 -0300 (ADT) +Received: from mainbox.archonet.com + (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) + by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 45F7273773; + Mon, 7 Aug 2006 10:55:52 +0100 (BST) +Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) + by mainbox.archonet.com (Postfix) with ESMTP id 5A1DB15EA7; + Mon, 7 Aug 2006 10:55:51 +0100 (BST) +Message-ID: <44D70E26.9020804@archonet.com> +Date: Mon, 07 Aug 2006 10:55:50 +0100 +From: Richard Huxton +User-Agent: Thunderbird 1.5.0.5 (X11/20060719) +MIME-Version: 1.0 +To: Saranya Sivakumar +Cc: pgsqlperform , + pgsqlnovice +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +References: <20060806165438.35459.qmail@web51307.mail.yahoo.com> +In-Reply-To: <20060806165438.35459.qmail@web51307.mail.yahoo.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/84 +X-Sequence-Number: 17299 + +Saranya Sivakumar wrote: +> Hi All, +> +> I am trying to back up a full copy of one of our databases (14G) and +> restore it on another server. Both databases run 7.3.2 version. +> Though the restore completed successfully, it took 9 hours for the +> process to complete. The destination server runs Fedora Core 3 with +> 512 MB RAM and has 1 processor. I have also deferred referential +> intergrity checks during the restore. I tried to tune some parameters +> in the config file, but it still takes 9 hours. + +Firstly, you should upgrade to the most recent version of 7.3.x (7.3.15) +- that's a *lot* of bug-fixes you are missing + +Then, I would temporarily disable fsync and increase sort_mem and +checkpoint_segments. What you're trying to do is make a single process +run as fast as possible, so allow it to grab more resources than you +normally would. + +-- + Richard Huxton + Archonet Ltd + +From pgsql-performance-owner@postgresql.org Mon Aug 7 08:51:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 182B69FB2AA + for ; + Mon, 7 Aug 2006 08:51:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 10758-06 for + ; + Mon, 7 Aug 2006 11:51:14 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 036579FB25D + for ; + Mon, 7 Aug 2006 08:51:13 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D25A1.dip0.t-ipconnect.de + [84.157.37.161]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 34BF9656B8; + Mon, 7 Aug 2006 13:53:09 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id E3623185CD0DC; + Mon, 7 Aug 2006 13:51:23 +0200 (CEST) +Message-ID: <44D7293B.20702@logix-tt.com> +Date: Mon, 07 Aug 2006 13:51:23 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: carlosreimer +Cc: pgsql-performance +Subject: Re: Disk writes +References: +In-Reply-To: +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/65 +X-Sequence-Number: 20250 + +Hi, Reimer, + +carlosreimer wrote: + +> There is some performance problems with the server and I discovered with +> vmstat tool that there is some process writing a lot of information in +> the disk subsystem. +[..] +> I could I discover who is sending so many data to the disks? + +It could be something triggered by your crontab (updatedb comes in my +mind, or texpire from leafnode etc.). + +Another idea would be that you have statement logging on, or something +else that produces lots of kernel or syslog messages[1], and your +syslogd is configured to sync() after every line... + +HTH, +Markus + +[1] We once had such a problem because an ill-compiled kernel having USB +verbose logging on... +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 7 09:07:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 720519FB333 + for ; + Mon, 7 Aug 2006 09:07:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 87990-07 for + ; + Mon, 7 Aug 2006 09:07:34 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id B23C09FB2AA + for ; + Mon, 7 Aug 2006 09:07:34 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D25A1.dip0.t-ipconnect.de + [84.157.37.161]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 215C4656B8 + for ; + Mon, 7 Aug 2006 14:09:31 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 04009185CD0DC + for ; + Mon, 7 Aug 2006 14:07:46 +0200 (CEST) +Message-ID: <44D72D11.7050203@logix-tt.com> +Date: Mon, 07 Aug 2006 14:07:45 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig +References: <7F10D26ECFA1FB458B89C5B4B0D72C2B4E4D9B@sesrv12.wirelesscar.com> + +In-Reply-To: +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.185 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/66 +X-Sequence-Number: 20251 + +Hi, Charles, + +Charles Sprickman wrote: + +> I've also got a 1U with a 9500SX-4 and 4 drives. I like how the 3Ware +> card scales there - started with 2 drives and got "drive speed" +> mirroring. Added two more and most of the bonnie numbers doubled. This +> is not what I'm used to with the Adaptec SCSI junk. + +Well, for sequential reading, you should be able to get double drive +speed on a 2-disk mirror with a good controller, as it can balance the +reads among the drives. + +Markus +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 7 09:52:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 01F469FB251 + for ; + Mon, 7 Aug 2006 09:52:27 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 56279-04 for + ; + Mon, 7 Aug 2006 12:52:19 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id CF53E9FB20F + for ; + Mon, 7 Aug 2006 09:52:18 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k77CqH8g019630; + Mon, 7 Aug 2006 08:52:17 -0400 (EDT) +To: sumbry@revver.com +cc: pgsql-performance@postgresql.org +Subject: Re: High Context-Switches on Linux 8.1.4 Server +In-reply-to: <44D6EDFA.4030802@revver.com> +References: <44D6EDFA.4030802@revver.com> +Comments: In-reply-to "Donald C. Sumbry ][" + message dated "Mon, 07 Aug 2006 00:38:34 -0700" +Date: Mon, 07 Aug 2006 08:52:17 -0400 +Message-ID: <19629.1154955137@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/67 +X-Sequence-Number: 20252 + +> We're seeing an average of 30,000 context-switches a sec. This problem +> was much worse w/8.0 and got bearable with 8.1 but slowly resurfaced. + +Is this from LWLock or spinlock contention? strace'ing a few backends +could tell the difference: look to see how many select(0,...) you see +compared to semop()s. Also, how many of these compared to real work +(such as read/write calls)? + +Do you have any long-running transactions, and if so does shutting +them down help? There's been some discussion about thrashing of the +pg_subtrans buffers being a problem, and that's mainly a function of +the age of the oldest open transaction. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Aug 7 10:18:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 209FD9FB20F + for ; + Mon, 7 Aug 2006 10:18:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 01344-02 for + ; + Mon, 7 Aug 2006 10:18:16 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 658639FB22C + for ; + Mon, 7 Aug 2006 10:18:16 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D25A1.dip0.t-ipconnect.de + [84.157.37.161]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id B97CB656B8; + Mon, 7 Aug 2006 15:20:12 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id E3979185CD0DC; + Mon, 7 Aug 2006 15:18:27 +0200 (CEST) +Message-ID: <44D73DA3.7080701@logix-tt.com> +Date: Mon, 07 Aug 2006 15:18:27 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Arjen van der Meijden , + pgsql-performance@postgresql.org +Subject: Re: PostgreSQL scalability on Sun UltraSparc T1 +References: <44CB7896.8030501@oli.tudelft.nl> + <44CB8235.9070903@commandprompt.com> + <44CB8DC1.4040105@tweakers.net> + <44CB9472.9060206@commandprompt.com> + <44CB9D52.8040409@tweakers.net> +In-Reply-To: <44CB9D52.8040409@tweakers.net> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.175 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/68 +X-Sequence-Number: 20253 + +Hi, Arjen, + +Arjen van der Meijden wrote: + +> It was the 8core version with 16GB memory... but actually that's just +> overkill, the active portions of the database easily fits in 8GB and a +> test on another machine with just 2GB didn't even show that much +> improvements when going to 7GB (6x1G, 2x 512M), it was mostly in the +> range of 10% improvement or less. + +I'd be interested in the commit_siblings and commit_delay settings, +tuning them could give a high increase on throughput for highly +concurrent insert/update workloads, at the cost of latency (and thus +worse results for low concurrency situations). + +Different fsync method settings can also make a difference (I presume +that syncing was enabled). + +HTH, +Markus + + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 7 10:32:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 88EA49FB254 + for ; + Mon, 7 Aug 2006 10:32:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 01236-04 for + ; + Mon, 7 Aug 2006 10:32:27 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id F0CA89FB20F + for ; + Mon, 7 Aug 2006 10:32:27 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D25A1.dip0.t-ipconnect.de + [84.157.37.161]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 57564656B8; + Mon, 7 Aug 2006 15:34:24 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 80E51185CD0DC; + Mon, 7 Aug 2006 15:32:39 +0200 (CEST) +Message-ID: <44D740F7.2020204@logix-tt.com> +Date: Mon, 07 Aug 2006 15:32:39 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Cc: H Hale +Subject: Re: sub select performance due to seq scans +References: <20060802121732.94126.qmail@web88001.mail.re2.yahoo.com> + <1154537296.7882.59.camel@state.g2switchworks.com> +In-Reply-To: <1154537296.7882.59.camel@state.g2switchworks.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.168 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/69 +X-Sequence-Number: 20254 + +Hi, Scott and Hale, + +Scott Marlowe wrote: +> Make sure analyze has been run and that the statistics are fairly +> accurate. + +It might also help to increase the statistics_target on the column in +question. + +HTH, +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 7 10:45:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E97DB9FB25B + for ; + Mon, 7 Aug 2006 10:45:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 66018-07 for + ; + Mon, 7 Aug 2006 13:45:12 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from gollum.cambrium.nl (mx1.cambrium.nl [217.19.16.130]) + by postgresql.org (Postfix) with SMTP id F26959FB20F + for ; + Mon, 7 Aug 2006 10:45:11 -0300 (ADT) +Received: (qmail 18748 invoked from network); 7 Aug 2006 13:45:09 -0000 +Received: from office.tweakers.net (HELO ?10.0.0.157?) (84.245.2.46) + by gollum.cambrium.nl with SMTP; 7 Aug 2006 13:45:09 -0000 +Message-ID: <44D743E4.6050109@tweakers.net> +Date: Mon, 07 Aug 2006 15:45:08 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Markus Schaber +CC: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL scalability on Sun UltraSparc T1 +References: <44CB7896.8030501@oli.tudelft.nl> + <44CB8235.9070903@commandprompt.com> + <44CB8DC1.4040105@tweakers.net> + <44CB9472.9060206@commandprompt.com> + <44CB9D52.8040409@tweakers.net> <44D73DA3.7080701@logix-tt.com> +In-Reply-To: <44D73DA3.7080701@logix-tt.com> +Content-Type: text/plain; charset=ISO-8859-15; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/70 +X-Sequence-Number: 20255 + +Hi Markus, + +As said, our environment really was a read-mostly one. So we didn't do +much inserts/updates and thus spent no time tuning those values and left +them as default settings. + +Best regards, + +Arjen + +Markus Schaber wrote: +> Hi, Arjen, +> +> Arjen van der Meijden wrote: +> +>> It was the 8core version with 16GB memory... but actually that's just +>> overkill, the active portions of the database easily fits in 8GB and a +>> test on another machine with just 2GB didn't even show that much +>> improvements when going to 7GB (6x1G, 2x 512M), it was mostly in the +>> range of 10% improvement or less. +> +> I'd be interested in the commit_siblings and commit_delay settings, +> tuning them could give a high increase on throughput for highly +> concurrent insert/update workloads, at the cost of latency (and thus +> worse results for low concurrency situations). +> +> Different fsync method settings can also make a difference (I presume +> that syncing was enabled). +> +> HTH, +> Markus +> +> + +From pgsql-novice-owner@postgresql.org Mon Aug 7 12:35:13 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A33C19FB225 + for ; + Mon, 7 Aug 2006 12:35:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 11530-01 for ; + Mon, 7 Aug 2006 12:35:04 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web51310.mail.yahoo.com (web51310.mail.yahoo.com + [206.190.38.176]) + by postgresql.org (Postfix) with SMTP id 4B5BA9FB25F + for ; Mon, 7 Aug 2006 12:35:03 -0300 (ADT) +Received: (qmail 25589 invoked by uid 60001); 7 Aug 2006 15:35:02 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=lQa3DeOg8slDTVeKI7ILnLaUMdfxRezxAerBNhmVo+xHD1pSILyxkkk0pxvvtPT8Xh5kRiAIy+4HxKaqVpiHPsHGd3Mu+yJmFchPvOs2UtTVZYUx9ATZxwKYTPyzrVVMq3jqoGTxyT8ETTu24+lr4IFrIZr7j3ninOnKLJOrSns= + ; +Message-ID: <20060807153502.25587.qmail@web51310.mail.yahoo.com> +Received: from [216.199.70.171] by web51310.mail.yahoo.com via HTTP; + Mon, 07 Aug 2006 08:35:02 PDT +Date: Mon, 7 Aug 2006 08:35:02 -0700 (PDT) +From: Saranya Sivakumar +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +To: Richard Huxton +Cc: pgsqlperform , + pgsqlnovice +In-Reply-To: <44D70E26.9020804@archonet.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-140695556-1154964902=:24751" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.356 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, + HTML_MESSAGE +X-Spam-Level: *** +X-Archive-Number: 200608/49 +X-Sequence-Number: 17264 + +--0-140695556-1154964902=:24751 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi Richard, + + Thank you very much for the suggestions. As I said, we are stuck with 7.3.2 version for now. We have a Upgrade Project in place, but this backup is something we have to do immediately (we do not have enough time to test our application with 7.3.15 :( ) + + The checkpoint segments occur every 1.15 minutes with the default setting. + I tried tuning some parameters in the conf file, which took 4.5 hours for the restore. + + sort_mem = 40960 + shared_buffers = 3000 + #checkpoint_segments = 3 (default) + #fsync = true --I will disable this and try + + We can afford to have a downtime of only 1 to 1.5 hours. + I am going to increase the shared_buffers, sort_mem and disable fysnc as suggested by you, and try the restore process again. + + I would appreciate any other suggestions/advice in this regard. + + Thanks, + Saranya + + + +Richard Huxton wrote: + Saranya Sivakumar wrote: +> Hi All, +> +> I am trying to back up a full copy of one of our databases (14G) and +> restore it on another server. Both databases run 7.3.2 version. +> Though the restore completed successfully, it took 9 hours for the +> process to complete. The destination server runs Fedora Core 3 with +> 512 MB RAM and has 1 processor. I have also deferred referential +> intergrity checks during the restore. I tried to tune some parameters +> in the config file, but it still takes 9 hours. + +Firstly, you should upgrade to the most recent version of 7.3.x (7.3.15) +- that's a *lot* of bug-fixes you are missing + +Then, I would temporarily disable fsync and increase sort_mem and +checkpoint_segments. What you're trying to do is make a single process +run as fast as possible, so allow it to grab more resources than you +normally would. + +-- +Richard Huxton +Archonet Ltd + + + +--------------------------------- +See the all-new, redesigned Yahoo.com. Check it out. +--0-140695556-1154964902=:24751 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +
Hi Richard,
 
Thank you very much for the suggestions. As I said, we are stuck with 7.3.2 version for now. We have a Upgrade Project in place, but this backup is something we have to do immediately (we do not have enough time to test our application with 7.3.15 :( )
 
The checkpoint segments occur every 1.15 minutes with the default setting.
I tried tuning some parameters in the conf file, which took 4.5 hours for the restore.
 
sort_mem = 40960
shared_buffers = 3000
#checkpoint_segments = 3  (default)
#fsync = true    --I will disable this and try
 
We can afford to have a downtime of only 1 to 1.5 hours.
I am going to increase the shared_buffers, sort_mem and disable fysnc as suggested by you, and try the restore process again.
 
I + would appreciate any other suggestions/advice in this regard.
 
Thanks,
Saranya
 


Richard Huxton <dev@archonet.com> wrote:
Saranya Sivakumar wrote:
> Hi All,
>
> I am trying to back up a full copy of one of our databases (14G) and
> restore it on another server. Both databases run 7.3.2 version.
> Though the restore completed successfully, it took 9 hours for the
> process to complete. The destination server runs Fedora Core 3 with
> 512 MB RAM and has 1 processor. I have also deferred referential
> intergrity checks during the restore. I tried to tune some parameters
> in the config file, but it still takes 9 hours.

Firstly, you should upgrade to the most recent version of 7.3.x (7.3.15)
- that's a *lot* + of bug-fixes you are missing

Then, I would temporarily disable fsync and increase sort_mem and
checkpoint_segments. What you're trying to do is make a single process
run as fast as possible, so allow it to grab more resources than you
normally would.

--
Richard Huxton
Archonet Ltd

+ +


See the all-new, redesigned Yahoo.com. Check it out. + +--0-140695556-1154964902=:24751-- + +From pgsql-performance-owner@postgresql.org Mon Aug 7 12:47:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C97C89FB25F + for ; + Mon, 7 Aug 2006 12:47:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 11076-08 for + ; + Mon, 7 Aug 2006 12:47:18 -0300 (ADT) +X-Greylist: delayed 08:12:37.673141 by SQLgrey- +Received: from mail.revver.com (mail.revver.com [207.7.147.37]) + by postgresql.org (Postfix) with ESMTP id 631089FB225 + for ; + Mon, 7 Aug 2006 12:47:18 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.revver.com (Postfix) with ESMTP id 96628B5C0AD; + Mon, 7 Aug 2006 08:47:17 -0700 (PDT) +Received: from mail.revver.com ([127.0.0.1]) + by localhost (neil.revver.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 30355-06; Mon, 7 Aug 2006 08:47:17 -0700 (PDT) +Received: from [192.168.1.11] (c-66-229-34-91.hsd1.ca.comcast.net + [66.229.34.91]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.revver.com (Postfix) with ESMTP id 1A724B5C067; + Mon, 7 Aug 2006 08:47:17 -0700 (PDT) +Message-ID: <44D7616D.6080906@revver.com> +Date: Mon, 07 Aug 2006 08:51:09 -0700 +From: "Donald C. Sumbry ][" +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Tom Lane +CC: pgsql-performance@postgresql.org +Subject: Re: High Context-Switches on Linux 8.1.4 Server +References: <44D6EDFA.4030802@revver.com> <19629.1154955137@sss.pgh.pa.us> +In-Reply-To: <19629.1154955137@sss.pgh.pa.us> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at revver.com +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/72 +X-Sequence-Number: 20257 + +Tom Lane wrote: +>> We're seeing an average of 30,000 context-switches a sec. This problem +>> was much worse w/8.0 and got bearable with 8.1 but slowly resurfaced. +> +> Is this from LWLock or spinlock contention? strace'ing a few backends +> could tell the difference: look to see how many select(0,...) you see +> compared to semop()s. Also, how many of these compared to real work +> (such as read/write calls)? + +Over a 20 second interval, I've got about 85 select()s and 6,230 +semop()s. 2604 read()s vs 16 write()s. + +> Do you have any long-running transactions, and if so does shutting +> them down help? There's been some discussion about thrashing of the +> pg_subtrans buffers being a problem, and that's mainly a function of +> the age of the oldest open transaction. + +Not long-running. We do have a badly behaving legacy app that is +leaving some backends "idle in transaction" They're gone pretty quickly +so I can't kill them fast enough, but running a pg_stat_activity will +always show at least a handful. Could this be contributing? + +Based on the number of semop's we're getting it does look like +shared_memory may be getting thrased - any suggestions? We did try +lowering shared_memory usage in half the previous day, but that did +little to help (it didn't make performance any worse and we still saw +the high context-switches, but it didn't make it any better either). + +-- +Sumbry][ + +From pgsql-novice-owner@postgresql.org Mon Aug 7 13:08:38 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id DDC2B9FB35C + for ; + Mon, 7 Aug 2006 13:08:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 06700-03 for ; + Mon, 7 Aug 2006 16:08:31 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web51309.mail.yahoo.com (web51309.mail.yahoo.com + [206.190.38.175]) + by postgresql.org (Postfix) with SMTP id 8D2BF9FB35B + for ; Mon, 7 Aug 2006 13:08:31 -0300 (ADT) +Received: (qmail 21243 invoked by uid 60001); 7 Aug 2006 16:08:30 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=IhGTEs0E87bIZ/ffmDmbzsY2iOLSej3UpZoB1KiW9SHn6k8HN6vUppbuUzGTC8iqdweqyIfP5C1cAxH1itr4gHwlezJS7CGkiMc9jytXH6vQbnnUXlHRrMj13JIru891jvfnTpuf9lq67EMe7L1oFmDiBJjyo7bpjFNLk1qCz0w= + ; +Message-ID: <20060807160830.21241.qmail@web51309.mail.yahoo.com> +Received: from [216.199.70.171] by web51309.mail.yahoo.com via HTTP; + Mon, 07 Aug 2006 09:08:30 PDT +Date: Mon, 7 Aug 2006 09:08:30 -0700 (PDT) +From: Saranya Sivakumar +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +To: pgsqlperform , + pgsqlnovice +In-Reply-To: <44D70E26.9020804@archonet.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-412715950-1154966910=:20903" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.356 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, + HTML_MESSAGE +X-Spam-Level: *** +X-Archive-Number: 200608/52 +X-Sequence-Number: 17267 + +--0-412715950-1154966910=:20903 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi All, + + I tried to set shared_buffers= 10000, turned off fsync and reload the config file. + But I got the following error: + + IpcMemoryCreate: shmget(key=5432001, size=85450752, 03600) failed: Invalid argument + This error usually means that PostgreSQL's request for a shared memory +segment exceeded your kernel's SHMMAX parameter. You can either +reduce the request size or reconfigure the kernel with larger SHMMAX. +To reduce the request size (currently 85450752 bytes), reduce +PostgreSQL's shared_buffers parameter (currently 10000) and/or +its max_connections parameter (currently 128). + If the request size is already small, it's possible that it is less than +your kernel's SHMMIN parameter, in which case raising the request size or +reconfiguring SHMMIN is called for. + + The total RAM available on this machine is 512MB. + + I am not sure how to set these parameters SHMMAX and SHMMIN. + Any help/advice would be greatly appreciated. + + Thanks, + Saranya + +Richard Huxton wrote: + Saranya Sivakumar wrote: +> Hi All, +> +> I am trying to back up a full copy of one of our databases (14G) and +> restore it on another server. Both databases run 7.3.2 version. +> Though the restore completed successfully, it took 9 hours for the +> process to complete. The destination server runs Fedora Core 3 with +> 512 MB RAM and has 1 processor. I have also deferred referential +> intergrity checks during the restore. I tried to tune some parameters +> in the config file, but it still takes 9 hours. + +Firstly, you should upgrade to the most recent version of 7.3.x (7.3.15) +- that's a *lot* of bug-fixes you are missing + +Then, I would temporarily disable fsync and increase sort_mem and +checkpoint_segments. What you're trying to do is make a single process +run as fast as possible, so allow it to grab more resources than you +normally would. + +-- +Richard Huxton +Archonet Ltd + + + +--------------------------------- +Do you Yahoo!? + Everyone is raving about the all-new Yahoo! Mail Beta. +--0-412715950-1154966910=:20903 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +
Hi All,
 
I tried to set shared_buffers= 10000, turned off fsync and reload the config file.
But I got the following error:
 
IpcMemoryCreate: shmget(key=5432001, size=85450752, 03600) failed: Invalid argument
This error usually means that PostgreSQL's request for a shared memory
segment exceeded your kernel's SHMMAX parameter.  You can either
reduce the request size or reconfigure the kernel with larger SHMMAX.
To reduce the request size (currently 85450752 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 10000) and/or
its max_connections parameter (currently 128).
If the request size is already small, it's possible that it is less than
your kernel's SHMMIN parameter, in which case raising the request size or
reconfiguring SHMMIN is called for.
The total RAM available on this machine is 512MB.
+
 
I am not sure how to set these parameters SHMMAX and SHMMIN.
Any help/advice would be greatly appreciated.
 
Thanks,
Saranya

Richard Huxton <dev@archonet.com> wrote:
Saranya Sivakumar wrote:
> Hi All,
>
> I am trying to back up a full copy of one of our databases (14G) and
> restore it on another server. Both databases run 7.3.2 version.
> Though the restore completed successfully, it took 9 hours for the
> process to complete. The destination server runs Fedora Core 3 with
> 512 MB RAM and has 1 processor. I have also deferred referential
> intergrity checks during the restore. I tried to tune some parameters
> in the config file, but it still takes 9 hours.

Firstly, you should upgrade to the + most recent version of 7.3.x (7.3.15)
- that's a *lot* of bug-fixes you are missing

Then, I would temporarily disable fsync and increase sort_mem and
checkpoint_segments. What you're trying to do is make a single process
run as fast as possible, so allow it to grab more resources than you
normally would.

--
Richard Huxton
Archonet Ltd

+


Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta. +--0-412715950-1154966910=:20903-- + +From pgsql-novice-owner@postgresql.org Mon Aug 7 13:17:27 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A1D149FB35F + for ; + Mon, 7 Aug 2006 13:17:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 13649-05 for ; + Mon, 7 Aug 2006 13:17:18 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web31804.mail.mud.yahoo.com (web31804.mail.mud.yahoo.com + [68.142.207.67]) by postgresql.org (Postfix) with SMTP id BF69E9FB35C + for ; Mon, 7 Aug 2006 13:17:16 -0300 (ADT) +Received: (qmail 77650 invoked by uid 60001); 7 Aug 2006 16:17:15 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=rm6nBG3/dQV4uvi2pTC/BUwUhQocAhbhFbKUS/CwPuSr4MO1+/3jNQRIejSxo+vec7fw/CyUlfztjAVNtI7vYTFVIdwiyg9vCWXTdrVBzXIab4bYcmbP0pOaXOCAVVzIMpaFoB0MrOON/9z/A6Dq1qVOVN2l+LqY0LZDOeu8Ls4= + ; +Message-ID: <20060807161715.77647.qmail@web31804.mail.mud.yahoo.com> +Received: from [63.203.180.122] by web31804.mail.mud.yahoo.com via HTTP; + Mon, 07 Aug 2006 09:17:15 PDT +Date: Mon, 7 Aug 2006 09:17:15 -0700 (PDT) +From: Richard Broersma Jr +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +To: Saranya Sivakumar , + pgsqlperform , + pgsqlnovice +In-Reply-To: <20060807160830.21241.qmail@web51309.mail.yahoo.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.566 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS +X-Spam-Level: ** +X-Archive-Number: 200608/54 +X-Sequence-Number: 17269 + +> IpcMemoryCreate: shmget(key=5432001, size=85450752, 03600) failed: Invalid argument +> This error usually means that PostgreSQL's request for a shared memory +> segment exceeded your kernel's SHMMAX parameter. You can either +> reduce the request size or reconfigure the kernel with larger SHMMAX. +> To reduce the request size (currently 85450752 bytes), reduce +> PostgreSQL's shared_buffers parameter (currently 10000) and/or +> its max_connections parameter (currently 128). +> If the request size is already small, it's possible that it is less than +> your kernel's SHMMIN parameter, in which case raising the request size or +> reconfiguring SHMMIN is called for. + +if you cat /proc/sys/kernel/shmmax +it will tell you what it is set to. It needs to be at least "85450752". The size that Postgresql +is trying to grab. + +also shmall may need to be adjusted also. + +> The total RAM available on this machine is 512MB. +> +> I am not sure how to set these parameters SHMMAX and SHMMIN. +> Any help/advice would be greatly appreciated. + +http://www.postgresql.org/docs/8.1/interactive/kernel-resources.html +This will help you to set the kernel parameters. + +Regards, + +Richard Broersma Jr. + + +From pgsql-performance-owner@postgresql.org Mon Aug 7 13:55:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 880A29FB1BA + for ; + Mon, 7 Aug 2006 13:55:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 28250-06 for + ; + Mon, 7 Aug 2006 16:55:51 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id A7A2C9FA69A + for ; + Mon, 7 Aug 2006 13:55:51 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-202-139.bk11-dsl.surnet.cl + [201.221.202.139]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k77GtZ4l017799; + Mon, 7 Aug 2006 09:55:36 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id D7EF9C45036; Mon, 7 Aug 2006 12:55:16 -0400 (CLT) +Date: Mon, 7 Aug 2006 12:55:16 -0400 +From: Alvaro Herrera +To: "Jim C. Nasby" +Cc: "J. Andrew Rogers" , + Milen Kulev , + "Pgsql-Performance ((E-mail))" +Subject: Re: XFS filessystem for Datawarehousing +Message-ID: <20060807165516.GA26021@alvh.no-ip.org> +Mail-Followup-To: "Jim C. Nasby" , + "J. Andrew Rogers" , + Milen Kulev , + "Pgsql-Performance ((E-mail))" +References: <012d01c6b5b4$6db33680$0a00a8c0@trivadis.com> + + <20060802004223.GE20401@alvh.no-ip.org> + <20060804204450.GS40481@pervasive.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060804204450.GS40481@pervasive.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 07 Aug 2006 09:55:40 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.856 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, RCVD_IN_NJABL_PROXY +X-Spam-Level: +X-Archive-Number: 200608/75 +X-Sequence-Number: 20260 + +Jim C. Nasby wrote: +> On Tue, Aug 01, 2006 at 08:42:23PM -0400, Alvaro Herrera wrote: + +> > Most likely ext3 was used on the default configuration, which logs data +> > operations as well as metadata, which is what XFS logs. I don't think +> > I've seen any credible comparison between XFS and ext3 with the +> > metadata-only journal option. +> > +> > On the other hand I don't think it makes sense to journal data on a +> > PostgreSQL environment. Metadata is enough, given that we log data on +> > WAL anyway. +> +> Actually, according to http://en.wikipedia.org/wiki/Ext3 the default +> journalling option for ext3 isn't to journal the data (which is actually +> data=journal), but to wait until the data is written before considering +> the metadata to be committed (data=ordered). + +Well, we don't need the data to be written before considering metadata +committed. data=writeback is enough for partitions to be dedicated to +PGDATA. Not sure what other FSs do on this front but the ext3 default +leans towards safe rather than speedy. + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Mon Aug 7 14:26:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E180C9FB36A + for ; + Mon, 7 Aug 2006 14:26:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 22091-02 for + ; + Mon, 7 Aug 2006 14:26:15 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web30310.mail.mud.yahoo.com (web30310.mail.mud.yahoo.com + [68.142.200.103]) + by postgresql.org (Postfix) with SMTP id 95CF79FA231 + for ; + Mon, 7 Aug 2006 14:26:15 -0300 (ADT) +Received: (qmail 90851 invoked by uid 60001); 7 Aug 2006 17:26:14 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=VviIeiPhGh7kU8O/cFy9WiWz/ARRU98v4/h59fx6kIM9DgEpu1gYrvKg4setOw3sEDoidEXq77yPHaozN+htD2spJIAzmRr/nNyG5t9dNf/j/Fotzir98sigCVTP9R/cmMdVrHkG8VoxaXux5jTM/hqNqCoZ1bERX5mNJFYbiFU= + ; +Message-ID: <20060807172614.90849.qmail@web30310.mail.mud.yahoo.com> +Received: from [201.211.101.3] by web30310.mail.mud.yahoo.com via HTTP; + Mon, 07 Aug 2006 10:26:14 PDT +Date: Mon, 7 Aug 2006 10:26:14 -0700 (PDT) +From: hansell baran +Subject: Slow transfer speeds +To: pgsql-performance@postgresql.org +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-529471524-1154971574=:89089" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.473 tagged_above=0 required=5 tests=AWL, HTML_00_10, + HTML_MESSAGE +X-Spam-Level: ** +X-Archive-Number: 200608/76 +X-Sequence-Number: 20261 + +--0-529471524-1154971574=:89089 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi. I'm new at using PostgreSQL. I have found posts related to this one but there is not a definite answer or solution. Here it goes. +Where I work, all databases were built with MS Access. The Access files are hosted by computers with Windows 2000 and Windows XP. A new server is on its way and only Open Source Software is going to be installed. The OS is going to be SUSE Linux 10.1 and we are making comparisons between MySQL, PostgreSQL and MS Access. We installed MySQL and PostgreSQL on both SUSE and Windows XP (MySQL & PostgreSQL DO NOT run at the same time)(There is one HDD for Windows and one for Linux) +The "Test Server" in which we install the DBMS has the following characteristics: + +CPU speed = 1.3 GHz +RAM = 512 MB +HDD = 40 GB + +The biggest table has 544371 rows(tuples?) with 55 rows. All fields are float8. Only 1 is varchar(255) and 1 timestamp. +We query the MS Access databases through Visual Basic Programs and ODBC Drivers. We made a Visual Basic program that uses ADO to connect to ALL three DBMS using ODBC drivers. + +When we run the following query "SELECT * FROM big_table", we get the following resutls: + +MS Access +- Execution time ~ 51 seconds (Depending on the client machine, it can go as low as 20 seconds) +- Network Utilization ~ 75 Mbps (According to Windows Task Manager) + +MySQL 5.0(under Windows) +- Execution time ~ 630 seconds +- Network Utilization ~ 8 Mbps + +PostgreSQL 8.1(under Windows) +- Execution time ~ 290 seconds) +- Network Utilization ~ 13 Mbps + + +MS Access (under Linux. MS Access files are in the Linux computer which has the SAMBA server running. The client computer has a mapped network drive that conects to the Linux files.) +- Execution time ~ 55 seconds (Depending on the client machine, it can go as low as 20 seconds) +- Network Utilization ~ 70 Mbps (According to Windows Task Manager) + +MySQL 5.0(under Linux) +- Execution time ~ 440 seconds +- Network Utilization ~ 11 Mbps + +PostgreSQL 8.1(under Linux) +- Execution time ~ 180 seconds) +- Network Utilization ~ 18 Mbps + +Due to the fact that the query returns a lot of rows, I cannot use the ODBC driver with the "Use Declare/Fetch" option disabled. If I run the query with this option disabled, the transfer speed goes up to about 20 Mpbs (PostgreSQL in Windows) and ~35 Mbps (PostgreSQL in Linux) (The transfer speed never goes beyond 40 Mbps even if we query from several clients at the same time. If we query MS Access from several machines, the transfer speed goes almost to 85 Mbps. Obviously, these simultaneous querys run slower). The problem with running the query with the "Use Declare/Fetch" option disabled is that the client computer shows an error saying "Out of memory while reading tuples". + +Very different results are obtained if a the query "SELECT * from big_table ORDER BY "some_column"". In this scenario PostgreSQL is faster than MS Access or MySQL by more than 100 seconds. Transfer speed, however, transfer speed is still slower for PostgreSQL than for MS Access. + +We have run many other queries (not complex, at most nesting of 5 inner joins) and MS Access is always faster. We have seen by looking at the network activity in the Windows Task Manager that the main problem is the transfer speed. We also have noticed that MS Access quickly downloads the file that has the necesary information and works on it locally on the client computer. The queries, obviously, run faster if the client computer has more resources (CPU speed, RAM, etc.). The fact that the client computer does not use any resource to execute the query, only to receive the results, is one big plus for PostgreSQL (we think). We need,however, to improve the performance of the queries that return a lot of rows because those are the most used queries. + +We searched the postgresql archives, mailing lists, etc. and have tried changing the parameters of the PostgreSQL server(both on Linux and Windows)(We also tried with the default parameters) and changing the parameters of the ODBC driver as suggested. We still get aproximately the same results. We have even changed some TCP/IP parameters(only in Windows) but no improvement. + +We have turned off all tracings, logs, and debugs of the ODBC driver. The behaviour is the same when querying from pgAdmin III. + +To get to the point: Is this problem with the transfer rates a PostgreSQL server/PostgresQL ODBC driver limitation? +Is there a way to increase the transfer rates? + +Thank you very much for any help received! + +Hansell E. Baran Altuve + +--------------------------------- +Do you Yahoo!? + Get on board. You're invited to try the new Yahoo! Mail Beta. +--0-529471524-1154971574=:89089 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi. I'm new at using PostgreSQL. I have found posts related to this one but there is not a definite answer or solution. Here it goes.
Where I work, all databases were built with MS Access. The Access files are hosted by computers with Windows 2000 and Windows XP. A new server is on its way and only Open Source Software is going to be installed. The OS is going to be SUSE Linux 10.1 and we are making comparisons between MySQL, PostgreSQL and MS Access. We installed MySQL and PostgreSQL on both SUSE and Windows XP (MySQL & PostgreSQL DO NOT run at the same time)(There is one HDD for Windows and one for Linux)
The "Test Server" in which we install the DBMS has the following characteristics:

CPU speed = 1.3 GHz
RAM = 512 MB
HDD = 40 GB

The biggest table has 544371 rows(tuples?) with 55 rows. All fields are float8. Only 1 is varchar(255) and 1 timestamp.
We query the MS Access databases through Visual Basic Programs and ODBC Drivers. We made a + Visual Basic program that uses ADO to connect to ALL three DBMS using ODBC drivers.

When we run the following query "SELECT * FROM big_table", we get the following resutls:

MS Access
- Execution time ~ 51 seconds (Depending on the client machine, it can go as low as 20 seconds)
- Network Utilization ~ 75 Mbps (According to Windows Task Manager)

MySQL 5.0(under Windows)
- Execution time ~ 630 seconds
- Network Utilization ~ 8 Mbps

PostgreSQL 8.1(under Windows)
- Execution time ~ 290 seconds)
- Network Utilization ~ 13 Mbps


MS Access (under Linux. MS Access files are in the Linux computer which has the SAMBA server running. The client computer has a mapped network drive that conects to the Linux files.)
- Execution time ~ 55 seconds (Depending on the client machine, it can go as low as 20 seconds)
- Network Utilization ~ 70 Mbps (According to Windows Task Manager)

MySQL 5.0(under Linux)
- Execution time + ~ 440 seconds
- Network Utilization ~ 11 Mbps

PostgreSQL 8.1(under Linux)
- Execution time ~ 180 seconds)
- Network Utilization ~ 18 Mbps

Due to the fact that the query returns a lot of rows, I cannot use the ODBC driver with the "Use Declare/Fetch" option disabled. If I run the query with this option disabled, the transfer speed goes up to about 20 Mpbs (PostgreSQL in Windows) and ~35 Mbps (PostgreSQL in Linux) (The transfer speed never goes beyond 40 Mbps even if we query from several clients at the same time. If we query MS Access from several machines, the transfer speed goes almost to 85 Mbps. Obviously, these simultaneous querys run slower). The problem with running the query with the "Use Declare/Fetch" option disabled is that the client computer shows an error saying "Out of memory while reading tuples".

Very different results are obtained if a the query "SELECT * from big_table ORDER BY "some_column"". In this scenario PostgreSQL is + faster than MS Access or MySQL by more than 100 seconds. Transfer speed, however, transfer speed is still slower for PostgreSQL than for MS Access.

We have run many other queries (not complex, at most nesting of 5 inner joins) and MS Access is always faster. We have seen by looking at the network activity in the Windows Task Manager that the main problem is the transfer speed. We also have noticed that MS Access quickly downloads the file that has the necesary information and works on it locally on the client computer. The queries, obviously, run faster if the client computer has more resources (CPU speed, RAM, etc.). The fact that the client computer does not use any resource to execute the query, only to receive the results, is one big plus for PostgreSQL (we think). We need,however, to improve the performance of the queries that return a lot of rows because those are the most used queries.

We searched the postgresql archives, mailing lists, etc. and have + tried changing the parameters of the PostgreSQL server(both on Linux and Windows)(We also tried with the default parameters) and changing the parameters of the ODBC driver as suggested. We still get aproximately the same results. We have even changed some TCP/IP parameters(only in Windows) but no improvement.

We have turned off all tracings, logs, and debugs of the ODBC driver. The behaviour is the same when querying from pgAdmin III.

To get to the point: Is this problem with the transfer rates a PostgreSQL server/PostgresQL ODBC driver limitation?
Is there a way to increase the transfer rates?

Thank you very much for any help received!

Hansell E. Baran Altuve

+


Do you Yahoo!?
+Get on board. You're invited to try the new Yahoo! Mail Beta. +--0-529471524-1154971574=:89089-- + +From pgsql-novice-owner@postgresql.org Mon Aug 7 14:28:34 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8B8FE9FA231 + for ; + Mon, 7 Aug 2006 14:28:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 49232-02 for ; + Mon, 7 Aug 2006 17:28:27 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web51314.mail.yahoo.com (web51314.mail.yahoo.com + [206.190.39.124]) + by postgresql.org (Postfix) with SMTP id 43B659FB273 + for ; Mon, 7 Aug 2006 14:28:26 -0300 (ADT) +Received: (qmail 52232 invoked by uid 60001); 7 Aug 2006 17:28:25 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=S1lnSOApTzlRnzdAxlDqnWd4Ox7HYvx2ox4SyoOyQGr73dhLIR6V6svgxCbRoug6sbCB/pNU+B5/imqeXTGyXUUUrE3IV1cxKHIbRObZ13hidCavVZuWM39cL/copg/qep8HiBCxSLVY2ZloVtOfPYxxfM+G6s0WP+nvMUnCvJE= + ; +Message-ID: <20060807172825.52230.qmail@web51314.mail.yahoo.com> +Received: from [216.199.70.171] by web51314.mail.yahoo.com via HTTP; + Mon, 07 Aug 2006 10:28:25 PDT +Date: Mon, 7 Aug 2006 10:28:25 -0700 (PDT) +From: Saranya Sivakumar +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +To: pgsqlnovice , + pgsqlperform +In-Reply-To: <20060807161715.77647.qmail@web31804.mail.mud.yahoo.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-2054772213-1154971705=:49605" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.73 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, + HTML_30_40, HTML_MESSAGE +X-Spam-Level: *** +X-Archive-Number: 200608/57 +X-Sequence-Number: 17272 + +--0-2054772213-1154971705=:49605 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi Richard, + + Thank you very much for the information. The SHMMAX was set to 33554432, and that's why it failed to start the postmaster. Thanks for the link to the kernel resources article. I guess changing these parameters would require recompiling the kernel. + + Is there any work around without changing these parameters to make maximum use of RAM? + + We got a new server now with 2GB RAM, but it also has the same value for SHMMAX. + + And I am trying the restore with the following conf + sort_mem = 40960 (changed from 1024) + shared_buffers = 3000 (changed from 64) + max_connections = 128 (changed from 32) + + Thanks, + Saranya + + + + +Richard Broersma Jr wrote: + + > IpcMemoryCreate: shmget(key=5432001, size=85450752, 03600) failed: Invalid argument +> This error usually means that PostgreSQL's request for a shared memory +> segment exceeded your kernel's SHMMAX parameter. You can either +> reduce the request size or reconfigure the kernel with larger SHMMAX. +> To reduce the request size (currently 85450752 bytes), reduce +> PostgreSQL's shared_buffers parameter (currently 10000) and/or +> its max_connections parameter (currently 128). +> If the request size is already small, it's possible that it is less than +> your kernel's SHMMIN parameter, in which case raising the request size or +> reconfiguring SHMMIN is called for. + +if you cat /proc/sys/kernel/shmmax +it will tell you what it is set to. It needs to be at least "85450752". The size that Postgresql +is trying to grab. + +also shmall may need to be adjusted also. + +> The total RAM available on this machine is 512MB. +> +> I am not sure how to set these parameters SHMMAX and SHMMIN. +> Any help/advice would be greatly appreciated. + +http://www.postgresql.org/docs/8.1/interactive/kernel-resources.html +This will help you to set the kernel parameters. + +Regards, + +Richard Broersma Jr. + + + + +--------------------------------- +Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups. +--0-2054772213-1154971705=:49605 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +
Hi Richard,
 
Thank you very much for the information. The SHMMAX was set to 33554432, and that's why it failed to start the postmaster. Thanks for the link to the kernel resources article. I guess changing these parameters would require recompiling the kernel.
 
Is there any work around without changing these parameters to make maximum use of RAM?
 
We got a new server now with 2GB RAM, but it also has the same value for SHMMAX.
 
And I am trying the restore with the following conf
sort_mem = 40960  (changed from 1024)
shared_buffers = 3000 (changed from 64)
+
max_connections = 128 (changed from 32)
 
Thanks,
Saranya
 
 
 

Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> IpcMemoryCreate: shmget(key=5432001, size=85450752, 03600) failed: Invalid argument
> This error usually means that PostgreSQL's request for a shared memory
> segment exceeded your kernel's SHMMAX parameter. You can either
> reduce the request size or reconfigure the kernel with larger SHMMAX.
> To reduce the request size (currently 85450752 bytes), reduce
> PostgreSQL's shared_buffers parameter (currently 10000) and/or
> its max_connections parameter (currently 128).
> If the request size is already small, it's possible that it is less than
> your kernel's SHMMIN + parameter, in which case raising the request size or
> reconfiguring SHMMIN is called for.

if you cat /proc/sys/kernel/shmmax
it will tell you what it is set to. It needs to be at least "85450752". The size that Postgresql
is trying to grab.

also shmall may need to be adjusted also.

> The total RAM available on this machine is 512MB.
>
> I am not sure how to set these parameters SHMMAX and SHMMIN.
> Any help/advice would be greatly appreciated.

http://www.postgresql.org/docs/8.1/interactive/kernel-resources.html
This will help you to set the kernel parameters.

Regards,

Richard Broersma Jr.


+


Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups. +--0-2054772213-1154971705=:49605-- + +From pgsql-performance-owner@postgresql.org Mon Aug 7 15:05:57 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 920289FB206 + for ; + Mon, 7 Aug 2006 15:05:56 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 27437-07 for + ; + Mon, 7 Aug 2006 15:05:48 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 360719FA231 + for ; + Mon, 7 Aug 2006 15:05:47 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Mon, 7 Aug 2006 18:05:45 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 07 Aug 2006 13:05:45 -0500 +Subject: Re: Slow transfer speeds +From: Scott Marlowe +To: hansell baran +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060807172614.90849.qmail@web30310.mail.mud.yahoo.com> +References: <20060807172614.90849.qmail@web30310.mail.mud.yahoo.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1154973945.20252.18.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Mon, 07 Aug 2006 13:05:45 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.105 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/78 +X-Sequence-Number: 20263 + +On Mon, 2006-08-07 at 12:26, hansell baran wrote: +> Hi. I'm new at using PostgreSQL. I have found posts related to this +> one but there is not a definite answer or solution. Here it goes. +> Where I work, all databases were built with MS Access. The Access +> files are hosted by computers with Windows 2000 and Windows XP. A new +> server is on its way and only Open Source Software is going to be +> installed. The OS is going to be SUSE Linux 10.1 and we are making +> comparisons between MySQL, PostgreSQL and MS Access. We installed +> MySQL and PostgreSQL on both SUSE and Windows XP (MySQL & PostgreSQL +> DO NOT run at the same time)(There is one HDD for Windows and one for +> Linux) +> The "Test Server" in which we install the DBMS has the following +> characteristics: +> +> CPU speed = 1.3 GHz +> RAM = 512 MB +> HDD = 40 GB + +Just FYI, that's not only not much in terms of server, it's not even +much in terms of a workstation. My laptop is about on par with that. + +Just sayin. + +OK, just so you know, you're comparing apples and oranges. A client +side application like access has little or none of the overhead that a +real database server has. + +The advantage PostgreSQL has is that many people can read AND write to +the same data store simultaneously and the database server will make +sure that the underlying data in the files never gets corrupted. +Further, with proper constraints in place, it can make sure that the +data stays coherent (i.e. that data dependencies are honored.) + +As you can imagine, there's gonna be some overhead there. And it's +wholly unfair to compare a databases ability to stream out data in a +single read to access. It is the worst case scenario. + +Try having 30 employees connect to the SAME access database and start +updating lots and lots of records. Have someone read out the data while +that's going on. Repeat on PostgreSQL. + +If you're mostly going to be reading data, then maybe some intermediate +system is needed, something to "harvest" the data into some flat files. + +But if your users need to read out 500,000 rows, change a few, and write +the whole thing back, your business process is likely not currently +suited to a database and needs to be rethought. + +From pgsql-novice-owner@postgresql.org Thu Aug 10 15:50:46 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3366F9FA4E0; + Mon, 7 Aug 2006 15:25:09 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28742-09; Mon, 7 Aug 2006 15:25:03 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 849409FB206; + Mon, 7 Aug 2006 15:25:03 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D25A1.dip0.t-ipconnect.de + [84.157.37.161]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id A0B60656B8; + Mon, 7 Aug 2006 20:26:55 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id C7B59180009EF; + Mon, 7 Aug 2006 20:25:10 +0200 (CEST) +Message-ID: <44D78586.8060406@logix-tt.com> +Date: Mon, 07 Aug 2006 20:25:10 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Saranya Sivakumar +Cc: pgsqlnovice , + pgsqlperform +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +References: <20060807172825.52230.qmail@web51314.mail.yahoo.com> +In-Reply-To: <20060807172825.52230.qmail@web51314.mail.yahoo.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.173 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/85 +X-Sequence-Number: 17300 + +Hi, Saranya, + +Saranya Sivakumar wrote: +> Thank you very much for the information. The SHMMAX was set to 33554432, +> and that's why it failed to start the postmaster. Thanks for the link to +> the kernel resources article. I guess changing these parameters would +> require recompiling the kernel. + +As stated on the +http://www.postgresql.org/docs/8.1/interactive/kernel-resources.html +page, those values can be changed via sysctl or echoing values into +/proc, under linux at least. + +HTH, +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 7 15:34:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 9A72B9FA4E0 + for ; + Mon, 7 Aug 2006 15:34:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 35879-07 for + ; + Mon, 7 Aug 2006 15:34:43 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id F02C79FB200 + for ; + Mon, 7 Aug 2006 15:34:42 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k77IYfAm003796; + Mon, 7 Aug 2006 14:34:41 -0400 (EDT) +To: "Donald C. Sumbry ][" +cc: pgsql-performance@postgresql.org +Subject: Re: High Context-Switches on Linux 8.1.4 Server +In-reply-to: <44D7616D.6080906@revver.com> +References: <44D6EDFA.4030802@revver.com> <19629.1154955137@sss.pgh.pa.us> + <44D7616D.6080906@revver.com> +Comments: In-reply-to "Donald C. Sumbry ][" + message dated "Mon, 07 Aug 2006 08:51:09 -0700" +Date: Mon, 07 Aug 2006 14:34:41 -0400 +Message-ID: <3795.1154975681@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.143 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/80 +X-Sequence-Number: 20265 + +>> Is this from LWLock or spinlock contention? + +> Over a 20 second interval, I've got about 85 select()s and 6,230 +> semop()s. 2604 read()s vs 16 write()s. + +OK, so mostly LWLocks then. + +>> Do you have any long-running transactions, + +> Not long-running. We do have a badly behaving legacy app that is +> leaving some backends "idle in transaction" They're gone pretty quickly +> so I can't kill them fast enough, but running a pg_stat_activity will +> always show at least a handful. Could this be contributing? + +Sorry, I was unclear: it's the age of your oldest transaction that +counts (measured by how many xacts started since it), not how many +cycles it's consumed or not. + +With the 8.1 code it's possible for performance to degrade pretty badly +once the age of your oldest transaction exceeds 16K transactions. You +were not specific enough about the behavior of this legacy app to let +me guess where you are on that scale ... + +> Based on the number of semop's we're getting it does look like +> shared_memory may be getting thrased - any suggestions? We did try +> lowering shared_memory usage in half the previous day, + +Unlikely to help --- if it is the pg_subtrans problem, the number of +buffers involved is set by a compile-time constant. + + regards, tom lane + +From pgsql-novice-owner@postgresql.org Mon Aug 7 16:19:12 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B95B29FB200 + for ; + Mon, 7 Aug 2006 16:19:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 47098-08 for ; + Mon, 7 Aug 2006 16:18:59 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web31801.mail.mud.yahoo.com (web31801.mail.mud.yahoo.com + [68.142.207.64]) by postgresql.org (Postfix) with SMTP id 92E219FA68D + for ; Mon, 7 Aug 2006 16:18:58 -0300 (ADT) +Received: (qmail 43060 invoked by uid 60001); 7 Aug 2006 19:18:56 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=F3pPtd3GHXOm1sVFrXwGZqBsltQdZ4VubE+XgT7kPGTuBjKz4FWWQ+nmqZHkfNzyQvPAo6vdDmvAbvKHDD94WtI5odDyItn5vORKT5WWY9f9+xf6rGieYHXfwIdNvEJsEbKDGJZCtKAZOmYas+Hwjuiwv3HS6/j7tDNrpf1QUUw= + ; +Message-ID: <20060807191856.43058.qmail@web31801.mail.mud.yahoo.com> +Received: from [63.203.180.122] by web31801.mail.mud.yahoo.com via HTTP; + Mon, 07 Aug 2006 12:18:56 PDT +Date: Mon, 7 Aug 2006 12:18:56 -0700 (PDT) +From: Richard Broersma Jr +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +To: Saranya Sivakumar , + pgsqlnovice , + pgsqlperform +In-Reply-To: <20060807172825.52230.qmail@web51314.mail.yahoo.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.566 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS +X-Spam-Level: ** +X-Archive-Number: 200608/58 +X-Sequence-Number: 17273 + +> Thank you very much for the information. The SHMMAX was set to 33554432, and that's why it +> failed to start the postmaster. Thanks for the link to the kernel resources article. I guess +> changing these parameters would require recompiling the kernel. +> +> Is there any work around without changing these parameters to make maximum use of RAM? +> +> We got a new server now with 2GB RAM, but it also has the same value for SHMMAX. +> +> And I am trying the restore with the following conf +> sort_mem = 40960 (changed from 1024) +> shared_buffers = 3000 (changed from 64) +> max_connections = 128 (changed from 32) + +This is one of the best links that I can give you in addition to the Postgresql Kernel resource +link. +http://www.powerpostgresql.com/PerfList + +I am pretty much a beginner at resource tuning also. In fact, after googling for sources that +describe how to tune kernel parameters, the postgresql documents remains the best documents I've +found so far. + +I would be interested if anyone else on the list knows of any resources or books that have an in +depth discussion on methods/strategies to tune kernel parameters to maximized usage of system +resources and at the same time allow for harmonious sharing between various programs/services. + +Regards, + +Richard Broersma Jr. + +From pgsql-performance-owner@postgresql.org Mon Aug 7 16:24:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5BDBC9FA68D + for ; + Mon, 7 Aug 2006 16:24:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 47103-06 for + ; + Mon, 7 Aug 2006 16:23:51 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.revver.com (mail.revver.com [207.7.147.37]) + by postgresql.org (Postfix) with ESMTP id 6863E9FA2C7 + for ; + Mon, 7 Aug 2006 16:23:51 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.revver.com (Postfix) with ESMTP id 599FBB5C0B5; + Mon, 7 Aug 2006 12:23:50 -0700 (PDT) +Received: from mail.revver.com ([127.0.0.1]) + by localhost (neil.revver.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 26926-06; Mon, 7 Aug 2006 12:23:49 -0700 (PDT) +Received: from [192.168.1.11] (c-66-229-34-91.hsd1.ca.comcast.net + [66.229.34.91]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.revver.com (Postfix) with ESMTP id DC02FB5C09E; + Mon, 7 Aug 2006 12:23:49 -0700 (PDT) +Message-ID: <44D7942E.7050406@revver.com> +Date: Mon, 07 Aug 2006 12:27:42 -0700 +From: "Donald C. Sumbry ][" +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Tom Lane +CC: pgsql-performance@postgresql.org +Subject: Re: High Context-Switches on Linux 8.1.4 Server +References: <44D6EDFA.4030802@revver.com> <19629.1154955137@sss.pgh.pa.us> + <44D7616D.6080906@revver.com> <3795.1154975681@sss.pgh.pa.us> +In-Reply-To: <3795.1154975681@sss.pgh.pa.us> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at revver.com +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.033 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/82 +X-Sequence-Number: 20267 + +Tom Lane wrote: +> Sorry, I was unclear: it's the age of your oldest transaction that +> counts (measured by how many xacts started since it), not how many +> cycles it's consumed or not. + +> With the 8.1 code it's possible for performance to degrade pretty badly +> once the age of your oldest transaction exceeds 16K transactions. You +> were not specific enough about the behavior of this legacy app to let +> me guess where you are on that scale ... + +Understood. This legacy apps wraps every single transaction (even read +only ones) inside of BEGIN; END; blocks. We do about 90+ percent reads +to our database, and at 300+ queries a second that could quickly add up. + +Does this sound like we should investigate this area more? + +>> Based on the number of semop's we're getting it does look like +>> shared_memory may be getting thrased - any suggestions? We did try +>> lowering shared_memory usage in half the previous day, +> +> Unlikely to help --- if it is the pg_subtrans problem, the number of +> buffers involved is set by a compile-time constant. + +Interesting. One other thing to note, this application in particular +accounts for only 4 percent of total queries and if we disable the +application the database runs like a champ. The only other huge +variable I can think of is this app's gratuitous use of cursors. + +I haven't read too much about Postgres performance especially when +dealing with cursors, but could this be a variable? We are considering +modifying the app and removing all use of cursors and wonder if we're +wasting our time or not. + +Thanks for the help. + +-- +Sumbry][ + +From pgsql-performance-owner@postgresql.org Mon Aug 7 17:03:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 04D429FB273 + for ; + Mon, 7 Aug 2006 17:03:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 54056-09 for + ; + Mon, 7 Aug 2006 17:02:55 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.188]) + by postgresql.org (Postfix) with ESMTP id E74E69FB22F + for ; + Mon, 7 Aug 2006 17:02:54 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so1126033nfc + for ; + Mon, 07 Aug 2006 13:02:53 -0700 (PDT) +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:references; + b=sXtdCIXTlOezfof3QiIp4IzaiJw/iH94cFSQ8qnDtXkSbC8hEGuX5jdx1RtVSfhoq/BQc0YoDDtlsixdHfyCjL1mUDOVSTfH1/hgD7jALyBV0024T/1HOg0c/IRpGvovDIu3nVPkpG0oL3eVTv6mzw9NaqG1XYZx3jcjV3b2BfQ= +Received: by 10.78.150.7 with SMTP id x7mr2507721hud; + Mon, 07 Aug 2006 13:02:52 -0700 (PDT) +Received: by 10.78.140.12 with HTTP; Mon, 7 Aug 2006 13:02:52 -0700 (PDT) +Message-ID: <33c6269f0608071302h6429cfcn71074709c5cd53ff@mail.gmail.com> +Date: Mon, 7 Aug 2006 16:02:52 -0400 +From: "Alex Turner" +To: "Markus Schaber" +Subject: Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44D72D11.7050203@logix-tt.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_79917_28853215.1154980972903" +References: <7F10D26ECFA1FB458B89C5B4B0D72C2B4E4D9B@sesrv12.wirelesscar.com> + + <44D72D11.7050203@logix-tt.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=HTML_30_40, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/83 +X-Sequence-Number: 20268 + +------=_Part_79917_28853215.1154980972903 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Although I for one have yet to see a controller that actualy does this (I +believe software RAID on linux doesn't either). + +Alex. + +On 8/7/06, Markus Schaber wrote: +> +> Hi, Charles, +> +> Charles Sprickman wrote: +> +> > I've also got a 1U with a 9500SX-4 and 4 drives. I like how the 3Ware +> > card scales there - started with 2 drives and got "drive speed" +> > mirroring. Added two more and most of the bonnie numbers doubled. This +> > is not what I'm used to with the Adaptec SCSI junk. +> +> Well, for sequential reading, you should be able to get double drive +> speed on a 2-disk mirror with a good controller, as it can balance the +> reads among the drives. +> +> Markus +> -- +> Markus Schaber | Logical Tracking&Tracing International AG +> Dipl. Inf. | Software Development GIS +> +> Fight against software patents in EU! www.ffii.org +> www.nosoftwarepatents.org +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + +------=_Part_79917_28853215.1154980972903 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Although I for one have yet to see a controller that actualy does this (I believe software RAID on linux doesn't either).

Alex.

On 8/7/06, Markus Schaber + <schabi@logix-tt.com> wrote:
Hi, Charles, +

Charles Sprickman wrote:

> I've also got a 1U with a 9500SX-4 and 4 drives.  I like how the 3Ware
> card scales there - started with 2 drives and got "drive speed"
> mirroring. Added two more and most of the bonnie numbers doubled.  This +
> is not what I'm used to with the Adaptec SCSI junk.

Well, for sequential reading, you should be able to get double drive
speed on a 2-disk mirror with a good controller, as it can balance the
reads among the drives. +

Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org + www.nosoftwarepatents.org

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to +
       choose an index scan if your joining column's datatypes do not
       match

+ +------=_Part_79917_28853215.1154980972903-- + +From pgsql-novice-owner@postgresql.org Mon Aug 7 17:07:56 2006 +X-Original-To: pgsql-novice-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 053A49FB22F + for ; + Mon, 7 Aug 2006 17:07:56 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 61792-01 for ; + Mon, 7 Aug 2006 17:07:44 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from web51315.mail.yahoo.com (web51315.mail.yahoo.com + [206.190.39.125]) + by postgresql.org (Postfix) with SMTP id D994D9FB273 + for ; Mon, 7 Aug 2006 17:07:41 -0300 (ADT) +Received: (qmail 93956 invoked by uid 60001); 7 Aug 2006 20:07:40 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; + h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=04H89KAB/1J/pXgDXh898p5uEqg+nBJKcL/2VysEG9tb97aPAtJTCB8A6i9sHRLnHk72iwV0Dl0RjbmLbQSKAFlFWdnPlAzDRcMnWjCAsyRgXB1OzvHYH6gz1sMTnhB6t2rakzBx22KxiS111B2+CoanKqNs5IEtfDMAhTvkWzE= + ; +Message-ID: <20060807200740.93954.qmail@web51315.mail.yahoo.com> +Received: from [216.199.70.171] by web51315.mail.yahoo.com via HTTP; + Mon, 07 Aug 2006 13:07:40 PDT +Date: Mon, 7 Aug 2006 13:07:40 -0700 (PDT) +From: Saranya Sivakumar +Subject: Re: [PERFORM] 7.3.2 pg_restore very slow +To: Richard Broersma Jr , + pgsqlnovice , + pgsqlperform +In-Reply-To: <20060807191856.43058.qmail@web31801.mail.mud.yahoo.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-152457407-1154981260=:92206" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.43 tagged_above=0 required=5 tests=AWL, BE_BOSS, + DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, HTML_MESSAGE +X-Spam-Level: *** +X-Archive-Number: 200608/59 +X-Sequence-Number: 17274 + +--0-152457407-1154981260=:92206 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +Hi All, + + Thanks Richard for the additional link. The information is very useful. + + The restore completed successfully in 2.5 hours in the new 2GB box, with the same configuration parameters. I think if I can tweak the parameters a little more, I should be able to get it down to the 1 hr down time that we can afford. + + Thanks again for all the help. + + Sincerely, + Saranya + +Richard Broersma Jr wrote: + > Thank you very much for the information. The SHMMAX was set to 33554432, and that's why it +> failed to start the postmaster. Thanks for the link to the kernel resources article. I guess +> changing these parameters would require recompiling the kernel. +> +> Is there any work around without changing these parameters to make maximum use of RAM? +> +> We got a new server now with 2GB RAM, but it also has the same value for SHMMAX. +> +> And I am trying the restore with the following conf +> sort_mem = 40960 (changed from 1024) +> shared_buffers = 3000 (changed from 64) +> max_connections = 128 (changed from 32) + +This is one of the best links that I can give you in addition to the Postgresql Kernel resource +link. +http://www.powerpostgresql.com/PerfList + +I am pretty much a beginner at resource tuning also. In fact, after googling for sources that +describe how to tune kernel parameters, the postgresql documents remains the best documents I've +found so far. + +I would be interested if anyone else on the list knows of any resources or books that have an in +depth discussion on methods/strategies to tune kernel parameters to maximized usage of system +resources and at the same time allow for harmonious sharing between various programs/services. + +Regards, + +Richard Broersma Jr. + + + +--------------------------------- +Want to be your own boss? Learn how on Yahoo! Small Business. +--0-152457407-1154981260=:92206 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + +
Hi All,
 
Thanks Richard for the additional link. The information is very useful.
 
The restore completed successfully in 2.5 hours in the new 2GB box, with the same configuration parameters. I think if I can tweak the parameters a little more, I should be able to get it down to the 1 hr down time  that we can afford.
 
Thanks again for all the help.
 
Sincerely,
Saranya

Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> Thank you very much for the information. The SHMMAX was set to 33554432, and that's why it
> failed to start the postmaster. Thanks for the link to the kernel resources article. I guess
> changing these parameters would require recompiling the kernel.
> +
> Is there any work around without changing these parameters to make maximum use of RAM?
>
> We got a new server now with 2GB RAM, but it also has the same value for SHMMAX.
>
> And I am trying the restore with the following conf
> sort_mem = 40960 (changed from 1024)
> shared_buffers = 3000 (changed from 64)
> max_connections = 128 (changed from 32)

This is one of the best links that I can give you in addition to the Postgresql Kernel resource
link.
http://www.powerpostgresql.com/PerfList

I am pretty much a beginner at resource tuning also. In fact, after googling for sources that
describe how to tune kernel parameters, the postgresql documents remains the best documents I've
found so far.

I would be interested if anyone else on the list knows of any resources or books that have an in
depth discussion on methods/strategies to tune kernel parameters to maximized usage of + system
resources and at the same time allow for harmonious sharing between various programs/services.

Regards,

Richard Broersma Jr.

+ + +


Want to be your own boss? Learn how on Yahoo! Small Business. + +--0-152457407-1154981260=:92206-- + +From pgsql-performance-owner@postgresql.org Mon Aug 7 17:20:16 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D9A599FB202 + for ; + Mon, 7 Aug 2006 17:20:15 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 06765-07 for + ; + Mon, 7 Aug 2006 20:20:06 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from cassarossa.samfundet.no (cassarossa.samfundet.no + [129.241.93.19]) + by postgresql.org (Postfix) with ESMTP id 976129FB1EF + for ; + Mon, 7 Aug 2006 17:20:05 -0300 (ADT) +Received: from [2001:700:300:dc0f:216:3eff:fe40:5a47] (helo=trofast.sesse.net) + by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1GABZy-0002Q2-JE + for pgsql-performance@postgresql.org; Mon, 07 Aug 2006 22:20:03 +0200 +Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) + id 1GABZy-0001vW-00 + for ; Mon, 07 Aug 2006 22:20:02 +0200 +Date: Mon, 7 Aug 2006 22:20:02 +0200 +From: "Steinar H. Gunderson" +To: pgsql-performance@postgresql.org +Subject: Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig +Message-ID: <20060807202002.GA7380@uio.no> +Mail-Followup-To: pgsql-performance@postgresql.org +References: <7F10D26ECFA1FB458B89C5B4B0D72C2B4E4D9B@sesrv12.wirelesscar.com> + + <44D72D11.7050203@logix-tt.com> + <33c6269f0608071302h6429cfcn71074709c5cd53ff@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +In-Reply-To: <33c6269f0608071302h6429cfcn71074709c5cd53ff@mail.gmail.com> +X-Operating-System: Linux 2.6.16trofastxen on a x86_64 +X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/85 +X-Sequence-Number: 20270 + +On Mon, Aug 07, 2006 at 04:02:52PM -0400, Alex Turner wrote: +> Although I for one have yet to see a controller that actualy does this (I +> believe software RAID on linux doesn't either). + +Linux' software RAID does. See earlier threads for demonstrations. + +/* Steinar */ +-- +Homepage: http://www.sesse.net/ + +From pgsql-performance-owner@postgresql.org Mon Aug 7 19:26:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6F1F09FB345 + for ; + Mon, 7 Aug 2006 19:26:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 55608-09 for + ; + Mon, 7 Aug 2006 22:26:29 +0000 (UTC) +X-Greylist: delayed 00:19:57.422222 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 3EE749FB35B + for ; + Mon, 7 Aug 2006 19:26:29 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from pelego.atua.com.br (unknown [200.248.138.61]) + by svr4.postgresql.org (Postfix) with ESMTP id C86BE5AF042 + for ; + Mon, 7 Aug 2006 22:06:28 +0000 (GMT) +Received: from [10.0.0.171] (bagual.atua.com.br [200.248.138.60]) + by pelego.atua.com.br (Postfix) with ESMTP id 5D29513F660 + for ; + Mon, 7 Aug 2006 19:06:13 -0300 (BRT) +Message-ID: <44D7B958.6030004@atua.com.br> +Date: Mon, 07 Aug 2006 19:06:16 -0300 +From: Alvaro Nunes Melo +User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060725) +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Hardware upgraded but performance still ain't good enough +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/86 +X-Sequence-Number: 20271 + +Hi, + +First of all I must tell that my reality in a southern brazilian city is +way different than what we read in the list. I was lookig for ways to +find the HW bottleneck and saw a configuration like: + +"we recently upgraded our dual Xeon Dell to a brand new Sun v40z with 4 +opterons, 16GB of memory and MegaRAID with enough disks. OS is Debian +Sarge amd64, PostgreSQL is 8.0.3." on +(http://archives.postgresql.org/pgsql-performance/2005-07/msg00431.php) + +Our old server was a very modest Dell Xeon 2.8 (512 Kb Cache), with 1 GB +RAM and one SCSI disc. This server runs PostgreSQL (8.1.4), Apache (PHP) +and other minor services. We managed to get a test machine, a HP Xeon +3.2 (2 MB cache), also with 1 GB RAM but 4 SCSI discs (in one sigle +array controller). They're organized in the following way: + +disk 0: Linux Root +disk 1: Database Cluster +disk 2: pg_xlog +disk 3: a dir the suffers constant read/write operations + +The database size stands around 10 GB. The new server has a better +performance than the old one, but sometimes it still stucks. We tried to +use a HP proprietary tool to monitor the server, and find out what is +the bottleneck, but it's been difficult to install it on Debian. The +tool is only certified for SuSe and RedHat. So we tried to use some +Linux tools to see what's going on, like vmstat and iostat. Are this +tools (vm and iostat) enough? Should we use something else? Is there any +specifical material about finding bottlenecks in Linux/PostgreSQL +machines? Is our disks design proper? + +I really apologize for my lack of knowledge in this area, and for the +excessive number of questions in a single e-mail. + +Best regards, +Alvaro + +From pgsql-performance-owner@postgresql.org Mon Aug 7 22:11:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8C7A79FA5F3 + for ; + Mon, 7 Aug 2006 22:11:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 27283-02 for + ; + Mon, 7 Aug 2006 22:11:13 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id C35829FB32F + for ; + Mon, 7 Aug 2006 22:11:13 -0300 (ADT) +Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Mon, 07 Aug 2006 21:10:59 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 7 Aug + 2006 21:10:44 -0400 +Received: from 63.80.24.130 ([63.80.24.130]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.134]) with Microsoft Exchange Server HTTP-DAV ; Tue, 8 Aug + 2006 01:10:43 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Mon, 07 Aug 2006 18:10:41 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: steve.poe@gmail.com, + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and + SmartArray 642 +Thread-Index: Aca6h3c1tZCZ/CZ6Edu9MAAWy4o9DA== +In-Reply-To: <1154819438.15224.24.camel@amd64-gentoo-laptop> +MIME-Version: 1.0 +X-OriginalArrivalTime: 08 Aug 2006 01:10:44.0152 (UTC) + FILETIME=[7916B380:01C6BA87] +X-WSS-ID: 68C93B293785561158-07-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.525 tagged_above=0 required=5 tests=AWL, + RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/88 +X-Sequence-Number: 20273 + +Steve, + +On 8/5/06 4:10 PM, "Steve Poe" wrote: + +> I am do some consulting for an animal hospital in the Boston, MA area. +> They wanted a new server to run their database on. The client wants +> everything from one vendor, they wanted Dell initially, I'd advised +> against it. I recommended a dual Opteron system from either Sun or HP. +> They settled on a DL385 8GB of RAM with two disc U320 SCSI and a 6-disc +> U320 SCSI array. I recommended they add a RAID adapter with at 128MB and +> battery backup, they added a HP SmartArray 642 to connect to the drive +> array in addition to the SmartArray 6i which came with the server. +> +> Has anyone worked with server before. I've read the SmartArray 6i is a +> poor performer, I wonder if the SmartArray 642 adapter would have the +> same fate? +> +> The database data is on the drive array(RAID10) and the pg_xlog is on +> the internal RAID1 on the 6i controller. The results have been poor. +> +> My guess is the controllers are garbage. + +Can you run bonnie++ version 1.03a on the machine and report the results +here? + +It could be OK if you have the latest Linux driver for cciss, someone has +reported good results to this list with the latest, bleeding edge version of +Linux (2.6.17). + +- Luke + + + +From pgsql-performance-owner@postgresql.org Mon Aug 7 22:46:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E03309FB1E4 + for ; + Mon, 7 Aug 2006 22:46:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28505-04 for + ; + Mon, 7 Aug 2006 22:46:37 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.189]) + by postgresql.org (Postfix) with ESMTP id B78559F9B55 + for ; + Mon, 7 Aug 2006 22:46:37 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id a27so44954nfc + for ; + Mon, 07 Aug 2006 18:46:35 -0700 (PDT) +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:references; + b=ZfowRlcw+9D5vO/Msv3ty+oWa9LpcC2WXADO7hL6zft0lp+yG35C3DppvMphssLvKdeNA6VzYrVhiiJKbNN8NGoKKRTLOwg9BhIBrzPlhmRGzVx1SE42kX/EO49i8SFXdUV+TZg/OykxFtFxwE/ZM3TN0NH4D2iO0JtVUSwP2+c= +Received: by 10.78.142.14 with SMTP id p14mr2576496hud; + Mon, 07 Aug 2006 18:46:34 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Mon, 7 Aug 2006 18:46:34 -0700 (PDT) +Message-ID: <721b21dc0608071846q2128d478tab94b76dbc549a26@mail.gmail.com> +Date: Mon, 7 Aug 2006 18:46:34 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_209252_31644395.1155001594867" +References: <1154819438.15224.24.camel@amd64-gentoo-laptop> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.188 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_MESSAGE, NORMAL_HTTP_TO_IP, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/89 +X-Sequence-Number: 20274 + +------=_Part_209252_31644395.1155001594867 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +I'll do that then post the results. I ran zcav on it (default settlings) on +the disc array formatted XFS and its peak MB/s was around 85-90. I am using +kernel 2.6.17.7. mounting the disc array with noatime, nodiratime. + +Thanks for your feedback. + +Steve + +On 8/7/06, Luke Lonergan wrote: +> +> Steve, +> +> On 8/5/06 4:10 PM, "Steve Poe" wrote: +> +> > I am do some consulting for an animal hospital in the Boston, MA area. +> > They wanted a new server to run their database on. The client wants +> > everything from one vendor, they wanted Dell initially, I'd advised +> > against it. I recommended a dual Opteron system from either Sun or HP. +> > They settled on a DL385 8GB of RAM with two disc U320 SCSI and a 6-disc +> > U320 SCSI array. I recommended they add a RAID adapter with at 128MB and +> > battery backup, they added a HP SmartArray 642 to connect to the drive +> > array in addition to the SmartArray 6i which came with the server. +> > +> > Has anyone worked with server before. I've read the SmartArray 6i is a +> > poor performer, I wonder if the SmartArray 642 adapter would have the +> > same fate? +> > +> > The database data is on the drive array(RAID10) and the pg_xlog is on +> > the internal RAID1 on the 6i controller. The results have been poor. +> > +> > My guess is the controllers are garbage. +> +> Can you run bonnie++ version 1.03a on the machine and report the results +> here? +> +> It could be OK if you have the latest Linux driver for cciss, someone has +> reported good results to this list with the latest, bleeding edge version +> of +> Linux (2.6.17). +> +> - Luke +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + +------=_Part_209252_31644395.1155001594867 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,
+
+I'll do that then post the results. I ran zcav on it (default +settlings) on the disc array formatted XFS and its peak MB/s was around +85-90.  I am using kernel 2.6.17.7. mounting the disc array with +noatime, nodiratime.

+Thanks for your feedback.
+
+Steve
+
On 8/7/06, Luke Lonergan <llonergan@greenplum.com> wrote:
+Steve,

On 8/5/06 4:10 PM, "Steve Poe" <steve.poe@gmail.com> wrote:

> I am do some consulting for an animal hospital in the Boston, MA area.
> They wanted a new server to run their database on. The client wants +
> everything from one vendor, they wanted Dell initially, I'd advised
> against it. I recommended a dual Opteron system from either Sun or HP.
> They settled on a DL385 8GB of RAM with two disc U320 SCSI and a 6-disc +
> U320 SCSI array. I recommended they add a RAID adapter with at 128MB and
> battery backup, they added a HP SmartArray 642 to connect to the drive
> array in addition to the SmartArray 6i which came with the server. +
>
> Has anyone worked with server before. I've read the SmartArray 6i is a
> poor performer, I wonder if the SmartArray 642 adapter would have the
> same fate?
>
> The database data is on the drive array(RAID10) and the pg_xlog is on +
> the internal RAID1 on the 6i controller. The results have been poor.
>
> My guess is the controllers are garbage.

Can you run bonnie++ version 1.03a on the machine and report the results
here? +

It could be OK if you have the latest Linux driver for cciss, someone has
reported good results to this list with the latest, bleeding edge version of
Linux (2.6.17).

- Luke



---------------------------(end of broadcast)--------------------------- +
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

+ +------=_Part_209252_31644395.1155001594867-- + +From pgsql-performance-owner@postgresql.org Mon Aug 7 23:19:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D4DF99FB21F + for ; + Mon, 7 Aug 2006 23:19:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 31882-02 for + ; + Mon, 7 Aug 2006 23:19:17 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 6340F9F9B55 + for ; + Mon, 7 Aug 2006 23:19:17 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k782JExU028005 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Mon, 7 Aug 2006 19:19:17 -0700 +Message-ID: <44D7F49C.9000601@commandprompt.com> +Date: Mon, 07 Aug 2006 19:19:08 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Luke Lonergan +CC: steve.poe@gmail.com, pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +References: +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 07 Aug 2006 19:19:18 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.189 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/90 +X-Sequence-Number: 20275 + + +>> The database data is on the drive array(RAID10) and the pg_xlog is on +>> the internal RAID1 on the 6i controller. The results have been poor. + +I have heard that the 6i was actually decent but to avoid the 5i. + +Joshua D. Drake + + +>> +>> My guess is the controllers are garbage. +> +> Can you run bonnie++ version 1.03a on the machine and report the results +> here? +> +> It could be OK if you have the latest Linux driver for cciss, someone has +> reported good results to this list with the latest, bleeding edge version of +> Linux (2.6.17). +> +> - Luke +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Mon Aug 7 23:28:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id B5D5B9FB21F + for ; + Mon, 7 Aug 2006 23:28:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 60155-08 for + ; + Tue, 8 Aug 2006 02:28:49 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) + by postgresql.org (Postfix) with ESMTP id D7F709F9B55 + for ; + Mon, 7 Aug 2006 23:28:48 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so271586ugc + for ; + Mon, 07 Aug 2006 19:28:46 -0700 (PDT) +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:references; + b=cHjreBk4S+uBmca7IeGaiEVVkPoW3qdahGf7Bn43L32tSakV2k5wwRt/bxY+mSI0Hwx3RXLH14tFheblB3KDsWkHLz/RaWSSJmxBwLP7WhDOMHYR8oyasGnQtbDDbcCkV0uJfA3wLBwEUPdb4o2oMqRgSjuYEaDEHW2mYBi95sU= +Received: by 10.78.147.3 with SMTP id u3mr2577253hud; + Mon, 07 Aug 2006 19:28:46 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Mon, 7 Aug 2006 19:28:46 -0700 (PDT) +Message-ID: <721b21dc0608071928ve091390p1cf8226c62efd4@mail.gmail.com> +Date: Mon, 7 Aug 2006 19:28:46 -0700 +From: "Steve Poe" +To: "Joshua D. Drake" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Luke Lonergan" , + pgsql-performance@postgresql.org +In-Reply-To: <44D7F49C.9000601@commandprompt.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_209972_32723395.1155004126090" +References: + <44D7F49C.9000601@commandprompt.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.574 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/91 +X-Sequence-Number: 20276 + +------=_Part_209972_32723395.1155004126090 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +There is 64MB on the 6i and 192MB on the 642 controller. I wish the +controllers had a "wrieback" enable option like the LSI MegaRAID adapters +have. I have tried splitting the cache accelerator 25/75 75/25 0/100 100/0 +but the results really did not improve. + +Steve + +On 8/7/06, Joshua D. Drake wrote: +> +> +> >> The database data is on the drive array(RAID10) and the pg_xlog is on +> >> the internal RAID1 on the 6i controller. The results have been poor. +> +> I have heard that the 6i was actually decent but to avoid the 5i. +> +> Joshua D. Drake +> +> +> >> +> >> My guess is the controllers are garbage. +> > +> > Can you run bonnie++ version 1.03a on the machine and report the results +> > here? +> > +> > It could be OK if you have the latest Linux driver for cciss, someone +> has +> > reported good results to this list with the latest, bleeding edge +> version of +> > Linux (2.6.17). +> > +> > - Luke +> > +> > +> > +> > ---------------------------(end of broadcast)--------------------------- +> > TIP 9: In versions below 8.0, the planner will ignore your desire to +> > choose an index scan if your joining column's datatypes do not +> > match +> > +> +> +> -- +> +> === The PostgreSQL Company: Command Prompt, Inc. === +> Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 +> Providing the most comprehensive PostgreSQL solutions since 1997 +> http://www.commandprompt.com/ +> +> +> + +------=_Part_209972_32723395.1155004126090 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +There is 64MB on the 6i and 192MB on the 642 controller. I wish the +controllers had a "wrieback" enable option like the LSI MegaRAID +adapters have. I have tried splitting the cache accelerator 25/75 75/25 +0/100 100/0 but the results really did not improve.
+
+Steve

On 8/7/06, Joshua D. Drake <jd@commandprompt.com> wrote:
+
>> The database data is on the drive array(RAID10) and the pg_xlog is on
>> the internal RAID1 on the 6i controller. The results have been poor.

I have heard that the 6i was actually decent but to avoid the 5i. +

Joshua D. Drake


>>
>> My guess is the controllers are garbage.
>
> Can you run bonnie++ version 1.03a on the machine and report the results
> here?
>
> It could be OK if you have the latest Linux driver for cciss, someone has +
> reported good results to this list with the latest, bleeding edge version of
> Linux (2.6.17).
>
> - Luke
>
>
>
> ---------------------------(end of broadcast)--------------------------- +
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>


--

    === The PostgreSQL Company: Command Prompt, Inc. === +
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
    Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/ +



+ +------=_Part_209972_32723395.1155004126090-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 01:13:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 03D4A9FB299 + for ; + Tue, 8 Aug 2006 01:13:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 06975-02 for + ; + Tue, 8 Aug 2006 04:13:40 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.183]) + by postgresql.org (Postfix) with ESMTP id 43B0C9FB28D + for ; + Tue, 8 Aug 2006 01:13:40 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id n25so331941pyg + for ; + Mon, 07 Aug 2006 21:13:39 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:subject:from:reply-to:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=bj+/9/opSNDo+2oiG/pDnbXETlfdjRbWpCeTyEVKnamiydPIv/TekEdXUFtMnCMpl63GxcqYdPNi8TV55NAa32IW10Vg/BepmuMGHjADSfzHnFjERcjV00bA23GUWHXMUa4wNPSskQ6XNm0l3ZJbWMu+tlknyy2CQx3tGeggpOQ= +Received: by 10.65.237.15 with SMTP id o15mr9407661qbr; + Mon, 07 Aug 2006 21:13:38 -0700 (PDT) +Received: from amd64-gentoo-laptop ( [66.167.78.2]) + by mx.gmail.com with ESMTP id 22sm3223230nzn.2006.08.07.21.13.37; + Mon, 07 Aug 2006 21:13:38 -0700 (PDT) +Subject: Re: Postgresql Performance on an HP DL385 and +From: Steve Poe +Reply-To: steve.poe@gmail.com +To: Luke Lonergan +Cc: pgsql-performance@postgresql.org +In-Reply-To: +References: +Content-Type: text/plain +Date: Mon, 07 Aug 2006 21:13:36 -0700 +Message-Id: <1155010416.17773.1.camel@amd64-gentoo-laptop> +Mime-Version: 1.0 +X-Mailer: Evolution 2.4.2.1 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/92 +X-Sequence-Number: 20277 + +Luke, + +Here are the results of two runs of 16GB file tests on XFS. + +scsi disc array +xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8 +scsi disc array +xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6 + +Thanks. + +Steve + + + +> Can you run bonnie++ version 1.03a on the machine and report the results +> here? +> +> It could be OK if you have the latest Linux driver for cciss, someone has +> reported good results to this list with the latest, bleeding edge version of +> Linux (2.6.17). +> +> - Luke +> + + +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 03:33:52 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4AC209FB22B + for ; + Tue, 8 Aug 2006 03:33:50 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 35218-02 for + ; + Tue, 8 Aug 2006 06:33:42 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.190]) + by postgresql.org (Postfix) with ESMTP id BF0F39FB221 + for ; + Tue, 8 Aug 2006 03:33:41 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so119529nfc + for ; + Mon, 07 Aug 2006 23:33:40 -0700 (PDT) +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:references; + b=hsE/yqS6Rhc81h7iYS38RP+AsgvX7kcULdTGOgAhIA/IbuawUKMJm+cGM8mkzLUTC2slZABXFfhvhPjBnSJfkFDscFQdowgeYq/roSqMlYNpQjalSt5uU9RwWE5wOJCkM2mc+vdGBj5kJ0SFsWbZjQXcAWv1ao9n3ZoeNJZmMJg= +Received: by 10.78.177.3 with SMTP id z3mr2620035hue; + Mon, 07 Aug 2006 23:33:39 -0700 (PDT) +Received: by 10.78.140.12 with HTTP; Mon, 7 Aug 2006 23:33:39 -0700 (PDT) +Message-ID: <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +Date: Tue, 8 Aug 2006 02:33:39 -0400 +From: "Alex Turner" +To: "Alvaro Nunes Melo" +Subject: Re: Hardware upgraded but performance still ain't good enough +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44D7B958.6030004@atua.com.br> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_3223_5915483.1155018819645" +References: <44D7B958.6030004@atua.com.br> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.351 tagged_above=0 required=5 tests=HTML_10_20, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/93 +X-Sequence-Number: 20278 + +------=_Part_3223_5915483.1155018819645 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +First off - very few third party tools support debian. Debian is a sure +fire way to have an unsupported system. Use RedHat or SuSe (flame me all +you want, it doesn't make it less true). + +Second, run bonnie++ benchmark against your disk array(s) to see what +performance you are getting, and make sure it's reasonable. + +Single drives for stuff is not a great way to go for either speed or +reliability, highly not recommended for a production system. Use SAS or +SATA for the best speed for your $$s, don't buy SAN, they are overpriced and +often don't perform. RAM could be more to be honest too. + +Diagnosing the bottleneck can be done with combinations of top, iostat and +vmstat. If you have high iowait numbers then your system is waiting on the +disks. If you have high system CPU usage, then disks are also worth a look, +but not as bad as high iowait. If you have high user CPU with little iowait +and little system CPU, and very little io activity in iostat, then you are +CPU bound. If you are IO bound, you need to figure if it's reads or +writes. If it's reads, then more RAM will help. if it's writes, then you +need more spindles and more controller cache with RAID (please think +carefully before using RAID 5 in a write intensive environment, it's not +ideal). + +The other thing is you will probably want to turn on stats in postgres to +figure out which queries are the bad ones (does anyone have good docs posted +for this?). Once you have identified the bad queries, you can explain +analyze them, and figure out why they suck. + +Alex. + +On 8/7/06, Alvaro Nunes Melo wrote: +> +> Hi, +> +> First of all I must tell that my reality in a southern brazilian city is +> way different than what we read in the list. I was lookig for ways to +> find the HW bottleneck and saw a configuration like: +> +> "we recently upgraded our dual Xeon Dell to a brand new Sun v40z with 4 +> opterons, 16GB of memory and MegaRAID with enough disks. OS is Debian +> Sarge amd64, PostgreSQL is 8.0.3." on +> (http://archives.postgresql.org/pgsql-performance/2005-07/msg00431.php) +> +> Our old server was a very modest Dell Xeon 2.8 (512 Kb Cache), with 1 GB +> RAM and one SCSI disc. This server runs PostgreSQL (8.1.4), Apache (PHP) +> and other minor services. We managed to get a test machine, a HP Xeon +> 3.2 (2 MB cache), also with 1 GB RAM but 4 SCSI discs (in one sigle +> array controller). They're organized in the following way: +> +> disk 0: Linux Root +> disk 1: Database Cluster +> disk 2: pg_xlog +> disk 3: a dir the suffers constant read/write operations +> +> The database size stands around 10 GB. The new server has a better +> performance than the old one, but sometimes it still stucks. We tried to +> use a HP proprietary tool to monitor the server, and find out what is +> the bottleneck, but it's been difficult to install it on Debian. The +> tool is only certified for SuSe and RedHat. So we tried to use some +> Linux tools to see what's going on, like vmstat and iostat. Are this +> tools (vm and iostat) enough? Should we use something else? Is there any +> specifical material about finding bottlenecks in Linux/PostgreSQL +> machines? Is our disks design proper? +> +> I really apologize for my lack of knowledge in this area, and for the +> excessive number of questions in a single e-mail. +> +> Best regards, +> Alvaro +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + +------=_Part_3223_5915483.1155018819645 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +First off - very few third party tools support debian.  Debian is a sure fire way to have an unsupported system.  Use RedHat or SuSe (flame me all you want, it doesn't make it less true).

Second, run bonnie++ benchmark against your disk array(s) to see what performance you are getting, and make sure it's reasonable. +

Single drives for stuff is not a great way to go for either speed or reliability, highly not recommended for a production system.  Use SAS or SATA for the best speed for your $$s, don't buy SAN, they are overpriced and often don't perform.  RAM could be more to be honest too. +

Diagnosing the bottleneck can be done with combinations of top, iostat and vmstat.  If you have high iowait numbers then your system is waiting on the disks.  If you have high system CPU usage, then disks are also worth a look, but not as bad as high iowait.  If you have high user CPU with little iowait and little system CPU, and very little io activity in iostat, then you are CPU bound.  If you are IO bound, you need to figure if it's reads or writes.  If it's reads, then more RAM will help.  if it's writes, then you need more spindles and more controller cache with RAID (please think carefully before using RAID 5 in a write intensive environment, it's not ideal). +

The other thing is you will probably want to turn on stats in postgres to figure out which queries are the bad ones (does anyone have good docs posted for this?).  Once you have identified the bad queries, you can explain analyze them, and figure out why they suck. +

Alex.

On 8/7/06, Alvaro Nunes Melo <al_nunes@atua.com.br> wrote:
+Hi,

First of all I must tell that my reality in a southern brazilian city is
way different than what we read in the list. I was lookig for ways to
find the HW bottleneck and saw a configuration like:

"we recently upgraded our dual Xeon Dell to a brand new Sun v40z with 4 +
opterons, 16GB of memory and MegaRAID with enough disks. OS is Debian
Sarge amd64, PostgreSQL is 8.0.3." on
(http://archives.postgresql.org/pgsql-performance/2005-07/msg00431.php +)

Our old server was a very modest Dell Xeon 2.8 (512 Kb Cache), with 1 GB
RAM and one SCSI disc. This server runs PostgreSQL (8.1.4), Apache (PHP)
and other minor services. We managed to get a test machine, a HP Xeon +
3.2 (2 MB cache), also with 1 GB RAM but 4 SCSI discs (in one sigle
array controller). They're organized in the following way:

disk 0: Linux Root
disk 1: Database Cluster
disk 2: pg_xlog
disk 3: a dir the suffers constant read/write operations +

The database size stands around 10 GB. The new server has a better
performance than the old one, but sometimes it still stucks. We tried to
use a HP proprietary tool to monitor the server, and find out what is +
the bottleneck, but it's been difficult to install it on Debian. The
tool is only certified for SuSe and RedHat. So we tried to use some
Linux tools to see what's going on, like vmstat and iostat. Are this
tools (vm and iostat) enough? Should we use something else? Is there any +
specifical material about finding bottlenecks in Linux/PostgreSQL
machines? Is our disks design proper?

I really apologize for my lack of knowledge in this area, and for the
excessive number of questions in a single e-mail. +

Best regards,
Alvaro

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not +
       match

+ +------=_Part_3223_5915483.1155018819645-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 03:40:51 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4B8AA9FB281 + for ; + Tue, 8 Aug 2006 03:40:50 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 37501-01 for + ; + Tue, 8 Aug 2006 06:40:42 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.187]) + by postgresql.org (Postfix) with ESMTP id 29E469FB278 + for ; + Tue, 8 Aug 2006 03:40:40 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so121535nfc + for ; + Mon, 07 Aug 2006 23:40:39 -0700 (PDT) +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:references; + b=YrMvWvztCk2V6TPCcx0yabAoQ3o1SGIDtJxyW6hgT+vC7edN30b7QVzoUxunrR3JcUfaudWz7OzLAJJ4VzEDDohJfONPDcDBOJs9w+NLvFoaw0WIFZkv17KPJTn9uQA4EU7beN+4s8dPIhwzkP+j2TNs52Y36KlkNintAE10X8w= +Received: by 10.78.142.14 with SMTP id p14mr2627113hud; + Mon, 07 Aug 2006 23:40:39 -0700 (PDT) +Received: by 10.78.140.12 with HTTP; Mon, 7 Aug 2006 23:40:39 -0700 (PDT) +Message-ID: <33c6269f0608072340r7c2a6849i48eae3ea393e00d4@mail.gmail.com> +Date: Tue, 8 Aug 2006 02:40:39 -0400 +From: "Alex Turner" +To: steve.poe@gmail.com +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Luke Lonergan" , + pgsql-performance@postgresql.org +In-Reply-To: <1155010416.17773.1.camel@amd64-gentoo-laptop> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_3279_24692865.1155019239552" +References: + <1155010416.17773.1.camel@amd64-gentoo-laptop> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.574 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/94 +X-Sequence-Number: 20279 + +------=_Part_3279_24692865.1155019239552 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +These number are pretty darn good for a four disk RAID 10, pretty close to +perfect infact. Nice advert for the 642 - I guess we have a Hardware RAID +controller than will read indpendently from mirrors. + +Alex + +On 8/8/06, Steve Poe wrote: +> +> Luke, +> +> Here are the results of two runs of 16GB file tests on XFS. +> +> scsi disc array +> xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1 +> ,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8 +> scsi disc array +> xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1 +> ,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6 +> +> Thanks. +> +> Steve +> +> +> +> > Can you run bonnie++ version 1.03a on the machine and report the results +> > here? +> > +> > It could be OK if you have the latest Linux driver for cciss, someone +> has +> > reported good results to this list with the latest, bleeding edge +> version of +> > Linux (2.6.17). +> > +> > - Luke +> > +> +> +> > +> > +> > ---------------------------(end of broadcast)--------------------------- +> > TIP 9: In versions below 8.0, the planner will ignore your desire to +> > choose an index scan if your joining column's datatypes do not +> > match +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> + +------=_Part_3279_24692865.1155019239552 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +These number are pretty darn good for a four disk RAID 10, pretty close to perfect infact.  Nice advert for the 642 - I guess we have a Hardware RAID controller than will read indpendently from mirrors.

Alex

+
On 8/8/06, Steve Poe <steve.poe@gmail.com> wrote:
+Luke,

Here are the results of two runs of 16GB file tests on XFS.

scsi disc array
xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8
scsi disc array +
xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6

Thanks.

Steve



> Can you run bonnie++ version 1.03a on the machine and report the results +
> here?
>
> It could be OK if you have the latest Linux driver for cciss, someone has
> reported good results to this list with the latest, bleeding edge version of
> Linux (2.6.17).
> +
> - Luke
>


>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not +
>        match


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq +

+ +------=_Part_3279_24692865.1155019239552-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 04:39:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 081C09FB289 + for ; + Tue, 8 Aug 2006 04:39:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 44448-05 for + ; + Tue, 8 Aug 2006 07:39:55 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from office.redwerk.com (office.redwerk.com [85.90.206.104]) + by postgresql.org (Postfix) with ESMTP id 0450D9FB281 + for ; + Tue, 8 Aug 2006 04:39:54 -0300 (ADT) +Received: from bofh by office.redwerk.com with local (Exim 4.62 (FreeBSD)) + (envelope-from ) id 1GAMBw-0000Xr-ET + for pgsql-performance@postgresql.org; Tue, 08 Aug 2006 10:39:56 +0300 +Date: Tue, 8 Aug 2006 10:39:56 +0300 +From: Eugeny N Dzhurinsky +To: pgsql-performance@postgresql.org +Subject: vacuuming +Message-ID: <20060808073956.GA2087@office.redwerk.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=koi8-r +Content-Disposition: inline +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/95 +X-Sequence-Number: 20280 + +Hello + +I have pg_autovacuum running with the arguments: + +pg_autovacuum -D -s 120 -v 10000 + +the database is postgresql 8.0.0 + +Sometimes load average on server raises to 20 and it is almost impossible to +login via SSH + +When I'm logging in finally, I see there is cpu usage: 6% and iowait 95% + +ps ax | grep post gives me + +postgres: postgres db [local] VACUUM + +Is there some solution to avoid such cases? + +-- +Eugene N Dzhurinsky + +From pgsql-bugs-owner@postgresql.org Tue Aug 8 22:30:58 2006 +X-Original-To: pgsql-bugs-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 389A99FB29D + for ; + Tue, 8 Aug 2006 05:42:06 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 52164-08 for ; + Tue, 8 Aug 2006 08:42:05 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org + [65.19.161.25]) by postgresql.org (Postfix) with ESMTP id 52FD89FB29C + for ; Tue, 8 Aug 2006 05:42:04 -0300 (ADT) +Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org + [65.19.161.25]) + by wwwmaster.postgresql.org (8.13.3/8.13.3) with ESMTP id + k788g2rg044050 + for ; Tue, 8 Aug 2006 08:42:03 GMT + (envelope-from www@wwwmaster.postgresql.org) +Received: (from www@localhost) + by wwwmaster.postgresql.org (8.13.3/8.13.3/Submit) id k788g2hG044049; + Tue, 8 Aug 2006 08:42:02 GMT (envelope-from www) +Date: Tue, 8 Aug 2006 08:42:02 GMT +Message-Id: <200608080842.k788g2hG044049@wwwmaster.postgresql.org> +To: pgsql-bugs@postgresql.org +Subject: BUG #2567: High IOWAIT +From: "kumarselvan" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/44 +X-Sequence-Number: 15519 + + +The following bug has been logged online: + +Bug reference: 2567 +Logged by: kumarselvan +Email address: kumar@nexge.com +PostgreSQL version: 8.1 +Operating system: Linux Enterprise version 3 +Description: High IOWAIT +Details: + +i have installed the postgres as mentioned in the Install file. it is a 4 +cpu 8 GB Ram Machine installed with Linux Enterprise version 3. when i am +running a load which will perfrom 40 inserts persecond on 2 tables and 10 +updates per 10seconds on differnt table IOWait on avg going upto 70% due to +which i am not able to increase the load. Is there is any other way to +install the postgres on multiprocessor machine.. can any one help me on +this... + +From pgsql-performance-owner@postgresql.org Tue Aug 8 07:40:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C95469FB26B + for ; + Tue, 8 Aug 2006 07:40:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 73141-08 for + ; + Tue, 8 Aug 2006 10:40:16 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) + by postgresql.org (Postfix) with ESMTP id 4423B9FB221 + for ; + Tue, 8 Aug 2006 07:40:15 -0300 (ADT) +Received: (qmail 10514 invoked by uid 514); 8 Aug 2006 12:40:13 +0200 +Received: from 62.37.216.88 by rigodon (envelope-from , + uid 512) with qmail-scanner-1.25-st-qms + (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. + Clear:RC:0(62.37.216.88):SA:0(-2.3/5.0):. + Processed in 3.814009 secs); 08 Aug 2006 10:40:13 -0000 +X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon +X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.216.88):SA:0(-2.3/5.0):. + Processed in 3.814009 secs Process 10496) +Received: from 62-37-216-88.mad1.adsl.uni2.es (HELO ?192.168.2.28?) + (ruben@rentalia.com@62.37.216.88) + by mail.rentalia.net with SMTP; 8 Aug 2006 12:40:09 +0200 +Message-ID: <44D86A00.90106@rentalia.com> +Date: Tue, 08 Aug 2006 12:40:00 +0200 +From: Ruben Rubio +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: shared_buffer optimization +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=koi8-r +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/96 +X-Sequence-Number: 20281 + +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +Hi, I have a question with shared_buffer. + +Ok, I have a server with 4GB of RAM +- ----- +# cat /proc/meminfo +MemTotal: 4086484 kB +[...] +- ----- + +So, if I want to, for example, shared_buffer to take 3 GB of RAM then +shared_buffer would be 393216 (3 * 1024 * 1024 / 8) + +Postmaster dont start. +Error: FATAL: shmat(id=360448) failed: Invalid argument + + +I can set a less value, but not higher than 3 GB. + +Am I doing something wrong? +Any idea? +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.2.2 (GNU/Linux) +Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org + +iD8DBQFE2GoAIo1XmbAXRboRAtPgAJ9HN7aL0lyFtyTZnOoIAJXmGNsomgCeI1ex +II1MclZaaIjg/ryH08wCuAY= +=cgwJ +-----END PGP SIGNATURE----- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 09:05:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E1C119FB278 + for ; + Tue, 8 Aug 2006 09:05:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 71384-01 for + ; + Tue, 8 Aug 2006 09:05:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from kenobi.snowman.net (kenobi.snowman.net [70.84.9.186]) + by postgresql.org (Postfix) with ESMTP id 19C339FB24E + for ; + Tue, 8 Aug 2006 09:05:30 -0300 (ADT) +Received: by kenobi.snowman.net (Postfix, from userid 1000) + id D02D558045; Tue, 8 Aug 2006 07:05:29 -0500 (CDT) +Date: Tue, 8 Aug 2006 08:05:29 -0400 +From: Stephen Frost +To: Alex Turner +Cc: Alvaro Nunes Melo , pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good enough +Message-ID: <20060808120529.GL20016@kenobi.snowman.net> +Mail-Followup-To: Alex Turner , + Alvaro Nunes Melo , + pgsql-performance@postgresql.org +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="Dw7F2rfFuuIXZgJ2" +Content-Disposition: inline +In-Reply-To: <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +X-Editor: Vim http://www.vim.org/ +X-Info: http://www.snowman.net +X-Operating-System: Linux/2.6.16-2-vserver-686 (i686) +X-Uptime: 07:54:38 up 44 days, 1:51, 14 users, load average: 1.77, 0.92, 0.74 +User-Agent: Mutt/1.5.11+cvs20060403 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.223 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/97 +X-Sequence-Number: 20282 + + +--Dw7F2rfFuuIXZgJ2 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +* Alex Turner (armtuk@gmail.com) wrote: +> First off - very few third party tools support debian. Debian is a sure +> fire way to have an unsupported system. Use RedHat or SuSe (flame me all +> you want, it doesn't make it less true). + +Yeah, actually, it does make it less true since, well, it's really not +all that true to begin with. + +What you're probably intending to say is that fewer companies say "Works +with Debian!" on their advertising material or list it as "officially +supported". I've had *very* few problems running commercial apps on +Debian (including things like Oracle and IBM SAN management software). +Generally it's just take the rpms and either install them *using* rpm +(which is available in Debian...) or use alien to convert them to a +tarball and/or deb. + +HP is actually pretty big into Debian and I'd be curious as to what the +problems installing the monitoring tools were. My guess is that the +issue is actually some kernel module or something, in which case any +kernel that they don't build the module (or write it, depending..) for +may be problematic. This would probably include some releases of +RedHat/SuSe (ES, Fedora, who knows) and pretty much any kernel you build +using sources off of kernel.org or for any other distribution unless you +know exactly what versions/patches they support. + +Feel free to contact me off-list if you'd like to continue this +discussion since I don't really see it as appropriate for this list. + + Thanks, + + Stephen + +--Dw7F2rfFuuIXZgJ2 +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: Digital signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.5 (GNU/Linux) + +iD8DBQFE2H4JrzgMPqB3kigRAhmfAJ96HuRV4jk/Xlwv50fH/vPyPvXyxQCfb39M +cOhoPjFNMbzLu5c45Zm7xKw= +=Bdsp +-----END PGP SIGNATURE----- + +--Dw7F2rfFuuIXZgJ2-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 09:14:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D2A0A9FB278 + for ; + Tue, 8 Aug 2006 09:14:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 93536-08 for + ; + Tue, 8 Aug 2006 12:14:36 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from kenobi.snowman.net (kenobi.snowman.net [70.84.9.186]) + by postgresql.org (Postfix) with ESMTP id 836D59FB24E + for ; + Tue, 8 Aug 2006 09:14:36 -0300 (ADT) +Received: by kenobi.snowman.net (Postfix, from userid 1000) + id 303CA58047; Tue, 8 Aug 2006 07:14:35 -0500 (CDT) +Date: Tue, 8 Aug 2006 08:14:35 -0400 +From: Stephen Frost +To: Alex Turner +Cc: Alvaro Nunes Melo , pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good enough +Message-ID: <20060808121435.GM20016@kenobi.snowman.net> +Mail-Followup-To: Alex Turner , + Alvaro Nunes Melo , + pgsql-performance@postgresql.org +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="Kpsb9uGLH42Key6t" +Content-Disposition: inline +In-Reply-To: <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +X-Editor: Vim http://www.vim.org/ +X-Info: http://www.snowman.net +X-Operating-System: Linux/2.6.16-2-vserver-686 (i686) +X-Uptime: 08:07:40 up 44 days, 2:04, 14 users, load average: 0.65, 0.79, 0.84 +User-Agent: Mutt/1.5.11+cvs20060403 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/98 +X-Sequence-Number: 20283 + + +--Kpsb9uGLH42Key6t +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Alvaro, + +* Alex Turner (armtuk@gmail.com) wrote: +> The other thing is you will probably want to turn on stats in postgres to +> figure out which queries are the bad ones (does anyone have good docs posted +> for this?). Once you have identified the bad queries, you can explain +> analyze them, and figure out why they suck. + +Given your position, this might be the best approach to take to find +some 'low-hanging fruit'. Do you have queries which are complex in some +way? Do you have many long-open transactions? If you're doing more +than simple queries then you may want to explain analyze the more +complex ones and try to speed them up. If you run into trouble +understanding the output or how to improve it then post it here (with as +much info as you can, schema definitions, the query, the explain analyze +results, etc) and we can help. + +top/iostat/vmstat are very useful tools too and can help with hardware +decisions but you probably want to review your queries and make sure the +database is performing as best it can with the setup you have today +before throwing more hardware at it. + + Thanks, + + Stephen + +--Kpsb9uGLH42Key6t +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: Digital signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.5 (GNU/Linux) + +iD8DBQFE2IArrzgMPqB3kigRAlLGAJ4ySSrMSHf9B+LKcuXnkiv/QAWsDQCfddW9 +r8t4/iE3AoaoQGfY1UGXPLk= +=BC8o +-----END PGP SIGNATURE----- + +--Kpsb9uGLH42Key6t-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 09:38:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 69F729FB272 + for ; + Tue, 8 Aug 2006 09:38:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 05238-03 for + ; + Tue, 8 Aug 2006 12:38:25 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id 498619FB21D + for ; + Tue, 8 Aug 2006 09:38:24 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id 554D830E06; Tue, 8 Aug 2006 14:38:23 +0200 (MET DST) +From: Christopher Browne +X-Newsgroups: pgsql.performance +Subject: Re: shared_buffer optimization +Date: Tue, 08 Aug 2006 08:20:01 -0400 +Organization: cbbrowne Computing Inc +Lines: 37 +Message-ID: <87u04nv2q6.fsf@wolfe.cbbrowne.com> +References: <44D86A00.90106@rentalia.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Complaints-To: usenet@news.hub.org +X-message-flag: Outlook is rather hackable, isn't it? +X-Home-Page: http://www.cbbrowne.com/info/ +X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne +User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.19 (linux) +Cancel-Lock: sha1:OHRWAM5s2qHuketf3GONu/CmfT8= +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.273 tagged_above=0 required=5 tests=INFO_TLD +X-Spam-Level: * +X-Archive-Number: 200608/100 +X-Sequence-Number: 20285 + +Quoth ruben@rentalia.com (Ruben Rubio): +> Hi, I have a question with shared_buffer. +> +> Ok, I have a server with 4GB of RAM +> ----- +> # cat /proc/meminfo +> MemTotal: 4086484 kB +> [...] +> ----- +> +> So, if I want to, for example, shared_buffer to take 3 GB of RAM then +> shared_buffer would be 393216 (3 * 1024 * 1024 / 8) +> +> Postmaster dont start. +> Error: FATAL: shmat(id=360448) failed: Invalid argument +> +> +> I can set a less value, but not higher than 3 GB. +> +> Am I doing something wrong? +> Any idea? + +Yes, you're trying to set the value way too high. + +The "rule of thumb" is to set shared buffers to the lesser of 10000 +and 15% of system memory. In your case, that would be the lesser of +10000 and 78643, which is 10000. + +I'm not aware of any actual evidence having emerged that it is of any +value to set shared buffers higher than 10000. +-- +let name="cbbrowne" and tld="acm.org" in name ^ "@" ^ tld;; +http://linuxdatabases.info/info/x.html +Rules of the Evil Overlord #25. "No matter how well it would perform, +I will never construct any sort of machinery which is completely +indestructible except for one small and virtually inaccessible +vulnerable spot." + +From pgsql-performance-owner@postgresql.org Tue Aug 8 09:20:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id DA6919FB28C + for ; + Tue, 8 Aug 2006 09:20:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 94221-09 for + ; + Tue, 8 Aug 2006 12:20:25 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from insiderscore.com (mail01.insiderscore.com [69.84.139.233]) + by postgresql.org (Postfix) with ESMTP id 61DDE9FB278 + for ; + Tue, 8 Aug 2006 09:20:25 -0300 (ADT) +Received: from [10.10.10.105] (pool-72-70-43-141.bstnma.fios.verizon.net + [72.70.43.141]) + by insiderscore.com (Postfix) with ESMTP id 9108411C4100; + Tue, 8 Aug 2006 08:20:23 -0400 (EDT) +In-Reply-To: <1154819438.15224.24.camel@amd64-gentoo-laptop> +References: <1154819438.15224.24.camel@amd64-gentoo-laptop> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <012F5F4F-929E-4A54-B68C-D2736D2A4EFA@torgo.978.org> +Cc: pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Jeff Trout +Subject: Re: Postgresql Performance on an HP DL385 and SmartArray 642 +Date: Tue, 8 Aug 2006 08:20:22 -0400 +To: steve.poe@gmail.com +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/99 +X-Sequence-Number: 20284 + + +On Aug 5, 2006, at 7:10 PM, Steve Poe wrote: +> +> Has anyone worked with server before. I've read the SmartArray 6i is a +> poor performer, I wonder if the SmartArray 642 adapter would have the +> same fate? +> + +My newest db is a DL385, 6 disks. It runs very nicely. I have no +issues with the 6i controller. +If you look in the pgsql-performance archives a week or two ago +you'll see a similar thread to +this one - in fact, it is also about a dl385 (but he had a 5i +controller) + +-- +Jeff Trout +http://www.dellsmartexitin.com/ +http://www.stuarthamm.net/ + + + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 10:57:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 4A1F09FB214 + for ; + Tue, 8 Aug 2006 10:57:15 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 76518-09 for + ; + Tue, 8 Aug 2006 10:57:11 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.230]) + by postgresql.org (Postfix) with ESMTP id 06C959FB209 + for ; + Tue, 8 Aug 2006 10:57:11 -0300 (ADT) +Received: by wx-out-0506.google.com with SMTP id h31so570965wxd + for ; + Tue, 08 Aug 2006 06:57:10 -0700 (PDT) +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:references; + b=rpVi1juAmHH61tPMAmmmkXZmGY7YqMBSzMESH2uU1NWUs6/iO5j0kjtT9audb/kC4YLry++M5dTfh4Ee77TLEHOgRHCGd0eP1C6VjudB+WtpqIt8ByoNczTZs1dUGhNhKzPerpOH0XPtu4RGuJxh0BIjitQhfUGQtR0T4iLl+5U= +Received: by 10.78.117.10 with SMTP id p10mr2778508huc; + Tue, 08 Aug 2006 06:57:10 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 06:57:10 -0700 (PDT) +Message-ID: <721b21dc0608080657u2be4a27cwea62207a9265117d@mail.gmail.com> +Date: Tue, 8 Aug 2006 06:57:10 -0700 +From: "Steve Poe" +To: "Alex Turner" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Luke Lonergan" , + pgsql-performance@postgresql.org +In-Reply-To: <33c6269f0608072340r7c2a6849i48eae3ea393e00d4@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_11069_13031820.1155045430140" +References: + <1155010416.17773.1.camel@amd64-gentoo-laptop> + <33c6269f0608072340r7c2a6849i48eae3ea393e00d4@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.696 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/101 +X-Sequence-Number: 20286 + +------=_Part_11069_13031820.1155045430140 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Alex, + +Maybe I mis-stated, this is a 6-disk array. + +Steve + +On 8/7/06, Alex Turner wrote: +> +> These number are pretty darn good for a four disk RAID 10, pretty close to +> perfect infact. Nice advert for the 642 - I guess we have a Hardware RAID +> controller than will read indpendently from mirrors. +> +> Alex +> +> On 8/8/06, Steve Poe wrote: +> +> > Luke, +> +> Here are the results of two runs of 16GB file tests on XFS. +> +> scsi disc array +> xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1 +> ,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8 +> scsi disc array +> xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1 +> ,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6 +> +> Thanks. +> +> Steve +> +> +> +> > Can you run bonnie++ version 1.03a on the machine and report the results +> +> > here? +> > +> > It could be OK if you have the latest Linux driver for cciss, someone +> has +> > reported good results to this list with the latest, bleeding edge +> version of +> > Linux (2.6.17). +> > +> > - Luke +> > +> +> +> > +> > +> > ---------------------------(end of broadcast)--------------------------- +> > TIP 9: In versions below 8.0, the planner will ignore your desire to +> > choose an index scan if your joining column's datatypes do not +> > match +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> +> + +------=_Part_11069_13031820.1155045430140 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Alex,

Maybe I mis-stated, this is a 6-disk array.

Steve

On 8/7/06, Alex Turner <armtuk@gmail.com +> wrote:
These number are pretty darn good for a four disk RAID 10, pretty close to perfect infact.  Nice advert for the 642 - I guess we have a Hardware RAID controller than will read indpendently from mirrors. +

Alex

+
On 8/8/06, Steve Poe < +steve.poe@gmail.com> wrote:
+ +Luke,

Here are the results of two runs of 16GB file tests on XFS.

scsi disc array
xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8
scsi disc array +
xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6

Thanks.

Steve



> Can you run bonnie++ version 1.03a on the machine and report the results +
> here?
>
> It could be OK if you have the latest Linux driver for cciss, someone has
> reported good results to this list with the latest, bleeding edge version of
> Linux (2.6.17).
> +
> - Luke
>


>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not +
>        match


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               +http://www.postgresql.org/docs/faq +

+ +

+ +------=_Part_11069_13031820.1155045430140-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 11:36:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 35BB99FB28C + for ; + Tue, 8 Aug 2006 11:36:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 23605-08 for + ; + Tue, 8 Aug 2006 14:36:36 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id 9798B9FB271 + for ; + Tue, 8 Aug 2006 11:36:36 -0300 (ADT) +Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Tue, 08 Aug 2006 10:36:20 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 8 Aug + 2006 10:36:16 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Tue, 8 Aug 2006 10:36:15 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D03EA1F78@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca6tZvWfAC+LSmqT1qmwMHJ1xHjlwAQmS9E +From: "Luke Lonergan" +To: "Alex Turner" , + steve.poe@gmail.com +cc: pgsql-performance@postgresql.org +X-OriginalArrivalTime: 08 Aug 2006 14:36:16.0545 (UTC) + FILETIME=[01709910:01C6BAF8] +X-WSS-ID: 68C67EE83785827235-18-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/102 +X-Sequence-Number: 20287 + +I agree, I think these say you are getting 240MB/s sequential reads and = +1000 seeks per second. + +That's pretty much the best you'd expect. + +- Luke + +Sent from my GoodLink synchronized handheld (www.good.com) + + + -----Original Message----- +From: Alex Turner [mailto:armtuk@gmail.com] +Sent: Tuesday, August 08, 2006 02:40 AM Eastern Standard Time +To: steve.poe@gmail.com +Cc: Luke Lonergan; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Postgresql Performance on an HP DL385 and + +These number are pretty darn good for a four disk RAID 10, pretty close = +to +perfect infact. Nice advert for the 642 - I guess we have a Hardware = +RAID +controller than will read indpendently from mirrors. + +Alex + +On 8/8/06, Steve Poe wrote: +> +> Luke, +> +> Here are the results of two runs of 16GB file tests on XFS. +> +> scsi disc array +> xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1 +> ,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8 +> scsi disc array +> xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1 +> ,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6 +> +> Thanks. +> +> Steve +> +> +> +> > Can you run bonnie++ version 1.03a on the machine and report the = +results +> > here? +> > +> > It could be OK if you have the latest Linux driver for cciss, = +someone +> has +> > reported good results to this list with the latest, bleeding edge +> version of +> > Linux (2.6.17). +> > +> > - Luke +> > +> +> +> > +> > +> > ---------------------------(end of = +broadcast)--------------------------- +> > TIP 9: In versions below 8.0, the planner will ignore your desire to +> > choose an index scan if your joining column's datatypes do = +not +> > match +> +> +> ---------------------------(end of = +broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 12:01:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E77149FB277 + for ; + Tue, 8 Aug 2006 12:01:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 82308-06 for + ; + Tue, 8 Aug 2006 12:01:50 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wr-out-0506.google.com (wr-out-0506.google.com + [64.233.184.237]) + by postgresql.org (Postfix) with ESMTP id DAC7F9FB271 + for ; + Tue, 8 Aug 2006 12:01:49 -0300 (ADT) +Received: by wr-out-0506.google.com with SMTP id 36so84578wra + for ; + Tue, 08 Aug 2006 08:01:48 -0700 (PDT) +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:references; + b=lFGeTn67OdUkQJs9YvKDMs0DQDd+PNR/ZcIBSj+eF88qRnuWLIDUHwdXmeAWxzx2dm/ouhm8+mUuFa9AE8QBgyMR4vQf34HE6JoQYCwQuoQTgVqvM90NZjrDGr2lYDo/ZNyPW+nAlsZMTyCuWvZIvpJvJUqxyqoUqOe6/tew6aM= +Received: by 10.78.177.3 with SMTP id z3mr2794910hue; + Tue, 08 Aug 2006 08:01:48 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 08:01:47 -0700 (PDT) +Message-ID: <721b21dc0608080801l5fb6534ey7094774ff79a323b@mail.gmail.com> +Date: Tue, 8 Aug 2006 08:01:47 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <3E37B936B592014B978C4415F90D662D03EA1F78@MI8NYCMAIL06.Mi8.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_13373_6078297.1155049307577" +References: <3E37B936B592014B978C4415F90D662D03EA1F78@MI8NYCMAIL06.Mi8.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.381 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/103 +X-Sequence-Number: 20288 + +------=_Part_13373_6078297.1155049307577 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +Thanks for the feedback. I use the same database test that I've run a Sun +dual Opteron with 4Gb RAM and (2) four disk arrays in RAID10. The sun box +with one disc on an LSI MegaRAID 2-channel adapter outperforms this HP box. +I though I was doing something wrong or there is something wrong with the +box. + +Steve + +On 8/8/06, Luke Lonergan wrote: +> +> I agree, I think these say you are getting 240MB/s sequential reads and +> 1000 seeks per second. +> +> That's pretty much the best you'd expect. +> +> - Luke +> +> Sent from my GoodLink synchronized handheld (www.good.com) +> +> +> -----Original Message----- +> From: Alex Turner [mailto:armtuk@gmail.com] +> Sent: Tuesday, August 08, 2006 02:40 AM Eastern Standard Time +> To: steve.poe@gmail.com +> Cc: Luke Lonergan; pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Postgresql Performance on an HP DL385 and +> +> These number are pretty darn good for a four disk RAID 10, pretty close to +> perfect infact. Nice advert for the 642 - I guess we have a Hardware RAID +> controller than will read indpendently from mirrors. +> +> Alex +> +> On 8/8/06, Steve Poe wrote: +> > +> > Luke, +> > +> > Here are the results of two runs of 16GB file tests on XFS. +> > +> > scsi disc array +> > xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1 +> > ,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8 +> > scsi disc array +> > xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18,1029.1 +> > ,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6 +> > +> > Thanks. +> > +> > Steve +> > +> > +> > +> > > Can you run bonnie++ version 1.03a on the machine and report the +> results +> > > here? +> > > +> > > It could be OK if you have the latest Linux driver for cciss, someone +> > has +> > > reported good results to this list with the latest, bleeding edge +> > version of +> > > Linux (2.6.17). +> > > +> > > - Luke +> > > +> > +> > +> > > +> > > +> > > ---------------------------(end of +> broadcast)--------------------------- +> > > TIP 9: In versions below 8.0, the planner will ignore your desire to +> > > choose an index scan if your joining column's datatypes do not +> > > match +> > +> > +> > ---------------------------(end of broadcast)--------------------------- +> > TIP 3: Have you checked our extensive FAQ? +> > +> > http://www.postgresql.org/docs/faq +> > +> +> + +------=_Part_13373_6078297.1155049307577 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

Thanks for the feedback.  I use the same database test that I've run a Sun dual Opteron with 4Gb RAM and (2) four disk arrays in RAID10. The sun box with one disc on an LSI MegaRAID 2-channel adapter outperforms this HP box. I though I was doing something wrong or there is something wrong with the box. +

Steve

On 8/8/06, Luke Lonergan <LLonergan@greenplum.com> wrote:
+I agree, I think these say you are getting 240MB/s sequential reads and 1000 seeks per second.

That's pretty much the best you'd expect.

- Luke

Sent from my GoodLink synchronized handheld ( +www.good.com)


-----Original Message-----
From:   Alex Turner [mailto:armtuk@gmail.com]
Sent:   Tuesday, August 08, 2006 02:40 AM Eastern Standard Time
To:     +steve.poe@gmail.com
Cc:     Luke Lonergan; pgsql-performance@postgresql.org
Subject:        Re: [PERFORM] Postgresql Performance on an HP DL385 and +

These number are pretty darn good for a four disk RAID 10, pretty close to
perfect infact.  Nice advert for the 642 - I guess we have a Hardware RAID
controller than will read indpendently from mirrors.

+Alex

On 8/8/06, Steve Poe <steve.poe@gmail.com> wrote:
>
> Luke,
>
> Here are the results of two runs of 16GB file tests on XFS.
>
> scsi disc array +
> xfs ,16G,81024,99,153016,24,73422,10,82092,97,243210,17,1043.1
> ,0,16,3172,7,+++++,+++,2957,9,3197,10,+++++,+++,2484,8
> scsi disc array
> xfs ,16G,83320,99,155641,25,73662,10,81756,96,243352,18, +1029.1
> ,0,16,3119,10,+++++,+++,2789,7,3263,11,+++++,+++,2014,6
>
> Thanks.
>
> Steve
>
>
>
> > Can you run bonnie++ version 1.03a on the machine and report the results +
> > here?
> >
> > It could be OK if you have the latest Linux driver for cciss, someone
> has
> > reported good results to this list with the latest, bleeding edge
> version of +
> > Linux (2.6.17).
> >
> > - Luke
> >
>
>
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: In versions below +8.0, the planner will ignore your desire to
> >        choose an index scan if your joining column's datatypes do not
> >        match
>
>
> ---------------------------(end of broadcast)--------------------------- +
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>


+ +------=_Part_13373_6078297.1155049307577-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 13:23:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 187689FB2AF + for ; + Tue, 8 Aug 2006 13:23:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 72747-04 for + ; + Tue, 8 Aug 2006 16:23:23 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id 4706A9FB274 + for ; + Tue, 8 Aug 2006 13:23:23 -0300 (ADT) +Received: from 172.16.1.148 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Tue, 08 Aug 2006 12:23:14 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 8 Aug + 2006 12:22:18 -0400 +Received: from 63.80.24.130 ([63.80.24.130]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.134]) with Microsoft Exchange Server HTTP-DAV ; Tue, 8 Aug + 2006 16:22:17 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Tue, 08 Aug 2006 09:22:15 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Alex Turner" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca7Bs9fDhM4vSb6EduxKgAWy4o9DA== +In-Reply-To: <721b21dc0608080801l5fb6534ey7094774ff79a323b@mail.gmail.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 08 Aug 2006 16:22:18.0009 (UTC) + FILETIME=[D12AF890:01C6BB06] +X-WSS-ID: 68C665FB3785890157-02-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.5 tagged_above=0 required=5 tests=RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/104 +X-Sequence-Number: 20289 + +Steve, + +On 8/8/06 8:01 AM, "Steve Poe" wrote: + +> Thanks for the feedback. I use the same database test that I've run a Sun +> dual Opteron with 4Gb RAM and (2) four disk arrays in RAID10. The sun box with +> one disc on an LSI MegaRAID 2-channel adapter outperforms this HP box. I +> though I was doing something wrong or there is something wrong with the box. + +Given the circumstances (benchmarked I/O is great, comparable perf on +another box with single disk is better), seems that one of: +1) something wrong with the CPU/memory on the box +2) something with the OS version / kernel +3) something with the postgres configuration + +Can you post the database benchmark results? + +- Luke + + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 13:57:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 42CCF9FB366 + for ; + Tue, 8 Aug 2006 13:57:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 96037-07 for + ; + Tue, 8 Aug 2006 13:57:45 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.190]) + by postgresql.org (Postfix) with ESMTP id 347389FB365 + for ; + Tue, 8 Aug 2006 13:57:44 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so314671nfc + for ; + Tue, 08 Aug 2006 09:57:43 -0700 (PDT) +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:references; + b=OUF5XBxtkcjtUyMWNoU+kzM3PBlQKXGvZIRN7lU3miyrzOIYYOunrkB0ZJOzkM/WegaosydYcmatK/uIF1naGZNLueXRjnAEJvGWmtCFRllT/VlOuT9FR8cyUQBpzH1TKfBmifQjSILOZiuqw+kST2+G4Iq5wjkYGFUKoWRo7f0= +Received: by 10.78.177.3 with SMTP id z3mr2833187hue; + Tue, 08 Aug 2006 09:57:43 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 09:57:43 -0700 (PDT) +Message-ID: <721b21dc0608080957k166a7bc5t72cb3cf076e6da01@mail.gmail.com> +Date: Tue, 8 Aug 2006 09:57:43 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_16251_31296065.1155056263259" +References: <721b21dc0608080801l5fb6534ey7094774ff79a323b@mail.gmail.com> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.934 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_10_20, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/105 +X-Sequence-Number: 20290 + +------=_Part_16251_31296065.1155056263259 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +Here's some background: +I use Pg 7.4.13 (I've tested as far back as 7.4.8). I use an 8GB data with a +program called odbc-bench. I run an 18 minute test. With each run, HP box +excluded, I unmount the discs involved, reformat, un-tar the backup of +PGDATA and pg_xlog back on the discs, start-up Postgresql, then run the +odbc-bench. + +On the Sun box, I've benchmarked an average of 3 to 4 runs with each disc +(up to 8) in succession in RAID0, RAID5, and RAID10 where applicable. I've +done with with pg_xlog on the same discs as PGDATA and separately, so I've +felt like I had a good understanding of how the performance works. I've +notice performance seems to level off at around 6 discs with another 10-15% +with two more discs. + +When I run odbc-bench, I also run vmstat in the background (through a python +script) which averages/summarzies the high/low/average of each category for +each minute then a final summary after the run. + +On the Sun box, with 4 discs (RAID10) to one channel on the LSI RAID card, I +see an average TPS around 70. If I ran this off of one disc, I see an +average TPS of 32. + +on the HP box, with 6-discs in RAID10 and 1 spare. I see a TPS of 34. I +don't have my vmstat reports with me, but I recall the CPU utilitization on +the HP was about 50% higher. I need to check on this. + +Steve + + + + + + + +On 8/8/06, Luke Lonergan wrote: +> +> Steve, +> +> On 8/8/06 8:01 AM, "Steve Poe" wrote: +> +> > Thanks for the feedback. I use the same database test that I've run a +> Sun +> > dual Opteron with 4Gb RAM and (2) four disk arrays in RAID10. The sun +> box with +> > one disc on an LSI MegaRAID 2-channel adapter outperforms this HP box. I +> > though I was doing something wrong or there is something wrong with the +> box. +> +> Given the circumstances (benchmarked I/O is great, comparable perf on +> another box with single disk is better), seems that one of: +> 1) something wrong with the CPU/memory on the box +> 2) something with the OS version / kernel +> 3) something with the postgres configuration +> +> Can you post the database benchmark results? +> +> - Luke +> +> +> + +------=_Part_16251_31296065.1155056263259 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

Here's some background:
I use Pg 7.4.13 (I've tested as far back as 7.4.8). I use an 8GB data with a program called odbc-bench. I run an 18 minute test. With each run, HP box excluded, I unmount the discs involved, reformat, un-tar the backup of PGDATA and pg_xlog back on the discs, start-up Postgresql, then run the odbc-bench. +

On the Sun box, I've benchmarked an average of 3 to 4 runs with each disc (up to 8) in succession in RAID0, RAID5, and RAID10 where applicable. I've done with with pg_xlog on the same discs as PGDATA and separately, so I've felt like I had a good understanding of how the performance works. I've notice performance seems to level off at around 6 discs with another 10-15% with two more discs. +

When I run odbc-bench, I also run vmstat in the background (through a python script) which averages/summarzies the high/low/average of each category for each minute then a final summary after the run.

On the Sun box, with 4 discs (RAID10) to one channel on the LSI RAID card, I see an average TPS around 70. If I ran this off of one disc, I see an average TPS of 32. +

on the HP box, with 6-discs in RAID10 and 1 spare. I see a TPS of 34. I don't have my vmstat reports with me, but I recall the CPU utilitization on the HP was about 50% higher. I need to check on this.

Steve +







On 8/8/06, Luke Lonergan <llonergan@greenplum.com> wrote:
+Steve,

On 8/8/06 8:01 AM, "Steve Poe" <steve.poe@gmail.com> wrote:

> Thanks for the feedback.  I use the same database test that I've run a Sun
+> dual Opteron with 4Gb RAM and (2) four disk arrays in RAID10. The sun box with
> one disc on an LSI MegaRAID 2-channel adapter outperforms this HP box. I
> though I was doing something wrong or there is something wrong with the box. +

Given the circumstances (benchmarked I/O is great, comparable perf on
another box with single disk is better), seems that one of:
1) something wrong with the CPU/memory on the box
2) something with the OS version / kernel +
3) something with the postgres configuration

Can you post the database benchmark results?

- Luke



+ +------=_Part_16251_31296065.1155056263259-- + +From pgsql-performance-owner@postgresql.org Tue Aug 8 14:49:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 086B39FB36D + for ; + Tue, 8 Aug 2006 14:49:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 47889-07 for + ; + Tue, 8 Aug 2006 17:49:09 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.avior.ca (mail.avior.ca [209.47.34.36]) + by postgresql.org (Postfix) with SMTP id 7E12D9FB218 + for ; + Tue, 8 Aug 2006 14:49:08 -0300 (ADT) +Received: (qmail 10564 invoked by uid 0); 8 Aug 2006 17:49:07 -0000 +Received: from pbeliveau@avior.ca by mail by uid 510 with qmail-scanner-1.16 + (clamscan: 0.60. Clear:. + Processed in 0.864485 secs); 08 Aug 2006 17:49:07 -0000 +Received: from mis-07.avior.ca (HELO ?10.1.1.7?) (10.1.1.7) + by mail.avior.ca with SMTP; 8 Aug 2006 17:49:06 -0000 +Message-ID: <44D8CE92.1080407@avior.ca> +Date: Tue, 08 Aug 2006 13:49:06 -0400 +From: Patrice Beliveau +User-Agent: Thunderbird 1.5.0.4 (X11/20060614) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Optimizing queries +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/106 +X-Sequence-Number: 20291 + +Hi, + +I have a query that use a function and some column test to select row. +It's in the form of: + +SELECT * FROM TABLE + WHERE TABLE.COLUMN1=something + AND TABLE.COLUMN2=somethingelse + AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; + +The result of the function does NOT depend only from the table, but also +from some other tables. + +Since it's long to process, I've add some output to see what's going on. +I find out that the function process every row even if the row should be +rejected as per the first or the second condition. Then , my question +is: Is there a way to formulate a query that wont do all the check if it +does not need to do it ? Meaning that, if condition1 is false then it +wont check condition2 and that way the function will only be called when +it's really necessary. + +Thanks + +From pgsql-performance-owner@postgresql.org Tue Aug 8 15:40:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3BA279FB218 + for ; + Tue, 8 Aug 2006 15:40:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 78781-02 for + ; + Tue, 8 Aug 2006 18:40:05 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id E04659FA621 + for ; + Tue, 8 Aug 2006 15:40:04 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Tue, 8 Aug 2006 18:39:59 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 08 Aug 2006 13:39:59 -0500 +Subject: Re: Optimizing queries +From: Scott Marlowe +To: Patrice Beliveau +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44D8CE92.1080407@avior.ca> +References: <44D8CE92.1080407@avior.ca> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155062399.20252.50.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Tue, 08 Aug 2006 13:39:59 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/107 +X-Sequence-Number: 20292 + +On Tue, 2006-08-08 at 12:49, Patrice Beliveau wrote: +> Hi, +> +> I have a query that use a function and some column test to select row. +> It's in the form of: +> +> SELECT * FROM TABLE +> WHERE TABLE.COLUMN1=something +> AND TABLE.COLUMN2=somethingelse +> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; +> +> The result of the function does NOT depend only from the table, but also +> from some other tables. +> +> Since it's long to process, I've add some output to see what's going on. +> I find out that the function process every row even if the row should be +> rejected as per the first or the second condition. Then , my question +> is: Is there a way to formulate a query that wont do all the check if it +> does not need to do it ? Meaning that, if condition1 is false then it +> wont check condition2 and that way the function will only be called when +> it's really necessary. + +What version of postgresql are you running? It might be better in later +versions. The standard fix for such things is to use a subquery... + +select * from ( + select * from table where + col1='something' + and col2='somethingelse' +) as a +where function(a.col3,a.col4) > 0; + +From pgsql-performance-owner@postgresql.org Tue Aug 8 17:15:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2E9EA9FA6B2 + for ; + Tue, 8 Aug 2006 17:15:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 40790-08 for + ; + Tue, 8 Aug 2006 17:14:50 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.avior.ca (mail.avior.ca [209.47.34.36]) + by postgresql.org (Postfix) with SMTP id C76C09FA666 + for ; + Tue, 8 Aug 2006 17:14:50 -0300 (ADT) +Received: (qmail 2293 invoked by uid 0); 8 Aug 2006 20:14:49 -0000 +Received: from pbeliveau@avior.ca by mail by uid 510 with qmail-scanner-1.16 + (clamscan: 0.60. Clear:. + Processed in 0.863643 secs); 08 Aug 2006 20:14:49 -0000 +Received: from mis-07.avior.ca (HELO ?10.1.1.7?) (10.1.1.7) + by mail.avior.ca with SMTP; 8 Aug 2006 20:14:48 -0000 +Message-ID: <44D8F0B8.2030804@avior.ca> +Date: Tue, 08 Aug 2006 16:14:48 -0400 +From: Patrice Beliveau +User-Agent: Thunderbird 1.5.0.4 (X11/20060614) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: Optimizing queries +References: <44D8CE92.1080407@avior.ca> + <1155062399.20252.50.camel@state.g2switchworks.com> +In-Reply-To: <1155062399.20252.50.camel@state.g2switchworks.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/108 +X-Sequence-Number: 20293 + +Scott Marlowe wrote: +> On Tue, 2006-08-08 at 12:49, Patrice Beliveau wrote: +> +>> Hi, +>> +>> I have a query that use a function and some column test to select row. +>> It's in the form of: +>> +>> SELECT * FROM TABLE +>> WHERE TABLE.COLUMN1=something +>> AND TABLE.COLUMN2=somethingelse +>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; +>> +>> The result of the function does NOT depend only from the table, but also +>> from some other tables. +>> +>> Since it's long to process, I've add some output to see what's going on. +>> I find out that the function process every row even if the row should be +>> rejected as per the first or the second condition. Then , my question +>> is: Is there a way to formulate a query that wont do all the check if it +>> does not need to do it ? Meaning that, if condition1 is false then it +>> wont check condition2 and that way the function will only be called when +>> it's really necessary. +>> +> +> What version of postgresql are you running? It might be better in later +> versions. The standard fix for such things is to use a subquery... +> +> select * from ( +> select * from table where +> col1='something' +> and col2='somethingelse' +> ) as a +> where function(a.col3,a.col4) > 0; +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> +> +> +Thanks for the answer, but it does not work, maybe I did something wrong + +First, I'm using version 8.1.3 + +This is what I did: + +select * from ( + select * from sales_order_delivery + where sales_order_id in ( + select sales_order_id from sales_order + where closed=false + ) + ) as a where outstandingorder(sales_order_id, sales_order_item, +date_due) > 0; + +Some output that I've create look like +INFO: so:03616 soi:1 date:1993-12-23 +INFO: so:09614 soi:1 date:1998-06-04 + +which are the three arguments passed to the function "outstandingorder", +but sales_order 03616 and 09614 are closed. + +What's wrong ?? + +Thanks + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 17:42:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 178989FB24D + for ; + Tue, 8 Aug 2006 17:42:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 15475-01 for + ; + Tue, 8 Aug 2006 20:42:33 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 3C40B9FA7BA + for ; + Tue, 8 Aug 2006 17:42:33 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k78KgTtQ013031; + Tue, 8 Aug 2006 16:42:29 -0400 (EDT) +To: Patrice Beliveau +cc: pgsql-performance@postgresql.org +Subject: Re: Optimizing queries +In-reply-to: <44D8F0B8.2030804@avior.ca> +References: <44D8CE92.1080407@avior.ca> + <1155062399.20252.50.camel@state.g2switchworks.com> + <44D8F0B8.2030804@avior.ca> +Comments: In-reply-to Patrice Beliveau + message dated "Tue, 08 Aug 2006 16:14:48 -0400" +Date: Tue, 08 Aug 2006 16:42:29 -0400 +Message-ID: <13030.1155069749@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/109 +X-Sequence-Number: 20294 + +Patrice Beliveau writes: +>>> SELECT * FROM TABLE +>>> WHERE TABLE.COLUMN1=something +>>> AND TABLE.COLUMN2=somethingelse +>>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; + +> I find out that the function process every row even if the row should be +> rejected as per the first or the second condition. +> ... I'm using version 8.1.3 + +PG 8.1 will not reorder WHERE clauses for a single table unless it has +some specific reason to do so (and AFAICT no version back to 7.0 or so +has done so either...) So there's something you are not telling us that +is relevant. Let's see the exact table schema (psql \d output is good), +the exact query, and EXPLAIN output for that query. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 8 18:04:00 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8E6599FB24D + for ; + Tue, 8 Aug 2006 18:03:59 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 21913-01 for + ; + Tue, 8 Aug 2006 21:03:50 +0000 (UTC) +X-Greylist: delayed 00:19:43.566855 by SQLgrey- +Received: from colo-dns-ext1.juniper.net (colo-dns-ext1.juniper.net + [207.17.137.57]) + by postgresql.org (Postfix) with ESMTP id C10329FA7BA + for ; + Tue, 8 Aug 2006 18:03:49 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext1.juniper.net (8.11.3/8.9.3) with ESMTP id k78Ki4X16816 + for ; + Tue, 8 Aug 2006 13:44:04 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k78Khwg56207; + Tue, 8 Aug 2006 13:43:58 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k78KhwuB004017; + Tue, 8 Aug 2006 13:43:58 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k78Khse6004014; + Tue, 8 Aug 2006 13:43:54 -0700 +Date: Tue, 8 Aug 2006 13:43:54 -0700 +From: Kenji Morishige +To: pgsql-performance@postgresql.org +Cc: kenjim@juniper.net +Subject: most bang for buck with ~ $20,000 +Message-ID: <20060808204354.GN29379@juniper.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/110 +X-Sequence-Number: 20295 + +I've asked for some help here a few months ago and got some really helpfull +answers regarding RAID controllers and server configuration. Up until +recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +machine with a single channel RAID controller (previously Adaptec 2200S, but +now changed to LSI MegaRAID). The 2U unit is from a generic vendor using what +I believe is a SuperMicro motherboard. In the last week after upgrading the +RAID controller, the machine has had disk failure and some other issues. I +would like to build a very reliable dedicated postgreSQL server that has the +ultimate possible performance and reliabily for around $20,000. The data set +size is only currently about 4GB, but is increasing by approximately 50MB +daily. The server also requires about 500 connections and I have been +monitoring about 100-200 queries per second at the moment. I am planning to +run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +improves performance. + +I am considering a setup such as this: + - At least dual cpu (possibly with 2 cores each) + - 4GB of RAM + - 2 disk RAID 1 array for root disk + - 4 disk RAID 1+0 array for PGDATA + - 2 disk RAID 1 array for pg_xlog + +Does anyone know a vendor that might be able provide such setup? Any +critique in this design? I'm thinking having a 2 channel RAID controller to +seperate the PGDATA, root and pg_xlog. + +Sincerely, +Kenji + +From pgsql-performance-owner@postgresql.org Tue Aug 8 18:49:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A562C9FB26A + for ; + Tue, 8 Aug 2006 18:49:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 22053-10 for + ; + Tue, 8 Aug 2006 21:49:25 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id D3CB89FB266 + for ; + Tue, 8 Aug 2006 18:49:24 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k78LnPfq017980 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Tue, 8 Aug 2006 14:49:26 -0700 +Message-ID: <44D906E1.7010405@commandprompt.com> +Date: Tue, 08 Aug 2006 14:49:21 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Kenji Morishige +CC: pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> +In-Reply-To: <20060808204354.GN29379@juniper.net> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 08 Aug 2006 14:49:26 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/111 +X-Sequence-Number: 20296 + +> +> I am considering a setup such as this: +> - At least dual cpu (possibly with 2 cores each) +> - 4GB of RAM +> - 2 disk RAID 1 array for root disk +> - 4 disk RAID 1+0 array for PGDATA +> - 2 disk RAID 1 array for pg_xlog +> +> Does anyone know a vendor that might be able provide such setup? + +I would look at the HP DL 385 or 585. The 385 is going to max a (2) dual +core cpus. The 585 is (4) dual core cpus. + +For 20k you should be able to go with a bit more then what you have +above, specifically in the RAM department. + +Joshua D. Drake + + + + + Any +> critique in this design? I'm thinking having a 2 channel RAID controller to +> seperate the PGDATA, root and pg_xlog. +> +> Sincerely, +> Kenji +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 18:59:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CCAAB9FA342 + for ; + Tue, 8 Aug 2006 18:59:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 49067-02 for + ; + Tue, 8 Aug 2006 18:59:15 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from georgia.textdrive.com (georgia.textdrive.com [207.7.107.246]) + by postgresql.org (Postfix) with ESMTP id E78F49FA34B + for ; + Tue, 8 Aug 2006 18:59:15 -0300 (ADT) +Received: from [192.168.1.109] (unknown [209.149.57.250]) + by georgia.textdrive.com (Postfix) with ESMTP id 6057433C91; + Tue, 8 Aug 2006 21:59:14 +0000 (GMT) +In-Reply-To: <44D906E1.7010405@commandprompt.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> +Cc: pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: "Thomas F. O'Connell" +Subject: Re: most bang for buck with ~ $20,000 +Date: Tue, 8 Aug 2006 16:59:09 -0500 +To: Kenji Morishige +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.253 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/112 +X-Sequence-Number: 20297 + + +On Aug 8, 2006, at 4:49 PM, Joshua D. Drake wrote: + +>> I am considering a setup such as this: +>> - At least dual cpu (possibly with 2 cores each) +>> - 4GB of RAM +>> - 2 disk RAID 1 array for root disk +>> - 4 disk RAID 1+0 array for PGDATA +>> - 2 disk RAID 1 array for pg_xlog +>> Does anyone know a vendor that might be able provide such setup? + +Wouldn't it be preferable to put WAL on a multi-disk RAID 10 if you +had the opportunity? This gives you the redundancy of RAID 1 but +approaches the performance of RAID 0, especially as you add disks to +the array. In benchmarking, I've seen consistent success with this +approach. + +-- +Thomas F. O'Connell +Sitening, LLC + +http://www.sitening.com/ +3004B Poston Avenue +Nashville, TN 37203-1314 +615-469-5150 x802 +615-469-5151 (fax) + +From pgsql-performance-owner@postgresql.org Tue Aug 8 19:08:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D1AFB9FB2AA + for ; + Tue, 8 Aug 2006 19:08:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 50244-02 for + ; + Tue, 8 Aug 2006 19:07:56 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colo-dns-ext1.juniper.net (colo-dns-ext1.juniper.net + [207.17.137.57]) + by postgresql.org (Postfix) with ESMTP id 087E49FA666 + for ; + Tue, 8 Aug 2006 19:07:55 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext1.juniper.net (8.11.3/8.9.3) with ESMTP id k78M7sX18275; + Tue, 8 Aug 2006 15:07:54 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k78M7ng73807; + Tue, 8 Aug 2006 15:07:49 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k78M7n5g007506; + Tue, 8 Aug 2006 15:07:49 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k78M7jtn007500; + Tue, 8 Aug 2006 15:07:45 -0700 +Date: Tue, 8 Aug 2006 15:07:45 -0700 +From: Kenji Morishige +To: "Thomas F. O'Connell" +Cc: pgsql-performance@postgresql.org, kenjim@juniper.net +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060808220745.GC6418@juniper.net> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/113 +X-Sequence-Number: 20298 + +The 1+0 on the WAL is better than on PGDATA? I guess I'm confused about the +write sequence of the data. I will research more, thank you! +-Kenji + +On Tue, Aug 08, 2006 at 04:59:09PM -0500, Thomas F. O'Connell wrote: +> +> On Aug 8, 2006, at 4:49 PM, Joshua D. Drake wrote: +> +> >>I am considering a setup such as this: +> >> - At least dual cpu (possibly with 2 cores each) +> >> - 4GB of RAM +> >> - 2 disk RAID 1 array for root disk +> >> - 4 disk RAID 1+0 array for PGDATA +> >> - 2 disk RAID 1 array for pg_xlog +> >>Does anyone know a vendor that might be able provide such setup? +> +> Wouldn't it be preferable to put WAL on a multi-disk RAID 10 if you +> had the opportunity? This gives you the redundancy of RAID 1 but +> approaches the performance of RAID 0, especially as you add disks to +> the array. In benchmarking, I've seen consistent success with this +> approach. +> +> -- +> Thomas F. O'Connell +> Sitening, LLC +> +> http://www.sitening.com/ +> 3004B Poston Avenue +> Nashville, TN 37203-1314 +> 615-469-5150 x802 +> 615-469-5151 (fax) + +From pgsql-performance-owner@postgresql.org Tue Aug 8 19:08:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 255909FB29F + for ; + Tue, 8 Aug 2006 19:08:49 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 38209-03 for + ; + Tue, 8 Aug 2006 22:08:34 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 6F7009FA666 + for ; + Tue, 8 Aug 2006 19:08:33 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Tue, 8 Aug 2006 22:08:32 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 08 Aug 2006 17:08:29 -0500 +Subject: Re: most bang for buck with ~ $20,000 +From: Scott Marlowe +To: Kenji Morishige +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060808204354.GN29379@juniper.net> +References: <20060808204354.GN29379@juniper.net> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155074909.20252.85.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Tue, 08 Aug 2006 17:08:29 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/114 +X-Sequence-Number: 20299 + +On Tue, 2006-08-08 at 15:43, Kenji Morishige wrote: +> I've asked for some help here a few months ago and got some really helpfull +> answers regarding RAID controllers and server configuration. Up until +> recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +> machine with a single channel RAID controller (previously Adaptec 2200S, but +> now changed to LSI MegaRAID). The 2U unit is from a generic vendor using what +> I believe is a SuperMicro motherboard. In the last week after upgrading the +> RAID controller, the machine has had disk failure and some other issues. I +> would like to build a very reliable dedicated postgreSQL server that has the +> ultimate possible performance and reliabily for around $20,000. The data set +> size is only currently about 4GB, but is increasing by approximately 50MB +> daily. The server also requires about 500 connections and I have been +> monitoring about 100-200 queries per second at the moment. I am planning to +> run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +> improves performance. + +This really depends on your usage patterns. + +OLAP or OLTP workloads? Do you need 24/7 reliability and therefore a +two machine setup? There's a lot of variety in load. + +Generally, you spend your money on disks, then memory, then CPU, in that +order. + +Look at the Areca cards, they've come highly recommended here. Look at +LOTS of drives. Given the size of your db, you can go with LOTS of +smaller drives and get good performance. If you can find a good box to +hold 12 to 16 drives and fill it with 37 gig 15k RPM drives, you'll have +lots of storage, even in RAID 1+0 config. That's aiming at +transactional throughput. + +Toss as much memory as is reasonably affordable at it. That's normally +in the 4 to 8 gig range. After that things start to get expensive fast. + +Multiple - dual core CPUs are a good idea. Opterons seem to be better +"data pumps" with large memory and >2 CPUs than Intels right now. +Better to have a 2xdual core opteron with slower processors than a +single dual core or dual single core CPU(s) with a faster clock speed. +As long as the memory access is equivalent, the more CPUs the better in +Opterons, where their interconnect speed increases as you increase the +number of CPUs. Intel Xeons are the opposite. Better with fewer faster +CPUs / cores. + +I just ran through a configurator on a site selling quad dual core +opteron servers. 8 Seagate cheetah 15k rpm drives, 8 gig ram, and the +slowest (1.8 GHz) AMD dual core CPUs (4 of them) for 8 cores, came out +to $13,500 or so. + +I'd take the other $7.5 grand and buy a backup server that can old as +much but isn't quite as beefy and set up slony to have a live hot spare +sitting ready. Oh, and maybe to buy some spare parts to sit in the desk +drawer in case things break. + +From pgsql-performance-owner@postgresql.org Tue Aug 8 19:15:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2FC079FB29F + for ; + Tue, 8 Aug 2006 19:15:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 48294-09 for + ; + Tue, 8 Aug 2006 19:15:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colo-dns-ext1.juniper.net (colo-dns-ext1.juniper.net + [207.17.137.57]) + by postgresql.org (Postfix) with ESMTP id C7EEB9FA666 + for ; + Tue, 8 Aug 2006 19:15:14 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext1.juniper.net (8.11.3/8.9.3) with ESMTP id k78MFDX18417; + Tue, 8 Aug 2006 15:15:13 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k78MF7g75386; + Tue, 8 Aug 2006 15:15:08 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k78MF7aV007809; + Tue, 8 Aug 2006 15:15:07 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k78MF3D2007807; + Tue, 8 Aug 2006 15:15:03 -0700 +Date: Tue, 8 Aug 2006 15:15:03 -0700 +From: Kenji Morishige +To: Scott Marlowe +Cc: pgsql-performance@postgresql.org, kenjim@juniper.net +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060808221503.GD6418@juniper.net> +References: <20060808204354.GN29379@juniper.net> + <1155074909.20252.85.camel@state.g2switchworks.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1155074909.20252.85.camel@state.g2switchworks.com> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/115 +X-Sequence-Number: 20300 + +Great info, which vendor were you looking at for these Opterons? I am goign +to be purchasing 2 of these. :) I do need 24/7 reliability. + +On Tue, Aug 08, 2006 at 05:08:29PM -0500, Scott Marlowe wrote: +> On Tue, 2006-08-08 at 15:43, Kenji Morishige wrote: +> > I've asked for some help here a few months ago and got some really helpfull +> > answers regarding RAID controllers and server configuration. Up until +> > recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +> > machine with a single channel RAID controller (previously Adaptec 2200S, but +> > now changed to LSI MegaRAID). The 2U unit is from a generic vendor using what +> > I believe is a SuperMicro motherboard. In the last week after upgrading the +> > RAID controller, the machine has had disk failure and some other issues. I +> > would like to build a very reliable dedicated postgreSQL server that has the +> > ultimate possible performance and reliabily for around $20,000. The data set +> > size is only currently about 4GB, but is increasing by approximately 50MB +> > daily. The server also requires about 500 connections and I have been +> > monitoring about 100-200 queries per second at the moment. I am planning to +> > run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +> > improves performance. +> +> This really depends on your usage patterns. +> +> OLAP or OLTP workloads? Do you need 24/7 reliability and therefore a +> two machine setup? There's a lot of variety in load. +> +> Generally, you spend your money on disks, then memory, then CPU, in that +> order. +> +> Look at the Areca cards, they've come highly recommended here. Look at +> LOTS of drives. Given the size of your db, you can go with LOTS of +> smaller drives and get good performance. If you can find a good box to +> hold 12 to 16 drives and fill it with 37 gig 15k RPM drives, you'll have +> lots of storage, even in RAID 1+0 config. That's aiming at +> transactional throughput. +> +> Toss as much memory as is reasonably affordable at it. That's normally +> in the 4 to 8 gig range. After that things start to get expensive fast. +> +> Multiple - dual core CPUs are a good idea. Opterons seem to be better +> "data pumps" with large memory and >2 CPUs than Intels right now. +> Better to have a 2xdual core opteron with slower processors than a +> single dual core or dual single core CPU(s) with a faster clock speed. +> As long as the memory access is equivalent, the more CPUs the better in +> Opterons, where their interconnect speed increases as you increase the +> number of CPUs. Intel Xeons are the opposite. Better with fewer faster +> CPUs / cores. +> +> I just ran through a configurator on a site selling quad dual core +> opteron servers. 8 Seagate cheetah 15k rpm drives, 8 gig ram, and the +> slowest (1.8 GHz) AMD dual core CPUs (4 of them) for 8 cores, came out +> to $13,500 or so. +> +> I'd take the other $7.5 grand and buy a backup server that can old as +> much but isn't quite as beefy and set up slony to have a live hot spare +> sitting ready. Oh, and maybe to buy some spare parts to sit in the desk +> drawer in case things break. + +From pgsql-performance-owner@postgresql.org Tue Aug 8 19:18:00 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 982F59FB2AA + for ; + Tue, 8 Aug 2006 19:18:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 48523-08 for + ; + Tue, 8 Aug 2006 19:17:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from m.wordtothewise.com (goliath.word-to-the-wise.com + [208.187.80.130]) + by postgresql.org (Postfix) with ESMTP id D81369FB2A8 + for ; + Tue, 8 Aug 2006 19:17:47 -0300 (ADT) +Received: from [10.3.2.25] (184.word-to-the-wise.com [208.187.80.184]) + (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by m.wordtothewise.com (Postfix) with ESMTP id CE2E8FF96 + for ; + Tue, 8 Aug 2006 15:17:45 -0700 (PDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <20060808204354.GN29379@juniper.net> +References: <20060808204354.GN29379@juniper.net> +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Content-Transfer-Encoding: 7bit +From: Steve Atkins +Subject: Re: most bang for buck with ~ $20,000 +Date: Tue, 8 Aug 2006 15:16:52 -0700 +To: pgsql-performance@postgresql.org +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/116 +X-Sequence-Number: 20301 + + +On Aug 8, 2006, at 1:43 PM, Kenji Morishige wrote: + +> +> +> I am considering a setup such as this: +> - At least dual cpu (possibly with 2 cores each) +> - 4GB of RAM +> - 2 disk RAID 1 array for root disk +> - 4 disk RAID 1+0 array for PGDATA +> - 2 disk RAID 1 array for pg_xlog +> +> Does anyone know a vendor that might be able provide such setup? Any +> critique in this design? I'm thinking having a 2 channel RAID +> controller to +> seperate the PGDATA, root and pg_xlog. + +It's fairly similar to the system I'm using - I have 6 spindles for +PGDATA rather than 4. It's a 9550SX SATA based box with +26 bays (16 empty right now) dual Opterons and 4 gigs of +RAM. About $7k from asacomputers.com. Performance is +good, drastically better than the SCSI Dell server it replaced, +but I've not benchmarked it. + +You mention 500 simultaneous connections. If that's really +500 simultaneous database connections (rather than, say, +500 simultaneous web users feeding into a pool of fewer +database connections) then that's a lot. I might go with a +bit more RAM than 4GB. + +You should have a lot left over from +$20k, and spending some of it on more RAM would be a good +investment (as might a better RAID controller than the 9550SX, +some dual core CPUs and maybe some more PGDATA spindles). + +Cheers, + Steve + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 19:28:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E6B669FB1D3 + for ; + Tue, 8 Aug 2006 19:28:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 56418-03 for + ; + Tue, 8 Aug 2006 22:28:16 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id B45499FA2EA + for ; + Tue, 8 Aug 2006 19:28:16 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k78MSHjO018842 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Tue, 8 Aug 2006 15:28:18 -0700 +Message-ID: <44D90FFE.7010807@commandprompt.com> +Date: Tue, 08 Aug 2006 15:28:14 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: "Thomas F. O'Connell" +CC: Kenji Morishige , pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> +In-Reply-To: <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 08 Aug 2006 15:28:18 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/117 +X-Sequence-Number: 20302 + +Thomas F. O'Connell wrote: +> +> On Aug 8, 2006, at 4:49 PM, Joshua D. Drake wrote: +> +>>> I am considering a setup such as this: +>>> - At least dual cpu (possibly with 2 cores each) +>>> - 4GB of RAM +>>> - 2 disk RAID 1 array for root disk +>>> - 4 disk RAID 1+0 array for PGDATA +>>> - 2 disk RAID 1 array for pg_xlog +>>> Does anyone know a vendor that might be able provide such setup? +> +> Wouldn't it be preferable to put WAL on a multi-disk RAID 10 if you had +> the opportunity? This gives you the redundancy of RAID 1 but approaches +> the performance of RAID 0, especially as you add disks to the array. In +> benchmarking, I've seen consistent success with this approach. + +WALL is written in order so RAID 1 is usually fine. We also don't need +journaling for WAL so the speed is even faster. + +Joshua D. Drake + +> +> -- +> Thomas F. O'Connell +> Sitening, LLC +> +> http://www.sitening.com/ +> 3004B Poston Avenue +> Nashville, TN 37203-1314 +> 615-469-5150 x802 +> 615-469-5151 (fax) +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 19:53:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 91BA99FB1F3 + for ; + Tue, 8 Aug 2006 19:53:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 51547-06 for + ; + Tue, 8 Aug 2006 19:53:24 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from georgia.textdrive.com (georgia.textdrive.com [207.7.107.246]) + by postgresql.org (Postfix) with ESMTP id B24339FA6A2 + for ; + Tue, 8 Aug 2006 19:53:24 -0300 (ADT) +Received: from [192.168.1.109] (unknown [209.149.57.250]) + by georgia.textdrive.com (Postfix) with ESMTP id DF99833C7C; + Tue, 8 Aug 2006 22:53:21 +0000 (GMT) +In-Reply-To: <44D90FFE.7010807@commandprompt.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> +Cc: Kenji Morishige , + pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: "Thomas F. O'Connell" +Subject: Re: most bang for buck with ~ $20,000 +Date: Tue, 8 Aug 2006 17:53:18 -0500 +To: Joshua D. Drake +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.225 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/118 +X-Sequence-Number: 20303 + + +On Aug 8, 2006, at 5:28 PM, Joshua D. Drake wrote: + +> Thomas F. O'Connell wrote: +>> On Aug 8, 2006, at 4:49 PM, Joshua D. Drake wrote: +>>>> I am considering a setup such as this: +>>>> - At least dual cpu (possibly with 2 cores each) +>>>> - 4GB of RAM +>>>> - 2 disk RAID 1 array for root disk +>>>> - 4 disk RAID 1+0 array for PGDATA +>>>> - 2 disk RAID 1 array for pg_xlog +>>>> Does anyone know a vendor that might be able provide such setup? +>> Wouldn't it be preferable to put WAL on a multi-disk RAID 10 if +>> you had the opportunity? This gives you the redundancy of RAID 1 +>> but approaches the performance of RAID 0, especially as you add +>> disks to the array. In benchmarking, I've seen consistent success +>> with this approach. +> +> WALL is written in order so RAID 1 is usually fine. We also don't +> need journaling for WAL so the speed is even faster. + +In which case, which is theoretically better (since I don't have a +convenient test bed at the moment) for WAL in a write-heavy +environment? More disks in a RAID 10 (which should theoretically +improve write throughput in general, to a point) or a 2-disk RAID 1? +Does it become a price/performance question, or is there virtually no +benefit to throwing more disks at RAID 10 for WAL if you turn off +journaling on the filesystem? + +-- +Thomas F. O'Connell +Sitening, LLC + +http://www.sitening.com/ +3004B Poston Avenue +Nashville, TN 37203-1314 +615-469-5150 x802 +615-469-5151 (fax) + +From pgsql-performance-owner@postgresql.org Tue Aug 8 20:24:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8DF1B9FB1F3 + for ; + Tue, 8 Aug 2006 20:24:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 62443-09 for + ; + Tue, 8 Aug 2006 23:24:10 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 111689FA6A2 + for ; + Tue, 8 Aug 2006 20:24:09 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k78NOAb6019848 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Tue, 8 Aug 2006 16:24:11 -0700 +Message-ID: <44D91D17.30106@commandprompt.com> +Date: Tue, 08 Aug 2006 16:24:07 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: "Thomas F. O'Connell" +CC: Kenji Morishige , pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> +In-Reply-To: <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 08 Aug 2006 16:24:12 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/119 +X-Sequence-Number: 20304 + +> +> In which case, which is theoretically better (since I don't have a +> convenient test bed at the moment) for WAL in a write-heavy environment? +> More disks in a RAID 10 (which should theoretically improve write +> throughput in general, to a point) or a 2-disk RAID 1? Does it become a +> price/performance question, or is there virtually no benefit to throwing +> more disks at RAID 10 for WAL if you turn off journaling on the filesystem? + +Over 4 drives, I would gather that RAID 10 wouldn't gain you anything. +Possibly over 6 or 8 however, it may be faster because you are writing +smaller chunks of data, even if two copies of each. + +Sincerely, + +Joshua D. Drake + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 21:17:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8B4569FB1F3 + for ; + Tue, 8 Aug 2006 21:17:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 69645-10 for + ; + Wed, 9 Aug 2006 00:16:56 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from georgia.textdrive.com (georgia.textdrive.com [207.7.107.246]) + by postgresql.org (Postfix) with ESMTP id 7311C9FB1D3 + for ; + Tue, 8 Aug 2006 21:16:56 -0300 (ADT) +Received: from [192.168.1.127] (c-68-53-89-150.hsd1.tn.comcast.net + [68.53.89.150]) + by georgia.textdrive.com (Postfix) with ESMTP id C207B33C7A; + Wed, 9 Aug 2006 00:16:51 +0000 (GMT) +In-Reply-To: <44D91D17.30106@commandprompt.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> + <44D91D17.30106@commandprompt.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <04EC241E-6D99-4114-814C-A4B837998EE3@sitening.com> +Cc: pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: "Thomas F. O'Connell" +Subject: Re: most bang for buck with ~ $20,000 +Date: Tue, 8 Aug 2006 19:16:45 -0500 +To: "Joshua D. Drake" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/120 +X-Sequence-Number: 20305 + + +On Aug 8, 2006, at 6:24 PM, Joshua D. Drake wrote: + +>> In which case, which is theoretically better (since I don't have a +>> convenient test bed at the moment) for WAL in a write-heavy +>> environment? More disks in a RAID 10 (which should theoretically +>> improve write throughput in general, to a point) or a 2-disk RAID +>> 1? Does it become a price/performance question, or is there +>> virtually no benefit to throwing more disks at RAID 10 for WAL if +>> you turn off journaling on the filesystem? +> +> Over 4 drives, I would gather that RAID 10 wouldn't gain you +> anything. Possibly over 6 or 8 however, it may be faster because +> you are writing smaller chunks of data, even if two copies of each. + +Yeah, where I've seen the benefits in practice, the scenarios have +involved the availability of a minimum of 6 drives for a RAID 10 for +WAL. I really should do a comparison of a 2-disk RAID 1 with a +variety of multi-disk RAID 10 configurations at some point. + +-- +Thomas F. O'Connell +Sitening, LLC + +http://www.sitening.com/ +3004B Poston Avenue +Nashville, TN 37203-1314 +615-469-5150 x802 +615-469-5151 (fax) + +From pgsql-performance-owner@postgresql.org Tue Aug 8 22:56:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8E7509FB212 + for ; + Tue, 8 Aug 2006 22:56:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 95507-06 for + ; + Wed, 9 Aug 2006 01:56:05 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw04.mi8.com [63.240.6.44]) + by postgresql.org (Postfix) with ESMTP id C1DC49FA154 + for ; + Tue, 8 Aug 2006 22:56:04 -0300 (ADT) +Received: from 172.16.1.148 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D4)); Tue, 08 Aug 2006 21:55:54 -0400 +X-Server-Uuid: C8FB4D43-1108-484A-A898-3CBCC7906230 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 8 Aug + 2006 21:55:21 -0400 +Received: from 63.80.24.130 ([63.80.24.130]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.134]) with Microsoft Exchange Server HTTP-DAV ; Wed, 9 Aug + 2006 01:55:21 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Tue, 08 Aug 2006 18:55:19 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Alex Turner" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca7Vt3VHFdt3CdKEduxKgAWy4o9DA== +In-Reply-To: <721b21dc0608080957k166a7bc5t72cb3cf076e6da01@mail.gmail.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 09 Aug 2006 01:55:21.0791 (UTC) + FILETIME=[DF7FBCF0:01C6BB56] +X-WSS-ID: 68C79F234M41084480-07-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.5 tagged_above=0 required=5 tests=RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/121 +X-Sequence-Number: 20306 + +Steve, + +On 8/8/06 9:57 AM, "Steve Poe" wrote: + +> On the Sun box, with 4 discs (RAID10) to one channel on the LSI RAID card, I +> see an average TPS around 70. If I ran this off of one disc, I see an average +> TPS of 32. +> +> on the HP box, with 6-discs in RAID10 and 1 spare. I see a TPS of 34. I don't +> have my vmstat reports with me, but I recall the CPU utilitization on the HP +> was about 50% higher. I need to check on this. + +Sounds like there are a few moving parts here, one of which is the ODBC +driver. + +First - using 7.4.x postgres is a big variable - not much experience on this +list with 7.4.x anymore. + +What OS versions are on the two machines? + +What is the network configuration of each - is a caching DNS server +available to each? What are the contents of /etc/resolv.conf? + +Have you run "top" on the machines while the benchmark is running? What is +the top running process, what is it doing (RSS, swap, I/O wait, etc)? + +Are any of the disks not healthy? Do you see any I/O errors in dmesg? + +Note that tarring up the database directory and untarring it actually +changes the block layout of the files on the disk from what the database +might have done when it was created. When you create a tar archive of the +files in the DB directory, their contents will be packed in file name order +in the tar archive and unpacked that way as well. By comparison, the +ordering when the database lays them on disk might have been quite +different. This doesn't impact the problem you describe as you are +unpacking the tar file on both machines to start the process (right?). + +- Luke + + + +From pgsql-performance-owner@postgresql.org Tue Aug 8 23:29:56 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D05669FB212 + for ; + Tue, 8 Aug 2006 23:29:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 16830-01 for + ; + Wed, 9 Aug 2006 02:29:48 +0000 (UTC) +X-Greylist: delayed 00:19:20.382586 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 8C0A29FB219 + for ; + Tue, 8 Aug 2006 23:29:48 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from bifrost.lang.hm (dsl081-033-126.lax1.dsl.speakeasy.net + [64.81.33.126]) + by svr4.postgresql.org (Postfix) with ESMTP id 7DA465AF039 + for ; + Wed, 9 Aug 2006 02:10:26 +0000 (GMT) +Received: from david.lang.hm (IDENT:1000@david.lang.hm [10.0.0.5]) + by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id + k792AGTP001311; Tue, 8 Aug 2006 19:10:16 -0700 +Date: Tue, 8 Aug 2006 19:10:16 -0700 (PDT) +From: David Lang +X-X-Sender: dlang@david.lang.hm +To: Stephen Frost +Cc: Alex Turner , Alvaro Nunes Melo , + pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +In-Reply-To: <20060808120529.GL20016@kenobi.snowman.net> +Message-ID: +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.519 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_SOFTFAIL +X-Spam-Level: * +X-Archive-Number: 200608/122 +X-Sequence-Number: 20307 + +On Tue, 8 Aug 2006, Stephen Frost wrote: + +> * Alex Turner (armtuk@gmail.com) wrote: +>> First off - very few third party tools support debian. Debian is a sure +>> fire way to have an unsupported system. Use RedHat or SuSe (flame me all +>> you want, it doesn't make it less true). +> +> Yeah, actually, it does make it less true since, well, it's really not +> all that true to begin with. +> +> What you're probably intending to say is that fewer companies say "Works +> with Debian!" on their advertising material or list it as "officially +> supported". I've had *very* few problems running commercial apps on +> Debian (including things like Oracle and IBM SAN management software). +> Generally it's just take the rpms and either install them *using* rpm +> (which is available in Debian...) or use alien to convert them to a +> tarball and/or deb. + +there's a huge difference between 'works on debian' and 'supported on +debian'. I do use debian extensivly, (along with slackware on my personal +machines), so i am comfortable getting things to work. but 'supported' +means that when you run into a problem you can call for help without being +told 'sorry, switch distros, then call us back'. + +even many of the companies that offer support for postgres have this +problem. the explination is always that they can't test every distro out +there so they pick a few and support those (this is one of the reasons why +I am watching ubuntu with great interest, it's debian under the covers, +but they're starting to get the recognition from the support groups of +companies) + +David Lang + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 01:56:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 667979FB2DE + for ; + Wed, 9 Aug 2006 01:56:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 44808-09 for + ; + Wed, 9 Aug 2006 04:56:03 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.186]) + by postgresql.org (Postfix) with ESMTP id F36D99FA6B5 + for ; + Wed, 9 Aug 2006 01:56:02 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so25288nfc + for ; + Tue, 08 Aug 2006 21:56:01 -0700 (PDT) +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:references; + b=txxnTmM8lPh3pPgenYBPVywZq/5BeBwYI/MdMx665DdvbMBjqIs4N66tLJNbDP3LsvKL8HsiTNFFKZ9NPpiE7GVz534WxKoULIlJLnYgNgd1WyrIzHP1P1ep1XvZmMo8sPMt5aq6g7kVlMC7cRx/o980sN9XbjQd/B+dAJJVldQ= +Received: by 10.78.142.14 with SMTP id p14mr146305hud; + Tue, 08 Aug 2006 21:56:01 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 21:56:01 -0700 (PDT) +Message-ID: <721b21dc0608082156s477622d5jbc2947d192b2e7bc@mail.gmail.com> +Date: Tue, 8 Aug 2006 21:56:01 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_27960_24930659.1155099361691" +References: <721b21dc0608080957k166a7bc5t72cb3cf076e6da01@mail.gmail.com> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.375 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_MESSAGE, NORMAL_HTTP_TO_IP, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/123 +X-Sequence-Number: 20308 + +------=_Part_27960_24930659.1155099361691 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +> +> >Sounds like there are a few moving parts here, one of which is the ODBC +> >driver. + + +Yes, I need to use it since my clients use it for their veterinary +application. + + +>First - using 7.4.x postgres is a big variable - not much experience on +> this +> >list with 7.4.x anymore. + + +Like the previous, we have to use it since the manufacturer/vendor uses a +4GL language which only supports Postgresql 7.4.x + +>What OS versions are on the two machines? + + +Centos 4.3 x84_64 on both boxes. + + +>What is the network configuration of each - is a caching DNS server +> >available to each? What are the contents of /etc/resolv.conf? + + +The database is configured for the local/loopback on 127.0.0.1. This is my +local network. No DNS. + + +>Have you run "top" on the machines while the benchmark is running? What is +> >the top running process, what is it doing (RSS, swap, I/O wait, etc)? + + +I am not running top, but here's an average per second for the 20-25min +run from vmstat presented in a high/peak, low and median + +Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 LSI MegaRAID +128MB). This is after 8 runs. + +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,swapd,128,128,128 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,free,21596,21050,21327 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,buffers,1171,174,595 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,cache,3514368,3467427,3495081 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,bi,97276,1720,31745 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,bo,9209,832,4674 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,in,25906,23204,24115 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,cs,49849,46035,47617 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 + +Average TPS is 75 + +HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 with 192MB RAM. +After 8 runs, I see: + +intown-vetstar-amd64,08/09/06,Tuesday,23,r,0,0,0 +intown-vetstar-amd64,08/09/06,Tuesday,23,b,2,0,0 +intown-vetstar-amd64,08/09/06,Tuesday,23,swapd,0,0,0 +intown-vetstar-amd64,08/09/06,Tuesday,23,free,33760,16501,17931 +intown-vetstar-amd64,08/09/06,Tuesday,23,buffers,1578,673,1179 +intown-vetstar-amd64,08/09/06,Tuesday,23,cache,7881745,7867700,7876327 +intown-vetstar-amd64,08/09/06,Tuesday,23,bi,66536,0,4480 +intown-vetstar-amd64,08/09/06,Tuesday,23,bo,5991,2,2806 +intown-vetstar-amd64,08/09/06,Tuesday,23,in,1624,260,573 +intown-vetstar-amd64,08/09/06,Tuesday,23,cs,2342,17,1464 +intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 + +Average TPS is 31. + + +>Are any of the disks not healthy? Do you see any I/O errors in dmesg? + + +I don't know. I do the following message: +"PCI: MSI quirk detected. PCI_BUS_FLAGS_NO_MSI set for subordinate bus" + +Otherwise, no disc error messages. + +Note that tarring up the database directory and untarring it actually +> changes the block layout of the files on the disk from what the database +> might have done when it was created. When you create a tar archive of the +> files in the DB directory, their contents will be packed in file name +> order +> in the tar archive and unpacked that way as well. By comparison, the +> ordering when the database lays them on disk might have been quite +> different. This doesn't impact the problem you describe as you are +> unpacking the tar file on both machines to start the process (right?). + + +Yes, I am running this on both machines with the same RPMs of Postgresql and +same conf files. + +Also, just for this testing, I am not unmounting, formatting, untaring. I am +doing it once than running the series of tests (usually 10 runs). + +Thanks again for your time. If you're in the SF area, I'll owe you lunch and +> beer. + + + +Steve + +------=_Part_27960_24930659.1155099361691 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +
>Sounds like there are a few moving parts here, one of which is the ODBC
>driver. +

Yes, I need to use it since my clients use it for their veterinary application.
 

+>First - using 7.4.x postgres is a big variable - not much experience on this
>list with 7.4.x anymore.

Like the previous, we have to use it since the manufacturer/vendor uses a 4GL language which only supports Postgresql +7.4.x

>What OS versions are on the two machines?

Centos +4.3 x84_64 on both boxes.
 

>What is the network configuration of each - is a caching DNS server +
>available to each?  What are the contents of /etc/resolv.conf?

The database is configured for the local/loopback on 127.0.0.1. This is my local network. No DNS.

>Have you run "top" on the machines while the benchmark is running?  What is +
>the top running process, what is it doing (RSS, swap, I/O wait, etc)?

I am not running top, but here's  an  average per second for the 20-25min run from vmstat presented in a high/peak, low and median +

Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 LSI MegaRAID 128MB). This is after 8 runs.

dbserver-dual-opteron-centos,08/08/06,Tuesday,20,swapd,128,128,128
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,free,21596,21050,21327 +
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,buffers,1171,174,595
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,cache,3514368,3467427,3495081
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,bi,97276,1720,31745 +
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,bo,9209,832,4674
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,in,25906,23204,24115
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,cs,49849,46035,47617
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0
dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38

Average TPS is 75

+HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 with 192MB RAM. After 8 runs, I see:

intown-vetstar-amd64,08/09/06,Tuesday,23,r,0,0,0
intown-vetstar-amd64,08/09/06,Tuesday,23,b,2,0,0
intown-vetstar-amd64,08/09/06,Tuesday,23,swapd,0,0,0 +
intown-vetstar-amd64,08/09/06,Tuesday,23,free,33760,16501,17931
intown-vetstar-amd64,08/09/06,Tuesday,23,buffers,1578,673,1179
intown-vetstar-amd64,08/09/06,Tuesday,23,cache,7881745,7867700,7876327
intown-vetstar-amd64,08/09/06,Tuesday,23,bi,66536,0,4480 +
intown-vetstar-amd64,08/09/06,Tuesday,23,bo,5991,2,2806
intown-vetstar-amd64,08/09/06,Tuesday,23,in,1624,260,573
intown-vetstar-amd64,08/09/06,Tuesday,23,cs,2342,17,1464
intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +
intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1
intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50
intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42

Average TPS is 31.
 

+>Are any of the disks not healthy?  Do you see any I/O errors in dmesg?

I don't know. I do the following message:
"PCI: MSI quirk detected. PCI_BUS_FLAGS_NO_MSI set for subordinate bus" +
 
Otherwise, no disc error messages.

Note that tarring up the database directory and untarring it actually +
changes the block layout of the files on the disk from what the database
might have done when it was created.  When you create a tar archive of the
files in the DB directory, their contents will be packed in file name order +
in the tar archive and unpacked that way as well.  By comparison, the
ordering when the database lays them on disk might have been quite
different.  This doesn't impact the problem you describe as you are
unpacking the tar file on both machines to start the process (right?). +

Yes, I am running this on both machines with the same RPMs of Postgresql and same conf files.

Also, just for this testing, I am not unmounting, formatting, untaring. I am doing it once than running the series of tests (usually 10 runs). +

Thanks again for your time. If you're in the SF area, I'll owe you lunch and beer. +


Steve


+ +------=_Part_27960_24930659.1155099361691-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 02:22:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1CD6C9FB267 + for ; + Wed, 9 Aug 2006 02:22:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 07624-03 for + ; + Wed, 9 Aug 2006 02:22:43 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.181]) + by postgresql.org (Postfix) with ESMTP id DA6C79FA6B5 + for ; + Wed, 9 Aug 2006 02:22:41 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id n25so165450pyg + for ; + Tue, 08 Aug 2006 22:22:40 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:subject:from:reply-to:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=EFT5PU4uWb+MlJZysDxNOxITVtF8zg9j0GaiUse3pS44VV44vF9YOGBI01FZoq5waveHJMengfObTHsM62IubSVMbFS0tC4yFVNuLiuOYc7q6yNmXzFg+UmwZD9LiZNVoxoHTVUhbhginEZ2QkP14vEGq9se/7VgzUec2Wrm7GY= +Received: by 10.35.99.5 with SMTP id b5mr863336pym; + Tue, 08 Aug 2006 22:22:40 -0700 (PDT) +Received: from amd64-gentoo-laptop ( [66.167.78.2]) + by mx.gmail.com with ESMTP id 38sm312446nzf.2006.08.08.22.22.39; + Tue, 08 Aug 2006 22:22:40 -0700 (PDT) +Subject: Re: Postgresql Performance on an HP DL385 and +From: Steve Poe +Reply-To: steve.poe@gmail.com +To: Luke Lonergan +Cc: Alex Turner , pgsql-performance@postgresql.org +In-Reply-To: +References: +Content-Type: text/plain +Date: Tue, 08 Aug 2006 22:22:31 -0700 +Message-Id: <1155100951.21499.3.camel@amd64-gentoo-laptop> +Mime-Version: 1.0 +X-Mailer: Evolution 2.4.2.1 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/124 +X-Sequence-Number: 20309 + +> Are any of the disks not healthy? Do you see any I/O errors in dmesg? + +Luke, + +In my vmstat report, I it is an average per minute not per-second. Also, +I found that in the first minute of the very first run, the HP's "bi" +value hits a high of 221184 then it tanks after that. + +Steve + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 02:25:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AB6D19FA6B5 + for ; + Wed, 9 Aug 2006 02:25:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 04704-08 for + ; + Wed, 9 Aug 2006 02:25:51 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id 5DA3A9FB2DE + for ; + Wed, 9 Aug 2006 02:25:50 -0300 (ADT) +Received: from 172.16.1.148 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Wed, 09 Aug 2006 01:25:41 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Aug + 2006 01:24:40 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Wed, 9 Aug 2006 01:22:35 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca7cCvHwB/KRgeHRgOnsgJKiNTc7AAA0SKg +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Alex Turner" , + pgsql-performance@postgresql.org +X-OriginalArrivalTime: 09 Aug 2006 05:24:40.0501 (UTC) + FILETIME=[1D12CE50:01C6BB74] +X-WSS-ID: 68C7AE5F3786161303-02-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/125 +X-Sequence-Number: 20310 + +Steve,=20 + +> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10=20 +> LSI MegaRAID 128MB). This is after 8 runs. +>=20 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +>=20 +> Average TPS is 75 +>=20 +> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642=20 +> with 192MB RAM. After 8 runs, I see: +>=20 +> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +>=20 +> Average TPS is 31. + +Note that the I/O wait (wa) on the HP box high, low and average are all +*much* higher than on the Sun box. The average I/O wait was 50% of one +CPU, which is huge. By comparison there was virtually no I/O wait on +the Sun machine. + +This is indicating that your HP machine is indeed I/O bound and +furthermore is tying up a PG process waiting for the disk to return. + +- Luke + + +From pgsql-admin-owner@postgresql.org Wed Aug 9 02:25:09 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 1DB6C9FB267 + for ; + Wed, 9 Aug 2006 02:25:09 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 69315-06 for ; + Wed, 9 Aug 2006 05:25:05 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id B312D9FA6B5 + for ; Wed, 9 Aug 2006 02:25:05 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from smtp23.poczta.onet.pl (smtp23.poczta.onet.pl [213.180.130.94]) + by svr4.postgresql.org (Postfix) with ESMTP id A30C05AF04C + for ; Wed, 9 Aug 2006 05:25:04 +0000 (GMT) +Received: from smtp3k.poczta.onet.pl ([213.180.130.37]:23252 "EHLO + smtp3k.poczta.onet.pl") by ps23.test.onet.pl with ESMTP + id ; Wed, 9 Aug 2006 07:24:38 +0200 +Received: from pk4.test.onet.pl ([192.168.241.244]:30866 "EHLO + pk4.test.onet.pl") by kps3.test.onet.pl with ESMTP + id ; Wed, 9 Aug 2006 07:23:25 +0200 +Content-Type: text/plain; charset=US-ASCII +Content-Disposition: inline +Content-Transfer-Encoding: 7BIT +MIME-Version: 1.0 +Received: from 170.252.80.2 by 192.168.240.48 with HTTP; Wed, + 09 Aug 2006 7:23:25 +0200 +Date: Wed, 09 Aug 2006 07:23:25 +0200 +From: Andrzej B.J.Schulz +To: pgsql-admin@postgresql.org +Subject: unsubscribe +X-Priority: 3 +X-Mailer: onet.poczta +Message-Id: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.85 tagged_above=0 required=5 + tests=DNS_FROM_RFC_POST, RCVD_DOUBLE_IP_LOOSE, SPF_FAIL +X-Spam-Level: ** +X-Archive-Number: 200608/108 +X-Sequence-Number: 22651 + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 02:27:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AFA7F9FB267 + for ; + Wed, 9 Aug 2006 02:27:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 06422-07 for + ; + Wed, 9 Aug 2006 02:27:21 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id 912BC9FA6B5 + for ; + Wed, 9 Aug 2006 02:27:21 -0300 (ADT) +Received: from 172.16.1.112 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Wed, 09 Aug 2006 01:27:09 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Aug + 2006 01:26:21 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Wed, 9 Aug 2006 01:24:16 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D03FFEF6F@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca7c+AAIzMy6AndSQ+kSQqAe1ncZQAAAC0w +From: "Luke Lonergan" +To: steve.poe@gmail.com +cc: "Alex Turner" , + pgsql-performance@postgresql.org +X-OriginalArrivalTime: 09 Aug 2006 05:26:21.0163 (UTC) + FILETIME=[59129BB0:01C6BB74] +X-WSS-ID: 68C7AD943786161458-08-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.013 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/126 +X-Sequence-Number: 20311 + +Steve,=20 + +> > Are any of the disks not healthy? Do you see any I/O=20 +> errors in dmesg? +>=20 +> In my vmstat report, I it is an average per minute not=20 +> per-second. Also, I found that in the first minute of the=20 +> very first run, the HP's "bi" +> value hits a high of 221184 then it tanks after that. + +Based on the difference in I/O wait on the two machines, there's +definitely something up with the disk subsystem on the HP - try checking +the BIOS on the HP 642 - I bet you'll find a disk error lurking there. + +- Luke + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 02:35:32 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 9C7AE9FAE4E + for ; + Wed, 9 Aug 2006 02:35:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 77254-02 for + ; + Wed, 9 Aug 2006 05:35:22 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from olive.qinip.net (olive.qinip.net [62.100.30.40]) + by postgresql.org (Postfix) with ESMTP id 82D199FA7BA + for ; + Wed, 9 Aug 2006 02:35:22 -0300 (ADT) +Received: from [127.0.0.1] (h8441139206.dsl.speedlinq.nl [84.41.139.206]) + by olive.qinip.net (Postfix) with ESMTP id D48A1180D6; + Wed, 9 Aug 2006 07:35:18 +0200 (MEST) +Message-ID: <44D9741A.9090303@tweakers.net> +Date: Wed, 09 Aug 2006 07:35:22 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Kenji Morishige +CC: pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> +In-Reply-To: <20060808204354.GN29379@juniper.net> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Antivirus: avast! (VPS 0632-0, 08-08-2006), Outbound message +X-Antivirus-Status: Clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/127 +X-Sequence-Number: 20312 + +With such a budget you should easily be able to get something like: +- A 1U high-performance server (for instance the Dell 1950 with 2x +Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +controller and some disks internally) +- An external SAS direct attached disks storage enclosure full with 15k +rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) + +Going for the dell-solution would set you back "only" (including +savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +a DL380G5/DL385 with two MSA50's for instance) which also fit in your +budget afaik. The other players tend to be (a bit) more expensive, force +you to go with Fibre Channel or "ancient" SCSI external storage ;) + +If you'd like to have a product by a generic vendor, have a look at the +Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +sas/sata bays in 2U) for storage. + +If you're limited to only 2U of rack space, its a bit more difficult to +get maximum I/O in your budget (you have basically space for about 8 or +12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +But you should still be able to have two top-off-the-line x86 cpu's (amd +opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +which is pretty expensive). + +Best regards, + +Arjen van der Meijden + + +On 8-8-2006 22:43, Kenji Morishige wrote: +> I've asked for some help here a few months ago and got some really helpfull +> answers regarding RAID controllers and server configuration. Up until +> recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +> machine with a single channel RAID controller (previously Adaptec 2200S, but +> now changed to LSI MegaRAID). The 2U unit is from a generic vendor using what +> I believe is a SuperMicro motherboard. In the last week after upgrading the +> RAID controller, the machine has had disk failure and some other issues. I +> would like to build a very reliable dedicated postgreSQL server that has the +> ultimate possible performance and reliabily for around $20,000. The data set +> size is only currently about 4GB, but is increasing by approximately 50MB +> daily. The server also requires about 500 connections and I have been +> monitoring about 100-200 queries per second at the moment. I am planning to +> run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +> improves performance. +> +> I am considering a setup such as this: +> - At least dual cpu (possibly with 2 cores each) +> - 4GB of RAM +> - 2 disk RAID 1 array for root disk +> - 4 disk RAID 1+0 array for PGDATA +> - 2 disk RAID 1 array for pg_xlog +> +> Does anyone know a vendor that might be able provide such setup? Any +> critique in this design? I'm thinking having a 2 channel RAID controller to +> seperate the PGDATA, root and pg_xlog. +> +> Sincerely, +> Kenji +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster +> + +From pgsql-performance-owner@postgresql.org Wed Aug 9 02:45:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 98B039FB1CA + for ; + Wed, 9 Aug 2006 02:45:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 06589-08 for + ; + Wed, 9 Aug 2006 02:45:09 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.188]) + by postgresql.org (Postfix) with ESMTP id B784A9FA7BA + for ; + Wed, 9 Aug 2006 02:45:08 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so36597nfc + for ; + Tue, 08 Aug 2006 22:45:07 -0700 (PDT) +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:references; + b=BZZ4CmbSpmEN05Fe5FkdHuoQ9Q1XNuB7CPOf3p44v7xJmuGZnPaFTlrBH5LfobqbE8iqeEYsuuo0iSvaoBK0/C34hqsEoSu8+RolGrhj/Q0j3GLE3KQwjWQlBNxvwOcWLpEwmBWlN+hka/pfOcnmPz4g4P0V5p40s7tFaudK4Sc= +Received: by 10.78.107.8 with SMTP id f8mr152855huc; + Tue, 08 Aug 2006 22:45:07 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 22:45:07 -0700 (PDT) +Message-ID: <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> +Date: Tue, 8 Aug 2006 22:45:07 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_28456_33520875.1155102307237" +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.388 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/128 +X-Sequence-Number: 20313 + +------=_Part_28456_33520875.1155102307237 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +I thought so. In my test, I tried to be fair/equal since my Sun box has two +4-disc arrays each on their own channel. So, I just used one of them which +should be a little slower than the 6-disc with 192MB cache. + +Incidently, the two internal SCSI drives, which are on the 6i adapter, +generated a TPS of 18. + +I thought this server would impressive from notes I've read in the group. +This is why I thought I might be doing something wrong. I stumped which way +to take this. There is no obvious fault but something isn't right. + +Steve + +On 8/8/06, Luke Lonergan wrote: +> +> Steve, +> +> > Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 +> > LSI MegaRAID 128MB). This is after 8 runs. +> > +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> > +> > Average TPS is 75 +> > +> > HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +> > with 192MB RAM. After 8 runs, I see: +> > +> > intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> > intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> > intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> > intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> > +> > Average TPS is 31. +> +> Note that the I/O wait (wa) on the HP box high, low and average are all +> *much* higher than on the Sun box. The average I/O wait was 50% of one +> CPU, which is huge. By comparison there was virtually no I/O wait on +> the Sun machine. +> +> This is indicating that your HP machine is indeed I/O bound and +> furthermore is tying up a PG process waiting for the disk to return. +> +> - Luke +> +> + +------=_Part_28456_33520875.1155102307237 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

I thought so. In my test, I tried to be fair/equal since my Sun box has two 4-disc arrays each on their own channel. So, I just used one of them which should be a little slower than the 6-disc with 192MB cache. +

Incidently, the two internal SCSI drives, which are on the 6i adapter, generated a TPS of 18.

I thought this server would impressive from notes I've read in the group. This is why I thought I might be doing something wrong. I stumped which way to take this. There is no obvious fault but something isn't right. +

Steve

On 8/8/06, Luke Lonergan <LLonergan@greenplum.com> wrote:
+Steve,

> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10
> LSI MegaRAID 128MB). This is after 8 runs.
>
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38
>
> Average TPS is 75
>
> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +
> with 192MB RAM. After 8 runs, I see:
>
> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3
> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1
> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +
> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42
>
> Average TPS is 31.

Note that the I/O wait (wa) on the HP box high, low and average are all
*much* higher than on the Sun box.  The average I/O wait was 50% of one +
CPU, which is huge.  By comparison there was virtually no I/O wait on
the Sun machine.

This is indicating that your HP machine is indeed I/O bound and
furthermore is tying up a PG process waiting for the disk to return. +

- Luke


+ +------=_Part_28456_33520875.1155102307237-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 03:30:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 9A8589FB2E0 + for ; + Wed, 9 Aug 2006 03:30:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 80823-08 for + ; + Wed, 9 Aug 2006 06:30:29 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colo-dns-ext2.juniper.net (colo-dns-ext2.juniper.net + [207.17.137.64]) + by postgresql.org (Postfix) with ESMTP id 7AADD9FB2D5 + for ; + Wed, 9 Aug 2006 03:30:29 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext2.juniper.net (8.12.3/8.12.3) with ESMTP id + k796US1Z046209; Tue, 8 Aug 2006 23:30:28 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k796UNg41956; + Tue, 8 Aug 2006 23:30:24 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k796UN6h028023; + Tue, 8 Aug 2006 23:30:23 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k796UEsd028017; + Tue, 8 Aug 2006 23:30:14 -0700 +Date: Tue, 8 Aug 2006 23:30:14 -0700 +From: Kenji Morishige +To: Arjen van der Meijden +Cc: pgsql-performance@postgresql.org, kenjim@juniper.net +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060809063014.GO6418@juniper.net> +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44D9741A.9090303@tweakers.net> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/129 +X-Sequence-Number: 20314 + +I have unlimited rack space, so 2U is not the issue. The boxes are stored in +our lab for internal software tools. I'm going to research those boxes you +mention. Regarding the JBOD enclosures, are these generally just 2U or 4U +units with SCSI interface connectors? I didn't see these types of boxes +availble on Dell website, I'll look again. +-Kenji + +On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +> With such a budget you should easily be able to get something like: +> - A 1U high-performance server (for instance the Dell 1950 with 2x +> Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +> controller and some disks internally) +> - An external SAS direct attached disks storage enclosure full with 15k +> rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +> +> Going for the dell-solution would set you back "only" (including +> savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +> a DL380G5/DL385 with two MSA50's for instance) which also fit in your +> budget afaik. The other players tend to be (a bit) more expensive, force +> you to go with Fibre Channel or "ancient" SCSI external storage ;) +> +> If you'd like to have a product by a generic vendor, have a look at the +> Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +> sas/sata bays in 2U) for storage. +> +> If you're limited to only 2U of rack space, its a bit more difficult to +> get maximum I/O in your budget (you have basically space for about 8 or +> 12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +> But you should still be able to have two top-off-the-line x86 cpu's (amd +> opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +> which is pretty expensive). +> +> Best regards, +> +> Arjen van der Meijden +> +> +> On 8-8-2006 22:43, Kenji Morishige wrote: +> >I've asked for some help here a few months ago and got some really helpfull +> >answers regarding RAID controllers and server configuration. Up until +> >recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +> >machine with a single channel RAID controller (previously Adaptec 2200S, +> >but +> >now changed to LSI MegaRAID). The 2U unit is from a generic vendor using +> >what +> >I believe is a SuperMicro motherboard. In the last week after upgrading +> >the +> >RAID controller, the machine has had disk failure and some other issues. I +> >would like to build a very reliable dedicated postgreSQL server that has +> >the +> >ultimate possible performance and reliabily for around $20,000. The data +> >set +> >size is only currently about 4GB, but is increasing by approximately 50MB +> >daily. The server also requires about 500 connections and I have been +> >monitoring about 100-200 queries per second at the moment. I am planning +> >to +> >run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +> >improves performance. +> > +> >I am considering a setup such as this: +> > - At least dual cpu (possibly with 2 cores each) +> > - 4GB of RAM +> > - 2 disk RAID 1 array for root disk +> > - 4 disk RAID 1+0 array for PGDATA +> > - 2 disk RAID 1 array for pg_xlog +> > +> >Does anyone know a vendor that might be able provide such setup? Any +> >critique in this design? I'm thinking having a 2 channel RAID controller to +> >seperate the PGDATA, root and pg_xlog. +> > +> >Sincerely, +> >Kenji +> > +> >---------------------------(end of broadcast)--------------------------- +> >TIP 2: Don't 'kill -9' the postmaster +> > + +From pgsql-performance-owner@postgresql.org Wed Aug 9 03:33:24 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 877459FB2DF + for ; + Wed, 9 Aug 2006 03:33:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 13380-02 for + ; + Wed, 9 Aug 2006 03:33:12 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.184]) + by postgresql.org (Postfix) with ESMTP id A778A9FB2D5 + for ; + Wed, 9 Aug 2006 03:33:12 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so49190nfc + for ; + Tue, 08 Aug 2006 23:33:11 -0700 (PDT) +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:references; + b=aW0sk0DTyKeGI1pPHk2p3xUSKz+/858qbceEBqTlGEh8rMkLuVMUYWLBfC7Ayx8LY91Q2EoT3cdZ9VLm3gcTHs0L82/W6n24SQe+lDhNb2Q7WJVHMHMDiBOZyNuELOal0xl8W02ONoPRYjeRGdjBqsmnNyLuq1NNyRI+YELe0A4= +Received: by 10.78.165.13 with SMTP id n13mr178016hue; + Tue, 08 Aug 2006 23:33:11 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 23:33:10 -0700 (PDT) +Message-ID: <721b21dc0608082333l70534248gb33c80ca200cf711@mail.gmail.com> +Date: Tue, 8 Aug 2006 23:33:10 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_28817_20494638.1155105190869" +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.448 tagged_above=0 required=5 tests=AWL, HTML_30_40, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/130 +X-Sequence-Number: 20315 + +------=_Part_28817_20494638.1155105190869 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +I check dmesg one more time and I found this regarding the cciss driver: + +Filesystem "cciss/c1d0p1": Disabling barriers, not supported by the +underlying device. + +Don't know if it means anything, but thought I'd mention it. + +Steve + +On 8/8/06, Steve Poe wrote: +> +> Luke, +> +> I thought so. In my test, I tried to be fair/equal since my Sun box has +> two 4-disc arrays each on their own channel. So, I just used one of them +> which should be a little slower than the 6-disc with 192MB cache. +> +> Incidently, the two internal SCSI drives, which are on the 6i adapter, +> generated a TPS of 18. +> +> I thought this server would impressive from notes I've read in the group. +> This is why I thought I might be doing something wrong. I stumped which way +> to take this. There is no obvious fault but something isn't right. +> +> Steve +> +> +> On 8/8/06, Luke Lonergan wrote: +> > +> > Steve, +> > +> > > Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 +> > > LSI MegaRAID 128MB). This is after 8 runs. +> > > +> > > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> > > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> > > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> > > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> > > +> > > Average TPS is 75 +> > > +> > > HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +> > > with 192MB RAM. After 8 runs, I see: +> > > +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> > > +> > > Average TPS is 31. +> > +> > Note that the I/O wait (wa) on the HP box high, low and average are all +> > *much* higher than on the Sun box. The average I/O wait was 50% of one +> > CPU, which is huge. By comparison there was virtually no I/O wait on +> > the Sun machine. +> > +> > This is indicating that your HP machine is indeed I/O bound and +> > furthermore is tying up a PG process waiting for the disk to return. +> > +> > - Luke +> > +> > +> + +------=_Part_28817_20494638.1155105190869 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

I check dmesg one more time and I found this regarding the cciss driver:

Filesystem "cciss/c1d0p1": Disabling barriers, not supported by the underlying device.

Don't know if it means anything, but thought I'd mention it. +

Steve

On 8/8/06, Steve Poe <steve.poe@gmail.com> wrote:
+
Luke,

I thought so. In my test, I tried to be fair/equal since my Sun box has two 4-disc arrays each on their own channel. So, I just used one of them which should be a little slower than the 6-disc with 192MB cache. +

Incidently, the two internal SCSI drives, which are on the 6i adapter, generated a TPS of 18.

I thought this server would impressive from notes I've read in the group. This is why I thought I might be doing something wrong. I stumped which way to take this. There is no obvious fault but something isn't right. +

Steve


On 8/8/06, Luke Lonergan < +LLonergan@greenplum.com> wrote:
+Steve,

> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10
> LSI MegaRAID 128MB). This is after 8 runs.
>
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38
>
> Average TPS is 75
>
> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +
> with 192MB RAM. After 8 runs, I see:
>
> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3
> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1
> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +
> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42
>
> Average TPS is 31.

Note that the I/O wait (wa) on the HP box high, low and average are all
*much* higher than on the Sun box.  The average I/O wait was 50% of one +
CPU, which is huge.  By comparison there was virtually no I/O wait on
the Sun machine.

This is indicating that your HP machine is indeed I/O bound and
furthermore is tying up a PG process waiting for the disk to return. +

- Luke


+ +

+ +------=_Part_28817_20494638.1155105190869-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 03:38:16 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5C9B69FB2DF + for ; + Wed, 9 Aug 2006 03:38:16 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 88054-03 for + ; + Wed, 9 Aug 2006 06:38:12 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) + by postgresql.org (Postfix) with ESMTP id 4938C9FB2D5 + for ; + Wed, 9 Aug 2006 03:38:12 -0300 (ADT) +Received: from 172.16.1.112 by mail.Mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D1)); Wed, 09 Aug 2006 02:38:03 -0400 +X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Aug + 2006 02:38:03 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Wed, 9 Aug 2006 02:35:59 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D03FFEF75@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca7fchJBoHinWHuSKqpRtiHHnOooAAABfhQ +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Alex Turner" , + pgsql-performance@postgresql.org +X-OriginalArrivalTime: 09 Aug 2006 06:38:03.0697 (UTC) + FILETIME=[5D953210:01C6BB7E] +X-WSS-ID: 68C75D4111K4287094-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/131 +X-Sequence-Number: 20316 + +Steve, + +At the end of the day it seems that you've got a support issue with the +SmartArray RAID adapter from HP.=20 + +Last I tried that I found that they don't write the cciss driver, don't +test it for performance on Linux and don't make any claims about it's +performance on Linux. + +That said - can you contact them through HP tech support and report back +to this list what you find out? + +- Luke +> -----Original Message----- +> From: Steve Poe [mailto:steve.poe@gmail.com]=20 +> Sent: Tuesday, August 08, 2006 11:33 PM +> To: Luke Lonergan +> Cc: Alex Turner; pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Postgresql Performance on an HP DL385 and +>=20 +> Luke, +>=20 +> I check dmesg one more time and I found this regarding the=20 +> cciss driver: +>=20 +> Filesystem "cciss/c1d0p1": Disabling barriers, not supported=20 +> by the underlying device. +>=20 +> Don't know if it means anything, but thought I'd mention it.=20 +>=20 +> Steve +>=20 +>=20 +> On 8/8/06, Steve Poe wrote: +>=20 +> Luke, +> =09 +> I thought so. In my test, I tried to be fair/equal=20 +> since my Sun box has two 4-disc arrays each on their own=20 +> channel. So, I just used one of them which should be a little=20 +> slower than the 6-disc with 192MB cache.=20 +> =09 +> Incidently, the two internal SCSI drives, which are on=20 +> the 6i adapter, generated a TPS of 18. +> =09 +> I thought this server would impressive from notes I've=20 +> read in the group. This is why I thought I might be doing=20 +> something wrong. I stumped which way to take this. There is=20 +> no obvious fault but something isn't right.=20 +> =09 +> =09 +> Steve +> =09 +> =09 +> =09 +> On 8/8/06, Luke Lonergan < LLonergan@greenplum.com=20 +> > wrote: +>=20 +> Steve, +> =09 +> > Sun box with 4-disc array (4GB RAM. 4 167GB=20 +> 10K SCSI RAID10 +> > LSI MegaRAID 128MB). This is after 8 runs. +> > +> >=20 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> >=20 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53=20 +> >=20 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> >=20 +> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> > +> > Average TPS is 75 +> > +> > HP box with 8GB RAM. six disc array RAID10 on=20 +> SmartArray 642=20 +> > with 192MB RAM. After 8 runs, I see: +> > +> > intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> > intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> > intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50=20 +> > intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> > +> > Average TPS is 31. +> =09 +> Note that the I/O wait (wa) on the HP box high,=20 +> low and average are all +> *much* higher than on the Sun box. The average=20 +> I/O wait was 50% of one=20 +> CPU, which is huge. By comparison there was=20 +> virtually no I/O wait on +> the Sun machine. +> =09 +> This is indicating that your HP machine is=20 +> indeed I/O bound and +> furthermore is tying up a PG process waiting=20 +> for the disk to return.=20 +> =09 +> - Luke +> =09 +> =09 +>=20 +>=20 +>=20 +>=20 + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 03:47:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 077A19FB2E0 + for ; + Wed, 9 Aug 2006 03:47:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 87093-06 for + ; + Wed, 9 Aug 2006 06:47:51 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.190]) + by postgresql.org (Postfix) with ESMTP id 60CB69FB2D5 + for ; + Wed, 9 Aug 2006 03:47:50 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so53205nfc + for ; + Tue, 08 Aug 2006 23:47:44 -0700 (PDT) +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:references; + b=ImMWib9u4X8k0XDYTtGWPZL/bId2cw8YtMHy2aHIAZMm7dymLW+VgQxHFu79w1ZbBePfJoigWfM/USp0MQ+v5UJa3+KpwM5EENYdihEOwwKTIDNRBuYHDxUl1wp9iduT/q6ppXNsEZQCL82I786EzXN1TQW5JAXQmXvS8w3yvqc= +Received: by 10.78.147.19 with SMTP id u19mr184705hud; + Tue, 08 Aug 2006 23:47:44 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 23:47:44 -0700 (PDT) +Message-ID: <721b21dc0608082347j1e010187lde10a809980e12ce@mail.gmail.com> +Date: Tue, 8 Aug 2006 23:47:44 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <3E37B936B592014B978C4415F90D662D03FFEF75@MI8NYCMAIL06.Mi8.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_28901_15841006.1155106064473" +References: <3E37B936B592014B978C4415F90D662D03FFEF75@MI8NYCMAIL06.Mi8.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.334 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_50_60, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/132 +X-Sequence-Number: 20317 + +------=_Part_28901_15841006.1155106064473 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +I will do that. If it is the general impression that this server should +perform well with Postgresql, Are the RAID cards, the 6i and 642 sufficient +to your knowledge? I am wondering if it is the disc array itself. + +Steve + +On 8/8/06, Luke Lonergan wrote: +> +> Steve, +> +> At the end of the day it seems that you've got a support issue with the +> SmartArray RAID adapter from HP. +> +> Last I tried that I found that they don't write the cciss driver, don't +> test it for performance on Linux and don't make any claims about it's +> performance on Linux. +> +> That said - can you contact them through HP tech support and report back +> to this list what you find out? +> +> - Luke +> > -----Original Message----- +> > From: Steve Poe [mailto:steve.poe@gmail.com] +> > Sent: Tuesday, August 08, 2006 11:33 PM +> > To: Luke Lonergan +> > Cc: Alex Turner; pgsql-performance@postgresql.org +> > Subject: Re: [PERFORM] Postgresql Performance on an HP DL385 and +> > +> > Luke, +> > +> > I check dmesg one more time and I found this regarding the +> > cciss driver: +> > +> > Filesystem "cciss/c1d0p1": Disabling barriers, not supported +> > by the underlying device. +> > +> > Don't know if it means anything, but thought I'd mention it. +> > +> > Steve +> > +> > +> > On 8/8/06, Steve Poe wrote: +> > +> > Luke, +> > +> > I thought so. In my test, I tried to be fair/equal +> > since my Sun box has two 4-disc arrays each on their own +> > channel. So, I just used one of them which should be a little +> > slower than the 6-disc with 192MB cache. +> > +> > Incidently, the two internal SCSI drives, which are on +> > the 6i adapter, generated a TPS of 18. +> > +> > I thought this server would impressive from notes I've +> > read in the group. This is why I thought I might be doing +> > something wrong. I stumped which way to take this. There is +> > no obvious fault but something isn't right. +> > +> > +> > Steve +> > +> > +> > +> > On 8/8/06, Luke Lonergan < LLonergan@greenplum.com +> > > wrote: +> > +> > Steve, +> > +> > > Sun box with 4-disc array (4GB RAM. 4 167GB +> > 10K SCSI RAID10 +> > > LSI MegaRAID 128MB). This is after 8 runs. +> > > +> > > +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> > > +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> > > +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> > > +> > dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> > > +> > > Average TPS is 75 +> > > +> > > HP box with 8GB RAM. six disc array RAID10 on +> > SmartArray 642 +> > > with 192MB RAM. After 8 runs, I see: +> > > +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> > > intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> > > +> > > Average TPS is 31. +> > +> > Note that the I/O wait (wa) on the HP box high, +> > low and average are all +> > *much* higher than on the Sun box. The average +> > I/O wait was 50% of one +> > CPU, which is huge. By comparison there was +> > virtually no I/O wait on +> > the Sun machine. +> > +> > This is indicating that your HP machine is +> > indeed I/O bound and +> > furthermore is tying up a PG process waiting +> > for the disk to return. +> > +> > - Luke +> > +> > +> > +> > +> > +> > +> +> + +------=_Part_28901_15841006.1155106064473 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

I will do that. If it is the general impression that this server should perform well with Postgresql, Are the RAID cards, the 6i and 642 sufficient to your knowledge? I am wondering if it is the disc array itself. +

Steve

On 8/8/06, Luke Lonergan <LLonergan@greenplum.com> wrote:
+Steve,

At the end of the day it seems that you've got a support issue with the
SmartArray RAID adapter from HP.

Last I tried that I found that they don't write the cciss driver, don't
test it for performance on Linux and don't make any claims about it's +
performance on Linux.

That said - can you contact them through HP tech support and report back
to this list what you find out?

- Luke
> -----Original Message-----
> From: Steve Poe [mailto: +steve.poe@gmail.com]
> Sent: Tuesday, August 08, 2006 11:33 PM
> To: Luke Lonergan
> Cc: Alex Turner; pgsql-performance@postgresql.org +
> Subject: Re: [PERFORM] Postgresql Performance on an HP DL385 and
>
> Luke,
>
> I check dmesg one more time and I found this regarding the
> cciss driver:
>
> Filesystem "cciss/c1d0p1": Disabling barriers, not supported +
> by the underlying device.
>
> Don't know if it means anything, but thought I'd mention it.
>
> Steve
>
>
> On 8/8/06, Steve Poe <steve.poe@gmail.com +> wrote:
>
>       Luke,
>
>       I thought so. In my test, I tried to be fair/equal
> since my Sun box has two 4-disc arrays each on their own
> channel. So, I just used one of them which should be a little +
> slower than the 6-disc with 192MB cache.
>
>       Incidently, the two internal SCSI drives, which are on
> the 6i adapter, generated a TPS of 18.
>
>       I thought this server would impressive from notes I've +
> read in the group. This is why I thought I might be doing
> something wrong. I stumped which way to take this. There is
> no obvious fault but something isn't right.
>
>
>       Steve +
>
>
>
>       On 8/8/06, Luke Lonergan < LLonergan@greenplum.com
> <mailto:LLonergan@greenplum.com +> > wrote:
>
>               Steve,
>
>               > Sun box with 4-disc array (4GB RAM. 4 167GB
> 10K SCSI RAID10
>               > LSI MegaRAID 128MB). This is after 8 runs. +
>               >
>               >
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5
>               >
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53
+>               >
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0
>               >
> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38
>               >
>               > Average TPS is 75 +
>               >
>               > HP box with 8GB RAM. six disc array RAID10 on
> SmartArray 642
>               > with 192MB RAM. After 8 runs, I see:
>               >
>               > intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +
>               > intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1
>               > intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50
>               > intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +
>               >
>               > Average TPS is 31.
>
>               Note that the I/O wait (wa) on the HP box high,
> low and average are all
>               *much* higher than on the Sun box.  The average +
> I/O wait was 50% of one
>               CPU, which is huge.  By comparison there was
> virtually no I/O wait on
>               the Sun machine.
>
>               This is indicating that your HP machine is +
> indeed I/O bound and
>               furthermore is tying up a PG process waiting
> for the disk to return.
>
>               - Luke
>
>
>
>
>
>

+

+ +------=_Part_28901_15841006.1155106064473-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 03:52:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id EC46D9FB2E0 + for ; + Wed, 9 Aug 2006 03:52:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 14176-01 for + ; + Wed, 9 Aug 2006 03:52:36 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id EC2189FB2D5 + for ; + Wed, 9 Aug 2006 03:52:35 -0300 (ADT) +Received: from 172.16.1.25 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Wed, 09 Aug 2006 02:52:28 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Aug + 2006 02:52:28 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Wed, 9 Aug 2006 02:50:24 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D03FFEF76@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca7f76oVXJreQOmSeOdyzZvc7mlWwAAABng +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Alex Turner" , + pgsql-performance@postgresql.org +X-OriginalArrivalTime: 09 Aug 2006 06:52:28.0939 (UTC) + FILETIME=[614EA5B0:01C6BB80] +X-WSS-ID: 68C759A63786179000-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/133 +X-Sequence-Number: 20318 + +Steve,=20 + +> I will do that. If it is the general impression that this=20 +> server should perform well with Postgresql, Are the RAID=20 +> cards, the 6i and 642 sufficient to your knowledge? I am=20 +> wondering if it is the disc array itself.=20 + +I think that is the question to be answered by HP support. Ask them for +technical support for the Linux driver for the 6i and 642. If they +offer support, they should quickly figure out what the problem is. If +they don't provide support, I would send the server back to them if you +can and buy a Sun server with an LSI RAID adapter. + +- Luke + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 03:56:43 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5734B9FB2E5 + for ; + Wed, 9 Aug 2006 03:56:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 87093-08 for + ; + Wed, 9 Aug 2006 06:56:40 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.188]) + by postgresql.org (Postfix) with ESMTP id 676AF9FB2E0 + for ; + Wed, 9 Aug 2006 03:56:39 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so55867nfc + for ; + Tue, 08 Aug 2006 23:56:38 -0700 (PDT) +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:references; + b=jugLkqWc8dhRmIeZYPvj9a/bEkYE3QwNdopQPHH8BxO90wJ+PY6R1yCrFCGgYe9to1LY3thgUi6nQSsbWJWNM5WwPugdKhk4yVCNw2V3qHw5tkFMcI+ddSC2J8M9aerXzGRsD+43vURIiGgZLeGz+beJy8WeOzGLGkJrNG/QWSE= +Received: by 10.78.183.15 with SMTP id g15mr170336huf; + Tue, 08 Aug 2006 23:56:38 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Tue, 8 Aug 2006 23:56:38 -0700 (PDT) +Message-ID: <721b21dc0608082356i5ffc48c4wf8f9caa9402ba1a4@mail.gmail.com> +Date: Tue, 8 Aug 2006 23:56:38 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <3E37B936B592014B978C4415F90D662D03FFEF76@MI8NYCMAIL06.Mi8.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_28977_9185910.1155106598677" +References: <3E37B936B592014B978C4415F90D662D03FFEF76@MI8NYCMAIL06.Mi8.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.574 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/134 +X-Sequence-Number: 20319 + +------=_Part_28977_9185910.1155106598677 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +I hope so. I'll keep you and the list up-to-date as I learn more. + +Steve + +On 8/8/06, Luke Lonergan wrote: +> +> Steve, +> +> > I will do that. If it is the general impression that this +> > server should perform well with Postgresql, Are the RAID +> > cards, the 6i and 642 sufficient to your knowledge? I am +> > wondering if it is the disc array itself. +> +> I think that is the question to be answered by HP support. Ask them for +> technical support for the Linux driver for the 6i and 642. If they +> offer support, they should quickly figure out what the problem is. If +> they don't provide support, I would send the server back to them if you +> can and buy a Sun server with an LSI RAID adapter. +> +> - Luke +> +> + +------=_Part_28977_9185910.1155106598677 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

I hope so. I'll keep you and the list up-to-date as I learn more.

Steve

On 8/8/06, Luke Lonergan < +LLonergan@greenplum.com> wrote:
Steve,

> I will do that. If it is the general impression that this +
> server should perform well with Postgresql, Are the RAID
> cards, the 6i and 642 sufficient to your knowledge? I am
> wondering if it is the disc array itself.

I think that is the question to be answered by HP support.  Ask them for +
technical support for the Linux driver for the 6i and 642.  If they
offer support, they should quickly figure out what the problem is.  If
they don't provide support, I would send the server back to them if you
+can and buy a Sun server with an LSI RAID adapter.

- Luke


+ +------=_Part_28977_9185910.1155106598677-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 04:38:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id CCA9F9FB2D5 + for ; + Wed, 9 Aug 2006 04:38:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 97937-03 for + ; + Wed, 9 Aug 2006 07:38:27 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from gollum.cambrium.nl (mx1.cambrium.nl [217.19.16.130]) + by postgresql.org (Postfix) with SMTP id CEC139FA7BA + for ; + Wed, 9 Aug 2006 04:38:25 -0300 (ADT) +Received: (qmail 1864 invoked from network); 9 Aug 2006 07:38:24 -0000 +Received: from office.tweakers.net (HELO ?10.0.0.157?) (84.245.2.46) + by gollum.cambrium.nl with SMTP; 9 Aug 2006 07:38:24 -0000 +Message-ID: <44D990EB.5010706@tweakers.net> +Date: Wed, 09 Aug 2006 09:38:19 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Kenji Morishige +CC: pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> <20060809063014.GO6418@juniper.net> +In-Reply-To: <20060809063014.GO6418@juniper.net> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/135 +X-Sequence-Number: 20320 + +We were in a similar situation with a similar budget. But we had two +requirements, no "deprecated" scsi while the successor SAS is available +and preferrably only 3 or 4U of rack space. And it had to have +reasonable amounts of disks (at least 12). + +The two options we finally choose between where a Dell 1U 1950 with two +woodcrests 5160 (I don't think the older dempsey 50x0's are a good idea) +and 16GB of memory combined with a PowerVault MD1000 external storage +SAS JBOD unit, with 15 36GB 15k rpm disks and from HP a similar +configured DL360G5 (also 1U) combined with two MSA50 SFF SAS JBOD +enclosures with 20 36GB 10k rpm SFF disks. + +Both enclosures offer has SAS-connectivity (serial attached scsi), i.e. +the "next generation scsi". Which is supposed to be the successor to +scsi, but unfortunately its not yet as widely available. + +The Dell MD1000 is 3U high and can be fitted with 15 3.5" disks, the +MSA50 is 1U and can be fitted with 10 2.5" disks. +In terms of performance you'll likely need two MSA50's to be up to par +with one MD1000. The SFF disks are about as expensive as the 15k 3.5" +disks... so its mostly interesting for packing a lot of I/O in a small +enclosure. HP is going to offer a 3.5" SAS-enclosure (MSA60) but that +one won't be available until Q1 2007 or something like that. +As said Promise and Adaptec also offer SAS enclosures, both are 2U and +can be fitted with 12 disks. There are more available, but they are +generally quite bit hard to find. + +Good luck with your search. + +Best regards, + +Arjen + + +Kenji Morishige wrote: +> I have unlimited rack space, so 2U is not the issue. The boxes are stored in +> our lab for internal software tools. I'm going to research those boxes you +> mention. Regarding the JBOD enclosures, are these generally just 2U or 4U +> units with SCSI interface connectors? I didn't see these types of boxes +> availble on Dell website, I'll look again. +> -Kenji +> +> On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +>> With such a budget you should easily be able to get something like: +>> - A 1U high-performance server (for instance the Dell 1950 with 2x +>> Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +>> controller and some disks internally) +>> - An external SAS direct attached disks storage enclosure full with 15k +>> rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +>> +>> Going for the dell-solution would set you back "only" (including +>> savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +>> a DL380G5/DL385 with two MSA50's for instance) which also fit in your +>> budget afaik. The other players tend to be (a bit) more expensive, force +>> you to go with Fibre Channel or "ancient" SCSI external storage ;) +>> +>> If you'd like to have a product by a generic vendor, have a look at the +>> Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +>> sas/sata bays in 2U) for storage. +>> +>> If you're limited to only 2U of rack space, its a bit more difficult to +>> get maximum I/O in your budget (you have basically space for about 8 or +>> 12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +>> But you should still be able to have two top-off-the-line x86 cpu's (amd +>> opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +>> which is pretty expensive). +>> +>> Best regards, +>> +>> Arjen van der Meijden +>> +>> +>> On 8-8-2006 22:43, Kenji Morishige wrote: +>>> I've asked for some help here a few months ago and got some really helpfull +>>> answers regarding RAID controllers and server configuration. Up until +>>> recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +>>> machine with a single channel RAID controller (previously Adaptec 2200S, +>>> but +>>> now changed to LSI MegaRAID). The 2U unit is from a generic vendor using +>>> what +>>> I believe is a SuperMicro motherboard. In the last week after upgrading +>>> the +>>> RAID controller, the machine has had disk failure and some other issues. I +>>> would like to build a very reliable dedicated postgreSQL server that has +>>> the +>>> ultimate possible performance and reliabily for around $20,000. The data +>>> set +>>> size is only currently about 4GB, but is increasing by approximately 50MB +>>> daily. The server also requires about 500 connections and I have been +>>> monitoring about 100-200 queries per second at the moment. I am planning +>>> to +>>> run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +>>> improves performance. +>>> +>>> I am considering a setup such as this: +>>> - At least dual cpu (possibly with 2 cores each) +>>> - 4GB of RAM +>>> - 2 disk RAID 1 array for root disk +>>> - 4 disk RAID 1+0 array for PGDATA +>>> - 2 disk RAID 1 array for pg_xlog +>>> +>>> Does anyone know a vendor that might be able provide such setup? Any +>>> critique in this design? I'm thinking having a 2 channel RAID controller to +>>> seperate the PGDATA, root and pg_xlog. +>>> +>>> Sincerely, +>>> Kenji +>>> +>>> ---------------------------(end of broadcast)--------------------------- +>>> TIP 2: Don't 'kill -9' the postmaster +>>> +> + +From pgsql-admin-owner@postgresql.org Wed Aug 9 06:24:42 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id BACE79FB24B + for ; + Wed, 9 Aug 2006 06:24:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 10762-09 for ; + Wed, 9 Aug 2006 09:24:39 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) + by postgresql.org (Postfix) with ESMTP id E24C19FA69A + for ; Wed, 9 Aug 2006 06:24:38 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so63801ugc + for ; Wed, 09 Aug 2006 02:24:37 -0700 (PDT) +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:references; + b=VpTlNtLiI7v5Mf+fmjDwanm6bYQqvt6Xm5f6Fd3dMNLF/iBs7fPxYZcsJA1yVo/0ed3gTNJznw0nNERbHr9q4J2UJBY8FLFyP5zEM9EcgjSuwrhca4nFBsviVe1rp7JZsCgFke1s7utW0CMfami5ibt2UrKSVW3lgqMXy9zKqbo= +Received: by 10.66.222.9 with SMTP id u9mr649298ugg; + Wed, 09 Aug 2006 02:24:37 -0700 (PDT) +Received: by 10.66.222.12 with HTTP; Wed, 9 Aug 2006 02:24:37 -0700 (PDT) +Message-ID: <674d1f8a0608090224l37c4a892rd8df80f76c98341e@mail.gmail.com> +Date: Wed, 9 Aug 2006 12:24:37 +0300 +From: "Gourish Singbal" +To: "pgsql-admin@postgresql.org" +Subject: unsubscribe +In-Reply-To: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_32189_12661796.1155115477187" +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.908 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_50_60, HTML_MESSAGE, HTML_SHORT_LENGTH, + SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/109 +X-Sequence-Number: 22652 + +------=_Part_32189_12661796.1155115477187 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +-- +Best, +Gourish Singbal + +------=_Part_32189_12661796.1155115477187 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +


--
Best,
Gourish Singbal + +------=_Part_32189_12661796.1155115477187-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 06:25:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 53FED9FB24B + for ; + Wed, 9 Aug 2006 06:25:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 20946-10 for + ; + Wed, 9 Aug 2006 06:25:02 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) + by postgresql.org (Postfix) with ESMTP id 50EF59FA69A + for ; + Wed, 9 Aug 2006 06:25:02 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so63801ugc + for ; + Wed, 09 Aug 2006 02:25:01 -0700 (PDT) +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:references; + b=UYIL+/65+SM/njpvDpCcLhl5fU72XTTN1+p33Bc8BBBP2YGxh05EtrLvSgVoevMfPCp+bFrhU8cRPbMXxlLYyT0lbqGZ8I1ldqF+CftRpVweJSXJdtFH5AxPc05giHc6NyPczBK+rKY4eEbONvhQCynbriT2t473Awgq+rGHWvg= +Received: by 10.67.29.12 with SMTP id g12mr661249ugj; + Wed, 09 Aug 2006 02:25:01 -0700 (PDT) +Received: by 10.66.222.12 with HTTP; Wed, 9 Aug 2006 02:25:01 -0700 (PDT) +Message-ID: <674d1f8a0608090225y220bb15dl8d6c8a967fd64520@mail.gmail.com> +Date: Wed, 9 Aug 2006 12:25:01 +0300 +From: "Gourish Singbal" +To: pgsql-performance@postgresql.org +Subject: unsubscribe +In-Reply-To: <674d1f8a0608090224l37c4a892rd8df80f76c98341e@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_32197_16337798.1155115501410" +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> + <674d1f8a0608090224l37c4a892rd8df80f76c98341e@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.334 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_50_60, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/136 +X-Sequence-Number: 20321 + +------=_Part_32197_16337798.1155115501410 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +---------- Forwarded message ---------- +From: Gourish Singbal +Date: Aug 9, 2006 12:24 PM +Subject: unsubscribe +To: "pgsql-admin@postgresql.org" + + + + +-- +Best, + +Gourish Singbal + + +-- +Best, +Gourish Singbal + +------=_Part_32197_16337798.1155115501410 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +

---------- Forwarded message ----------
From: Gourish Singbal <gourish@gmail.com>
Date: Aug 9, 2006 12:24 PM +
Subject: unsubscribe
To: "pgsql-admin@postgresql.org" <pgsql-admin@postgresql.org>

+



--
Best,
 
+
Gourish Singbal


--
Best,
Gourish Singbal + +------=_Part_32197_16337798.1155115501410-- + +From pgsql-docs-owner@postgresql.org Wed Aug 9 06:27:04 2006 +X-Original-To: pgsql-docs-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 413729FB24B + for ; + Wed, 9 Aug 2006 06:27:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 23131-03 for ; + Wed, 9 Aug 2006 06:26:55 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) + by postgresql.org (Postfix) with ESMTP id D88F79FA4E3 + for ; Wed, 9 Aug 2006 06:26:54 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so64262ugc + for ; Wed, 09 Aug 2006 02:26:53 -0700 (PDT) +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:references; + b=r7P5mnWudK7ujIn2JQNE8ENvHCgxhcqvEtCN94AW9HWMXI4rXWmMW87dNYNEUDNnRuPQH7uXRt88tNMfSUgukmY8+AL/o/pfghd1+VtSEnPei60jp6JuAQAJ+pMbAYwmE98Tc7JTU0uxwcirnj6G25rItscxul5ScrMmkAq5j5g= +Received: by 10.67.100.17 with SMTP id c17mr645903ugm; + Wed, 09 Aug 2006 02:26:53 -0700 (PDT) +Received: by 10.66.222.12 with HTTP; Wed, 9 Aug 2006 02:26:53 -0700 (PDT) +Message-ID: <674d1f8a0608090226n2c352ab4ic1336b13f60def66@mail.gmail.com> +Date: Wed, 9 Aug 2006 12:26:53 +0300 +From: "Gourish Singbal" +To: pgsql-docs@postgresql.org, pgsql-hackers@postgresql.org +Subject: Fwd: unsubscribe +In-Reply-To: <674d1f8a0608090225y220bb15dl8d6c8a967fd64520@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_32241_488703.1155115613099" +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> + <674d1f8a0608090224l37c4a892rd8df80f76c98341e@mail.gmail.com> + <674d1f8a0608090225y220bb15dl8d6c8a967fd64520@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.267 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/13 +X-Sequence-Number: 3631 + +------=_Part_32241_488703.1155115613099 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +---------- Forwarded message ---------- +From: Gourish Singbal +Date: Aug 9, 2006 12:25 PM +Subject: unsubscribe +To: pgsql-performance@postgresql.org + + + +---------- Forwarded message ---------- +From: Gourish Singbal +Date: Aug 9, 2006 12:24 PM +Subject: unsubscribe +To: "pgsql-admin@postgresql.org" + + + + +-- +Best, + +Gourish Singbal + + +-- +Best, + +Gourish Singbal + + +-- +Best, +Gourish Singbal + +------=_Part_32241_488703.1155115613099 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +

---------- Forwarded message ----------
From: Gourish Singbal <gourish@gmail.com>
Date: Aug 9, 2006 12:25 PM +
Subject: unsubscribe
To: pgsql-performance@postgresql.org

+


---------- Forwarded message ----------
From: Gourish Singbal < +gourish@gmail.com>
Date: Aug 9, 2006 12:24 PM
Subject: unsubscribe
To: "pgsql-admin@postgresql.org +" <pgsql-admin@postgresql.org>

+



--
Best,
 
+
Gourish Singbal


--
Best,
 
+
Gourish Singbal


--
Best,
Gourish Singbal + +------=_Part_32241_488703.1155115613099-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 06:59:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D6E639FB22F + for ; + Wed, 9 Aug 2006 06:59:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 25680-01 for + ; + Wed, 9 Aug 2006 06:59:49 -0300 (ADT) +X-Greylist: delayed 00:28:34.234088 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id EA4C79FB271 + for ; + Wed, 9 Aug 2006 06:59:48 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from cptmail.saicom.co.za (mail.walkandtalk.co.za [196.7.19.2]) + by svr4.postgresql.org (Postfix) with ESMTP id 6A33A5AF032 + for ; + Wed, 9 Aug 2006 09:31:12 +0000 (GMT) +Received: from wernernb ([192.168.21.178]) + by cptmail.saicom.co.za (8.12.10/linuxconf) with ESMTP id + k799V2tK026291 + for ; Wed, 9 Aug 2006 11:31:02 +0200 +From: "Werner vd Merwe" +To: +Subject: Unsubscribe +Date: Wed, 9 Aug 2006 11:31:00 +0200 +Message-ID: + +MIME-Version: 1.0 +Content-Type: text/plain; + charset="windows-1250" +Content-Transfer-Encoding: 7bit +X-Mailer: Microsoft Office Outlook, Build 11.0.5510 +In-Reply-To: <44D990EB.5010706@tweakers.net> +X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 +Thread-Index: Aca7hud3xV+aS0UJQ2yrPVM89oYPCAAD4j/A +X-SAICOM-MailScanner-Information: Please contact postmaster for more + information +X-SAICOM-MailScanner: Found to be clean +X-MailScanner-From: werner@saicom.co.za +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.305 tagged_above=0 required=5 tests=DCC_CHECK, + FORGED_RCVD_HELO +X-Spam-Level: ** +X-Archive-Number: 200608/137 +X-Sequence-Number: 20322 + +Unsubscribe + +-- +No virus found in this outgoing message. +Checked by AVG Free Edition. +Version: 7.1.394 / Virus Database: 268.10.8/413 - Release Date: 2006/08/08 + + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 07:30:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 4DA999FB223 + for ; + Wed, 9 Aug 2006 07:30:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 26459-08 for + ; + Wed, 9 Aug 2006 07:30:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from kenobi.snowman.net (kenobi.snowman.net [70.84.9.186]) + by postgresql.org (Postfix) with ESMTP id 5D3E39FB2EA + for ; + Wed, 9 Aug 2006 07:30:14 -0300 (ADT) +Received: by kenobi.snowman.net (Postfix, from userid 1000) + id 39BA61400C; Wed, 9 Aug 2006 05:30:13 -0500 (CDT) +Date: Wed, 9 Aug 2006 06:30:12 -0400 +From: Stephen Frost +To: David Lang +Cc: Alex Turner , Alvaro Nunes Melo , + pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good enough +Message-ID: <20060809103012.GN20016@kenobi.snowman.net> +Mail-Followup-To: David Lang , Alex Turner , + Alvaro Nunes Melo , + pgsql-performance@postgresql.org +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="CRtNIOhYBPVBLkTX" +Content-Disposition: inline +In-Reply-To: +X-Editor: Vim http://www.vim.org/ +X-Info: http://www.snowman.net +X-Operating-System: Linux/2.6.16-2-vserver-686 (i686) +X-Uptime: 06:24:56 up 45 days, 21 min, 17 users, load average: 0.88, 0.63, + 0.70 +User-Agent: Mutt/1.5.11+cvs20060403 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.201 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/138 +X-Sequence-Number: 20323 + + +--CRtNIOhYBPVBLkTX +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +* David Lang (david@lang.hm) wrote: +> there's a huge difference between 'works on debian' and 'supported on=20 +> debian'. I do use debian extensivly, (along with slackware on my personal= +=20 +> machines), so i am comfortable getting things to work. but 'supported'=20 +> means that when you run into a problem you can call for help without bein= +g=20 +> told 'sorry, switch distros, then call us back'. + +Have you ever actually had that happen? I havn't and I've called +support for a number of different issues for various commercial +software. In the end it might boil down to some distribution-specific +issue that they're not willing to fix but honestly that's pretty rare. + +> even many of the companies that offer support for postgres have this=20 +> problem. the explination is always that they can't test every distro out= +=20 +> there so they pick a few and support those (this is one of the reasons wh= +y=20 + +My experience has been that unless it's pretty clearly some +distro-specific issue (which doesn't happen all that often, but it's +good to be familiar with what would probably be a distro-specific issue +and what wouldn't), the support folks are willing to help debug it. + + Thanks, + + Stephen + +--CRtNIOhYBPVBLkTX +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: Digital signature +Content-Disposition: inline + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.5 (GNU/Linux) + +iD8DBQFE2bk0rzgMPqB3kigRAtKNAJ9Lf6tIlP4YxNlZykvBdpS+az/4wACeJKZW +KOTd91al0yeQqzXvp6vs7K8= +=Pe+f +-----END PGP SIGNATURE----- + +--CRtNIOhYBPVBLkTX-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 07:50:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 308F19FB2B3 + for ; + Wed, 9 Aug 2006 07:50:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 27618-07 for + ; + Wed, 9 Aug 2006 07:50:26 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) + by postgresql.org (Postfix) with ESMTP id AD0229F95E1 + for ; + Wed, 9 Aug 2006 07:50:25 -0300 (ADT) +Received: (qmail 20915 invoked by uid 514); 9 Aug 2006 12:50:22 +0200 +Received: from 62.37.216.88 by rigodon (envelope-from , + uid 512) with qmail-scanner-1.25-st-qms + (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. + Clear:RC:0(62.37.216.88):SA:0(-2.3/5.0):. + Processed in 3.807291 secs); 09 Aug 2006 10:50:22 -0000 +X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon +X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.216.88):SA:0(-2.3/5.0):. + Processed in 3.807291 secs Process 20879) +Received: from 62-37-216-88.mad1.adsl.uni2.es (HELO ?192.168.2.28?) + (ruben@rentalia.com@62.37.216.88) + by mail.rentalia.net with SMTP; 9 Aug 2006 12:50:18 +0200 +Message-ID: <44D9BDE5.9060202@rentalia.com> +Date: Wed, 09 Aug 2006 12:50:13 +0200 +From: Ruben Rubio +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Christopher Browne +CC: pgsql-performance@postgresql.org +Subject: Re: shared_buffer optimization +References: <44D86A00.90106@rentalia.com> <87u04nv2q6.fsf@wolfe.cbbrowne.com> +In-Reply-To: <87u04nv2q6.fsf@wolfe.cbbrowne.com> +X-Enigmail-Version: 0.94.0.0 +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=0.235 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/139 +X-Sequence-Number: 20324 + +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +So ... +I have tried different values. The best one for one day sentences seems +to be 24576 + +IO in vmstat has the lowest values +"id" (idle) has the biggest values. + +I have created an script that executes all day sentences to try that. + +By the way, could u explain a little bit this? + +"The "rule of thumb" is to set shared buffers to the lesser of 10000 + and 15% of system memory. In your case, that would be the lesser of + 10000 and 78643, which is 10000." + +Im sorry but im not understanding it at all. + +Thanks in advance. + + +Christopher Browne wrote: +> Quoth ruben@rentalia.com (Ruben Rubio): +>> Hi, I have a question with shared_buffer. +>> +>> Ok, I have a server with 4GB of RAM +>> ----- +>> # cat /proc/meminfo +>> MemTotal: 4086484 kB +>> [...] +>> ----- +>> +>> So, if I want to, for example, shared_buffer to take 3 GB of RAM then +>> shared_buffer would be 393216 (3 * 1024 * 1024 / 8) +>> +>> Postmaster dont start. +>> Error: FATAL: shmat(id=360448) failed: Invalid argument +>> +>> +>> I can set a less value, but not higher than 3 GB. +>> +>> Am I doing something wrong? +>> Any idea? +> +> Yes, you're trying to set the value way too high. +> +> The "rule of thumb" is to set shared buffers to the lesser of 10000 +> and 15% of system memory. In your case, that would be the lesser of +> 10000 and 78643, which is 10000. +> +> I'm not aware of any actual evidence having emerged that it is of any +> value to set shared buffers higher than 10000. + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.2.2 (GNU/Linux) +Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org + +iD8DBQFE2b3kIo1XmbAXRboRAh12AKCodmhmXZWamrG7MnAf9mhVfubjgwCfa75v +7bgmSzq4F7XpBoEkSpyDqnE= +=3lMc +-----END PGP SIGNATURE----- + +From pgsql-admin-owner@postgresql.org Wed Aug 9 09:23:30 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 24EA59FB2EA + for ; + Wed, 9 Aug 2006 09:23:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 61519-02 for ; + Wed, 9 Aug 2006 09:23:18 -0300 (ADT) +X-Greylist: delayed 00:25:55.206726 by SQLgrey- +Received: from bsil.com (ganga.bsil.com [203.199.84.175]) + by postgresql.org (Postfix) with ESMTP id 0B1919FB220 + for ; Wed, 9 Aug 2006 09:23:17 -0300 (ADT) +Received: from bsil.com (localhost [127.0.0.1]) + by bsil.com (8.11.6/8.11.6) with ESMTP id k79BvHo20972 + for ; Wed, 9 Aug 2006 17:27:17 +0530 +Received: from hngmail.bsil.com (hngmail.bsil.com [192.168.11.253])by bsil.c + om (8.11.6/8.11.6) with ESMTP id k79BvGf20965for + ; Wed, 9 Aug 2006 17:27:16 +0530 +Received: from mdt488 (localhost.localdomain [127.0.0.1])by hngmail.bsil.com + (8.11.6/8.11.6) with SMTP id k79BwqG02492for + ; Wed, 9 Aug 2006 17:28:52 +0530 +Message-ID: <00dd01c6bbab$2ffe8950$290ba8c0@bsil.com> +From: "Mohan R" +To: +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> <674d1f8a06 + 08090224l37c4a892rd8df80f76c98341e@mail.gmail.com> +Subject: unsubscribe +Date: Wed, 9 Aug 2006 17:28:54 +0530 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_00DA_01C6BBD9.498E55C0" +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 6.00.2900.2180 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 +X-imss-version: 2.41 +X-imss-result: Passed +X-imss-scores: Clean:99.90000 C:2 M:3 S:5 R:5 +X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_HELO_PASS, SPF_PASS, UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/111 +X-Sequence-Number: 22654 + +This is a multi-part message in MIME format. + +------=_NextPart_000_00DA_01C6BBD9.498E55C0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Please unsubscribe + +Regards +R Mohan +Blue Star Infotech Limited +T : +91-22-6695696 +------=_NextPart_000_00DA_01C6BBD9.498E55C0 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
Please unsubscribe
+
 
+
Regards
R Mohan
Blue Star = +Infotech=20 +Limited
T : +91-22-6695696
+ +------=_NextPart_000_00DA_01C6BBD9.498E55C0-- + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 09:05:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A849D9FB2E0 + for ; + Wed, 9 Aug 2006 09:05:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 84939-05 for + ; + Wed, 9 Aug 2006 12:05:06 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.avior.ca (mail.avior.ca [209.47.34.36]) + by postgresql.org (Postfix) with SMTP id 156969FB2D8 + for ; + Wed, 9 Aug 2006 09:05:05 -0300 (ADT) +Received: (qmail 3116 invoked by uid 0); 9 Aug 2006 12:05:03 -0000 +Received: from pbeliveau@avior.ca by mail by uid 510 with qmail-scanner-1.16 + (clamscan: 0.60. Clear:. + Processed in 0.917249 secs); 09 Aug 2006 12:05:03 -0000 +Received: from mis-07.avior.ca (HELO ?10.1.1.7?) (10.1.1.7) + by mail.avior.ca with SMTP; 9 Aug 2006 12:05:02 -0000 +Message-ID: <44D9CF6E.9030900@avior.ca> +Date: Wed, 09 Aug 2006 08:05:02 -0400 +From: Patrice Beliveau +User-Agent: Thunderbird 1.5.0.4 (X11/20060614) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: Optimizing queries +References: <44D8CE92.1080407@avior.ca> + <1155062399.20252.50.camel@state.g2switchworks.com> + <44D8F0B8.2030804@avior.ca> <13030.1155069749@sss.pgh.pa.us> +In-Reply-To: <13030.1155069749@sss.pgh.pa.us> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/140 +X-Sequence-Number: 20325 + +Tom Lane wrote: +> Patrice Beliveau writes: +> +>>>> SELECT * FROM TABLE +>>>> WHERE TABLE.COLUMN1=something +>>>> AND TABLE.COLUMN2=somethingelse +>>>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; +>>>> +> +> +>> I find out that the function process every row even if the row should be +>> rejected as per the first or the second condition. +>> ... I'm using version 8.1.3 +>> +> +> PG 8.1 will not reorder WHERE clauses for a single table unless it has +> some specific reason to do so (and AFAICT no version back to 7.0 or so +> has done so either...) So there's something you are not telling us that +> is relevant. Let's see the exact table schema (psql \d output is good), +> the exact query, and EXPLAIN output for that query. +> +> regards, tom lane +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> +> +> +Hi, + +here is my query, and the query plan that result + +explain select * from ( + select * from sales_order_delivery + where sales_order_id in ( + select sales_order_id from sales_order + where closed=false + ) + ) as a where outstandingorder(sales_order_id, sales_order_item, +date_due) > 0; + + + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- + Hash IN Join (cost=498.89..8348.38 rows=34612 width=262) + Hash Cond: (("outer".sales_order_id)::text = +("inner".sales_order_id)::text) + -> Seq Scan on sales_order_delivery (cost=0.00..6465.03 rows=69223 +width=262) + Filter: (outstandingorder((sales_order_id)::text, +(sales_order_item)::text, date_due) > 0::double precision) + -> Hash (cost=484.90..484.90 rows=5595 width=32) + -> Seq Scan on sales_order (cost=0.00..484.90 rows=5595 width=32) + Filter: (NOT closed) +(7 rows) + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 09:20:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 69EE89FB2EA + for ; + Wed, 9 Aug 2006 09:20:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 47021-05 for + ; + Wed, 9 Aug 2006 09:20:49 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.rentalia.net (mail.rentalia.com [213.192.209.8]) + by postgresql.org (Postfix) with ESMTP id 050B19FB220 + for ; + Wed, 9 Aug 2006 09:20:48 -0300 (ADT) +Received: (qmail 21391 invoked by uid 514); 9 Aug 2006 14:20:46 +0200 +Received: from 62.37.216.88 by rigodon (envelope-from , + uid 512) with qmail-scanner-1.25-st-qms + (clamdscan: 0.88/1284. spamassassin: 3.0.2. perlscan: 1.25-st-qms. + Clear:RC:0(62.37.216.88):SA:0(-2.3/5.0):. + Processed in 5.234808 secs); 09 Aug 2006 12:20:46 -0000 +X-Antivirus-MYDOMAIN-Mail-From: ruben@rentalia.com via rigodon +X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(62.37.216.88):SA:0(-2.3/5.0):. + Processed in 5.234808 secs Process 21256) +Received: from 62-37-216-88.mad1.adsl.uni2.es (HELO ?192.168.2.28?) + (ruben@rentalia.com@62.37.216.88) + by mail.rentalia.net with SMTP; 9 Aug 2006 14:20:41 +0200 +Message-ID: <44D9D313.5060804@rentalia.com> +Date: Wed, 09 Aug 2006 14:20:35 +0200 +From: Ruben Rubio +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Patrice Beliveau +CC: pgsql-performance@postgresql.org +Subject: Re: Optimizing queries +References: <44D8CE92.1080407@avior.ca> + <1155062399.20252.50.camel@state.g2switchworks.com> + <44D8F0B8.2030804@avior.ca> <13030.1155069749@sss.pgh.pa.us> + <44D9CF6E.9030900@avior.ca> +In-Reply-To: <44D9CF6E.9030900@avior.ca> +X-Enigmail-Version: 0.94.0.0 +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=0.16 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/141 +X-Sequence-Number: 20326 + +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +If subquerys are not working I think you should try to create a view +with the subquery. + +Maybe it will work. + +Patrice Beliveau wrote: +> Tom Lane wrote: +>> Patrice Beliveau writes: +>> +>>>>> SELECT * FROM TABLE +>>>>> WHERE TABLE.COLUMN1=something +>>>>> AND TABLE.COLUMN2=somethingelse +>>>>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; +>>>>> +>> +>> +>>> I find out that the function process every row even if the row should +>>> be rejected as per the first or the second condition. +>>> ... I'm using version 8.1.3 +>>> +>> +>> PG 8.1 will not reorder WHERE clauses for a single table unless it has +>> some specific reason to do so (and AFAICT no version back to 7.0 or so +>> has done so either...) So there's something you are not telling us that +>> is relevant. Let's see the exact table schema (psql \d output is good), +>> the exact query, and EXPLAIN output for that query. +>> +>> regards, tom lane +>> +>> ---------------------------(end of broadcast)--------------------------- +>> TIP 9: In versions below 8.0, the planner will ignore your desire to +>> choose an index scan if your joining column's datatypes do not +>> match +>> +>> +>> +> Hi, +> +> here is my query, and the query plan that result +> +> explain select * from ( +> select * from sales_order_delivery +> where sales_order_id in ( +> select sales_order_id from sales_order +> where closed=false +> ) +> ) as a where outstandingorder(sales_order_id, sales_order_item, +> date_due) > 0; +> +> +> QUERY PLAN +> ---------------------------------------------------------------------------------------------------------------------- +> +> Hash IN Join (cost=498.89..8348.38 rows=34612 width=262) +> Hash Cond: (("outer".sales_order_id)::text = +> ("inner".sales_order_id)::text) +> -> Seq Scan on sales_order_delivery (cost=0.00..6465.03 rows=69223 +> width=262) +> Filter: (outstandingorder((sales_order_id)::text, +> (sales_order_item)::text, date_due) > 0::double precision) +> -> Hash (cost=484.90..484.90 rows=5595 width=32) +> -> Seq Scan on sales_order (cost=0.00..484.90 rows=5595 width=32) +> Filter: (NOT closed) +> (7 rows) +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> +> + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.2.2 (GNU/Linux) +Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org + +iD8DBQFE2dMTIo1XmbAXRboRAhbIAJwJGZ+ITP0gl38A3qROrzIeNbTtUwCcDOIW +eZ9NJqjL+58gyMfO95jwZSw= +=4Zxj +-----END PGP SIGNATURE----- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 09:47:56 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A013E9FB2EA + for ; + Wed, 9 Aug 2006 09:47:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 08334-05 for + ; + Wed, 9 Aug 2006 12:47:51 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 86B159FA646 + for ; + Wed, 9 Aug 2006 09:47:51 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k79Clguh002766 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Wed, 9 Aug 2006 05:47:43 -0700 +Message-ID: <44D9D96E.7030706@commandprompt.com> +Date: Wed, 09 Aug 2006 05:47:42 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Alex Turner +CC: Alvaro Nunes Melo , pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +In-Reply-To: <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Wed, 09 Aug 2006 05:47:43 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/142 +X-Sequence-Number: 20327 + +Alex Turner wrote: +> First off - very few third party tools support debian. Debian is a sure +> fire way to have an unsupported system. Use RedHat or SuSe (flame me all +> you want, it doesn't make it less true). + +*cough* BS *cough* + +Linux is Linux. It doesn't matter what trademark you put on top of it. +As long as they are running a current version of Linux (e.g; kernel 2.6) +they should be fine. + +With Debian that may or may not be the case and that could be an issue. +To get the best luck, I would suggest (if you want to stay with a Debian +base) Ubuntu Dapper LTS. + +Sincerely, + +Joshua D. Drake + + + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 09:51:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 541BF9FB2EA + for ; + Wed, 9 Aug 2006 09:51:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 55119-10 for + ; + Wed, 9 Aug 2006 09:51:03 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id A24349FA646 + for ; + Wed, 9 Aug 2006 09:51:03 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k79CofOR002853 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Wed, 9 Aug 2006 05:50:44 -0700 +Message-ID: <44D9DA20.3010506@commandprompt.com> +Date: Wed, 09 Aug 2006 05:50:40 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: David Lang , Alex Turner , + Alvaro Nunes Melo , pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> +In-Reply-To: <20060809103012.GN20016@kenobi.snowman.net> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Wed, 09 Aug 2006 05:50:44 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.188 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/143 +X-Sequence-Number: 20328 + + +> Have you ever actually had that happen? I havn't and I've called +> support for a number of different issues for various commercial +> software. In the end it might boil down to some distribution-specific +> issue that they're not willing to fix but honestly that's pretty rare. + +Very rare, if you are using a reputable vendor. + +> +>> even many of the companies that offer support for postgres have this +>> problem. the explination is always that they can't test every distro out +>> there so they pick a few and support those (this is one of the reasons why + +Ahh and which companies would these be? As a representative of the most +prominent one in the US I can tell you that you are not speaking from a +knowledgeable position. + +Sincerely, + +Joshua D. Drake + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-admin-owner@postgresql.org Wed Aug 9 09:53:06 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 752F49FB2EA + for ; + Wed, 9 Aug 2006 09:53:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 11073-06 for ; + Wed, 9 Aug 2006 12:53:02 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 2C5009FA646 + for ; Wed, 9 Aug 2006 09:53:02 -0300 (ADT) +Received: from [192.168.199.109] (dsl.static81214124250.ttnet.net.tr + [81.214.124.250] (may be forged)) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k79Cqccu002885; + Wed, 9 Aug 2006 05:52:40 -0700 +Subject: Re: unsubscribe +From: Devrim GUNDUZ +To: Mohan R +Cc: "pgsql-admin@postgresql.org" +In-Reply-To: <00dd01c6bbab$2ffe8950$290ba8c0@bsil.com> +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> + <674d1f8a06 08090224l37c4a892rd8df80f76c98341e@mail.gmail.com> + <00dd01c6bbab$2ffe8950$290ba8c0@bsil.com> +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; + boundary="=-P2o/15D8CNBSCBj38x54" +Organization: Command Prompt, Inc. +Date: Wed, 09 Aug 2006 15:52:54 +0300 +Message-Id: <1155127974.2554.15.camel@laptop.gunduz.org> +Mime-Version: 1.0 +X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5.sam.2) +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Wed, 09 Aug 2006 05:52:41 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/113 +X-Sequence-Number: 22656 + + +--=-P2o/15D8CNBSCBj38x54 +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + +Hello, + +On Wed, 2006-08-09 at 17:28 +0530, Mohan R wrote: +> Please unsubscribe + +Use http://www.postgresql.org/community/lists/subscribe and select +unsubscribe from action box. + +You must do it by yourself. + +-HAND, +--=20 +The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 +PostgreSQL Replication, Consulting, Custom Development, 24x7 support +Managed Services, Shared and Dedicated Hosting +Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/ + + +--=-P2o/15D8CNBSCBj38x54 +Content-Type: application/pgp-signature; name=signature.asc +Content-Description: This is a digitally signed message part + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.5 (GNU/Linux) + +iD8DBQBE2dqmpme12CBXnxERArQJAKCkiNix8VY9c7AQA4xZxfqkcGqvWACeNq7k +GKI1gD0vgzZsPc2M0ea0kD4= +=ml4U +-----END PGP SIGNATURE----- + +--=-P2o/15D8CNBSCBj38x54-- + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 10:00:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 197D59FB2F6 + for ; + Wed, 9 Aug 2006 10:00:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 56673-10 for + ; + Wed, 9 Aug 2006 10:00:23 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx00.pub.collaborativefusion.com + (mx00.pub.collaborativefusion.com [206.210.89.199]) + by postgresql.org (Postfix) with ESMTP id B07B09FA646 + for ; + Wed, 9 Aug 2006 10:00:23 -0300 (ADT) +Received: from collaborativefusion.com (mx01.pub.collaborativefusion.com + [206.210.89.201]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) + by wingspan with esmtp; Wed, 09 Aug 2006 09:00:22 -0400 + id 00056407.44D9DC66.00007496 +Received: from Internal Mail-Server (206.210.89.202) by mx01 (envelope-from + wmoran@collaborativefusion.com) + with AES256-SHA encrypted SMTP; 9 Aug 2006 08:55:43 -0400 +Date: Wed, 9 Aug 2006 09:00:31 -0400 +From: Bill Moran +To: "Gourish Singbal" +Cc: pgsql-performance@postgresql.org +Subject: Re: unsubscribe +Message-Id: <20060809090031.9c7e08ff.wmoran@collaborativefusion.com> +In-Reply-To: <674d1f8a0608090225y220bb15dl8d6c8a967fd64520@mail.gmail.com> +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> + <674d1f8a0608090224l37c4a892rd8df80f76c98341e@mail.gmail.com> + <674d1f8a0608090225y220bb15dl8d6c8a967fd64520@mail.gmail.com> +Organization: Collaborative Fusion +X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.20; i386-portbld-freebsd6.1) +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.074 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/144 +X-Sequence-Number: 20329 + +In response to "Gourish Singbal" : + +If you look in the mail headers: + +List-Unsubscribe: + + + +-- +Bill Moran +Collaborative Fusion Inc. + +From pgsql-performance-owner@postgresql.org Wed Aug 9 10:20:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B52B39FA5DC + for ; + Wed, 9 Aug 2006 10:20:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 74339-07 for + ; + Wed, 9 Aug 2006 10:20:50 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.196]) + by postgresql.org (Postfix) with ESMTP id 3CC5E9FA385 + for ; + Wed, 9 Aug 2006 10:20:50 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so39349nzd + for ; + Wed, 09 Aug 2006 06:20:48 -0700 (PDT) +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=N5E+SzG9T+SFhYbdgE6xezTf+oUSL1BIu0p52T8F7JR/YVSgjTTWe3O76aKUO+9/lAgLbNiaAd+MdMngBMGEkU6/AZWLAN+fsSx/yEvmdhq9+Fo4L5MAfo3BDfG4vpps8QVq2C8nutlBf4EY+MSV0ZRepvLdmneIvFrxyyLd4qE= +Received: by 10.64.241.3 with SMTP id o3mr995888qbh; + Wed, 09 Aug 2006 06:20:40 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Wed, 9 Aug 2006 06:20:38 -0700 (PDT) +Message-ID: +Date: Wed, 9 Aug 2006 09:20:38 -0400 +From: "Merlin Moncure" +To: "Alvaro Nunes Melo" +Subject: Re: Hardware upgraded but performance still ain't good enough +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44D7B958.6030004@atua.com.br> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44D7B958.6030004@atua.com.br> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.413 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/145 +X-Sequence-Number: 20330 + +On 8/7/06, Alvaro Nunes Melo wrote: +> "we recently upgraded our dual Xeon Dell to a brand new Sun v40z with 4 +> opterons, 16GB of memory and MegaRAID with enough disks. OS is Debian +> Sarge amd64, PostgreSQL is 8.0.3." on +> (http://archives.postgresql.org/pgsql-performance/2005-07/msg00431.php) + +well, if you spend three months optimizing your application or buy a +10k$ server to get the same result, which is cheaper? :) + +> The database size stands around 10 GB. The new server has a better +> performance than the old one, but sometimes it still stucks. We tried to +> use a HP proprietary tool to monitor the server, and find out what is +> the bottleneck, but it's been difficult to install it on Debian. The + +I'm not familiar with the hp tool, but I suspect you are not missing +much. If you are looking for a free distro, you might have some luck +with centos. most redhat binary rpms will install on it. + +> tool is only certified for SuSe and RedHat. So we tried to use some +> Linux tools to see what's going on, like vmstat and iostat. Are this +> tools (vm and iostat) enough? Should we use something else? Is there any +> specifical material about finding bottlenecks in Linux/PostgreSQL +> machines? Is our disks design proper? + +those are pretty broad questions, so you will only get broad answers. +you might want to consider hooking up with some commercial support +(I've heard good things about commandprompt) or providing more +detailed information so that you can get some help from this list, +including: +iostat/vmstat reports +explain analyze +information from top + +nicely summarized at the time the problems occur. +regards, +merlin + +> I really apologize for my lack of knowledge in this area, and for the +> excessive number of questions in a single e-mail. +> +> Best regards, +> Alvaro + +From pgsql-performance-owner@postgresql.org Wed Aug 9 11:26:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 773C69FB27A + for ; + Wed, 9 Aug 2006 11:26:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 40247-01 for + ; + Wed, 9 Aug 2006 11:26:29 -0300 (ADT) +X-Greylist: delayed 00:19:55.819455 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 9CDA09FB29A + for ; + Wed, 9 Aug 2006 11:26:28 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mx.mall.cz (unknown [82.100.0.98]) + by svr4.postgresql.org (Postfix) with ESMTP id 20A4E5AFB18 + for ; + Wed, 9 Aug 2006 14:06:30 +0000 (GMT) +Received: from localhost (asterix [127.0.0.1]) + by mx.mall.cz (Postfix) with ESMTP id 25D7213F639 + for ; + Wed, 9 Aug 2006 16:06:26 +0200 (CEST) +Received: from mx.mall.cz ([127.0.0.1]) + by localhost (asterix [127.0.0.1]) (amavisd-new, port 10025) with ESMTP + id 15598-05 for ; + Wed, 9 Aug 2006 16:06:22 +0200 (CEST) +Message-ID: <44D9EBEB.9010704@mall.cz> +Date: Wed, 09 Aug 2006 16:06:35 +0200 +From: Michal Taborsky - Internet Mall +Organization: Internet Mall, a.s. +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: 3-table query optimization +Content-Type: text/plain; charset=ISO-8859-2; format=flowed +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: by amavisd-new at mall.cz +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.519 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_SOFTFAIL +X-Spam-Level: * +X-Archive-Number: 200608/147 +X-Sequence-Number: 20332 + +Hello everyone. + +My (simplified) database structure is: + +a) table product (150000 rows) + product_id BIGINT PRIMARY KEY + title TEXT + ... + +b) table action (5000 rows) + action_id BIGINT PRIMARY KEY + product_id BIGINT, FK to product + shop_group_id INTEGER (there are about 5 groups, distributed about evenly) + +c) table product_program (500000 rows) + program_id BIGINT (there are about 50 unique) + product_id BIGINT, FK to product + + +I need to query products, which are in action table of specific group +and in product_program for a specific program_id. The query is taking +too long to my liking My query is: + +SELECT product.product_id + FROM action + JOIN product ON (product.product_id=action.product_id) + WHERE action.shop_group_id=1 + AND EXISTS (SELECT 1 + FROM catalog.product_program + WHERE product_id=product.product_id + AND product_program.program_id =1104322 + ) + + +QUERY PLAN +Nested Loop (cost=0.00..18073.81 rows=1220 width=8) (actual +time=10.153..2705.891 rows=636 loops=1) + -> Seq Scan on "action" (cost=0.00..135.74 rows=2439 width=8) +(actual time=8.108..36.684 rows=2406 loops=1) + Filter: (shop_group_id = 1) + -> Index Scan using product_pkey on product (cost=0.00..7.34 rows=1 +width=8) (actual time=1.031..1.097 rows=0 loops=2406) + Index Cond: ((product.product_id)::bigint = +("outer".product_id)::bigint) + Filter: (subplan) + SubPlan + -> Index Scan using product_program_pkey on product_program + (cost=0.00..4.33 rows=1 width=0) (actual time=0.455..0.455 rows=0 +loops=2406) + Index Cond: (((program_id)::bigint = 1104322) AND +((product_id)::bigint = ($0)::bigint)) +Total runtime: 2708.575 ms + + + +I also tried this: + +SELECT product.product_id + FROM action + JOIN product ON (product.product_id=action.product_id) + JOIN catalog.product_program ON ( + product_program.product_id=product.product_id AND + product_program.program_id =1104322) + WHERE action.shop_group_id=1 + + +With about the same results (a bit better, but for different groups it +was vice versa): + +QUERY PLAN +Nested Loop (cost=141.84..3494.91 rows=139 width=8) (actual +time=118.584..1295.303 rows=636 loops=1) + -> Hash Join (cost=141.84..2729.11 rows=253 width=16) (actual +time=118.483..231.103 rows=636 loops=1) + Hash Cond: (("outer".product_id)::bigint = +("inner".product_id)::bigint) + -> Index Scan using product_program_pkey on product_program +(cost=0.00..2470.04 rows=7647 width=8) (actual time=0.047..73.514 +rows=7468 loops=1) + Index Cond: ((program_id)::bigint = 1104322) + -> Hash (cost=135.74..135.74 rows=2439 width=8) (actual +time=118.114..118.114 rows=0 loops=1) + -> Seq Scan on "action" (cost=0.00..135.74 rows=2439 +width=8) (actual time=0.019..106.864 rows=2406 loops=1) + Filter: (shop_group_id = 1) + -> Index Scan using product_pkey on product (cost=0.00..3.01 rows=1 +width=8) (actual time=1.300..1.655 rows=1 loops=636) + Index Cond: (("outer".product_id)::bigint = +(product.product_id)::bigint) + + +Any ideas if this is really the best I can expect, or is there something +amiss there and my query is wrong for this type of task? My gut feeling +tells me, that this kind of query should be a lot faster. The hardware +is Dual Xeon with enough of RAM and other operations run just fine. + +Thank you. + +-- +Michal T�borsk� + +From pgsql-performance-owner@postgresql.org Wed Aug 9 11:23:09 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C2BEC9FB220 + for ; + Wed, 9 Aug 2006 11:23:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 73835-09 for + ; + Wed, 9 Aug 2006 14:23:04 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.avior.ca (mail.avior.ca [209.47.34.36]) + by postgresql.org (Postfix) with SMTP id 518E39FB1FE + for ; + Wed, 9 Aug 2006 11:23:04 -0300 (ADT) +Received: (qmail 25151 invoked by uid 0); 9 Aug 2006 14:23:02 -0000 +Received: from pbeliveau@avior.ca by mail by uid 510 with qmail-scanner-1.16 + (clamscan: 0.60. Clear:. + Processed in 0.872632 secs); 09 Aug 2006 14:23:02 -0000 +Received: from mis-07.avior.ca (HELO ?10.1.1.7?) (10.1.1.7) + by mail.avior.ca with SMTP; 9 Aug 2006 14:23:01 -0000 +Message-ID: <44D9EFC5.4070708@avior.ca> +Date: Wed, 09 Aug 2006 10:23:01 -0400 +From: Patrice Beliveau +User-Agent: Thunderbird 1.5.0.4 (X11/20060614) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: Optimizing queries +References: <44D8CE92.1080407@avior.ca> + <1155062399.20252.50.camel@state.g2switchworks.com> + <44D8F0B8.2030804@avior.ca> <13030.1155069749@sss.pgh.pa.us> + <44D9CF6E.9030900@avior.ca> <44D9D313.5060804@rentalia.com> +In-Reply-To: <44D9D313.5060804@rentalia.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/146 +X-Sequence-Number: 20331 + +I've create a view, same query plan (some number vary a bit, but nothing +significant) and same result, closed sales_order are processed + +Ruben Rubio wrote: +> -----BEGIN PGP SIGNED MESSAGE----- +> Hash: SHA1 +> +> If subquerys are not working I think you should try to create a view +> with the subquery. +> +> Maybe it will work. +> +> Patrice Beliveau wrote: +> +>> Tom Lane wrote: +>> +>>> Patrice Beliveau writes: +>>> +>>> +>>>>>> SELECT * FROM TABLE +>>>>>> WHERE TABLE.COLUMN1=something +>>>>>> AND TABLE.COLUMN2=somethingelse +>>>>>> AND function(TABLE.COLUMN3,TABLE.COLUMN4) > 0; +>>>>>> +>>>>>> +>>> +>>> +>>>> I find out that the function process every row even if the row should +>>>> be rejected as per the first or the second condition. +>>>> ... I'm using version 8.1.3 +>>>> +>>>> +>>> PG 8.1 will not reorder WHERE clauses for a single table unless it has +>>> some specific reason to do so (and AFAICT no version back to 7.0 or so +>>> has done so either...) So there's something you are not telling us that +>>> is relevant. Let's see the exact table schema (psql \d output is good), +>>> the exact query, and EXPLAIN output for that query. +>>> +>>> regards, tom lane +>>> +>>> ---------------------------(end of broadcast)--------------------------- +>>> TIP 9: In versions below 8.0, the planner will ignore your desire to +>>> choose an index scan if your joining column's datatypes do not +>>> match +>>> +>>> +>>> +>>> +>> Hi, +>> +>> here is my query, and the query plan that result +>> +>> explain select * from ( +>> select * from sales_order_delivery +>> where sales_order_id in ( +>> select sales_order_id from sales_order +>> where closed=false +>> ) +>> ) as a where outstandingorder(sales_order_id, sales_order_item, +>> date_due) > 0; +>> +>> +>> QUERY PLAN +>> ---------------------------------------------------------------------------------------------------------------------- +>> +>> Hash IN Join (cost=498.89..8348.38 rows=34612 width=262) +>> Hash Cond: (("outer".sales_order_id)::text = +>> ("inner".sales_order_id)::text) +>> -> Seq Scan on sales_order_delivery (cost=0.00..6465.03 rows=69223 +>> width=262) +>> Filter: (outstandingorder((sales_order_id)::text, +>> (sales_order_item)::text, date_due) > 0::double precision) +>> -> Hash (cost=484.90..484.90 rows=5595 width=32) +>> -> Seq Scan on sales_order (cost=0.00..484.90 rows=5595 width=32) +>> Filter: (NOT closed) +>> (7 rows) +>> +>> +>> ---------------------------(end of broadcast)--------------------------- +>> TIP 3: Have you checked our extensive FAQ? +>> +>> http://www.postgresql.org/docs/faq +>> +>> +>> +> +> -----BEGIN PGP SIGNATURE----- +> Version: GnuPG v1.4.2.2 (GNU/Linux) +> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org +> +> iD8DBQFE2dMTIo1XmbAXRboRAhbIAJwJGZ+ITP0gl38A3qROrzIeNbTtUwCcDOIW +> eZ9NJqjL+58gyMfO95jwZSw= +> =4Zxj +> -----END PGP SIGNATURE----- +> +> +> + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 11:39:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DE0A09FB1FE + for ; + Wed, 9 Aug 2006 11:39:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 12553-08 for + ; + Wed, 9 Aug 2006 11:39:13 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 42FEF9FB2EA + for ; + Wed, 9 Aug 2006 11:39:13 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k79Ed6c0019963; + Wed, 9 Aug 2006 10:39:06 -0400 (EDT) +To: Patrice Beliveau +cc: pgsql-performance@postgresql.org +Subject: Re: Optimizing queries +In-reply-to: <44D9CF6E.9030900@avior.ca> +References: <44D8CE92.1080407@avior.ca> + <1155062399.20252.50.camel@state.g2switchworks.com> + <44D8F0B8.2030804@avior.ca> <13030.1155069749@sss.pgh.pa.us> + <44D9CF6E.9030900@avior.ca> +Comments: In-reply-to Patrice Beliveau + message dated "Wed, 09 Aug 2006 08:05:02 -0400" +Date: Wed, 09 Aug 2006 10:39:06 -0400 +Message-ID: <19962.1155134346@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.137 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/148 +X-Sequence-Number: 20333 + +Patrice Beliveau writes: +> Tom Lane wrote: +>> PG 8.1 will not reorder WHERE clauses for a single table unless it has +>> some specific reason to do so (and AFAICT no version back to 7.0 or so +>> has done so either...) So there's something you are not telling us that +>> is relevant. + +> here is my query, and the query plan that result + +> explain select * from ( +> select * from sales_order_delivery +> where sales_order_id in ( +> select sales_order_id from sales_order +> where closed=false +> ) +> ) as a where outstandingorder(sales_order_id, sales_order_item, +> date_due) > 0; + +So this isn't a simple query, but a join. PG will generally push +single-table restrictions down to the individual tables in order to +reduce the number of rows that have to be processed at the join. +In this case that's not a win, but the planner doesn't know enough +about the outstandingorder() function to realize that. + +I think what you need is an "optimization fence" to prevent the subquery +from being flattened: + +explain select * from ( + select * from sales_order_delivery + where sales_order_id in ( + select sales_order_id from sales_order + where closed=false + ) + OFFSET 0 + ) as a where outstandingorder(sales_order_id, sales_order_item, +date_due) > 0; + +Any LIMIT or OFFSET in a subquery prevents WHERE conditions from being +pushed down past it (since that might change the results). OFFSET 0 is +otherwise a no-op, so that's what people usually use. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 9 12:09:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 339DE9FB284 + for ; + Wed, 9 Aug 2006 12:09:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 95287-01 for + ; + Wed, 9 Aug 2006 12:09:05 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id BCB2C9FB1FE + for ; + Wed, 9 Aug 2006 12:09:04 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k79F8xm8020368; + Wed, 9 Aug 2006 11:08:59 -0400 (EDT) +To: Michal Taborsky - Internet Mall +cc: pgsql-performance@postgresql.org +Subject: Re: 3-table query optimization +In-reply-to: <44D9EBEB.9010704@mall.cz> +References: <44D9EBEB.9010704@mall.cz> +Comments: In-reply-to Michal Taborsky - Internet Mall + + message dated "Wed, 09 Aug 2006 16:06:35 +0200" +Date: Wed, 09 Aug 2006 11:08:59 -0400 +Message-ID: <20367.1155136139@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/149 +X-Sequence-Number: 20334 + +Michal Taborsky - Internet Mall writes: +> SELECT product.product_id +> FROM action +> JOIN product ON (product.product_id=action.product_id) +> WHERE action.shop_group_id=1 +> AND EXISTS (SELECT 1 +> FROM catalog.product_program +> WHERE product_id=product.product_id +> AND product_program.program_id =1104322 +> ) + +Try converting the EXISTS subquery to an IN. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 9 12:15:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 23B1B9FB284 + for ; + Wed, 9 Aug 2006 12:15:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 67786-05 for + ; + Wed, 9 Aug 2006 12:15:28 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 981CA9FB27A + for ; + Wed, 9 Aug 2006 12:15:28 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Wed, 9 Aug 2006 15:15:27 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 09 Aug 2006 10:15:27 -0500 +Subject: Re: most bang for buck with ~ $20,000 +From: Scott Marlowe +To: "Thomas F. O'Connell" +Cc: "Joshua D.Drake" , + Kenji Morishige , pgsql-performance@postgresql.org +In-Reply-To: <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155136527.20252.90.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Wed, 09 Aug 2006 10:15:27 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.111 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/150 +X-Sequence-Number: 20335 + +On Tue, 2006-08-08 at 17:53, Thomas F. O'Connell wrote: +> On Aug 8, 2006, at 5:28 PM, Joshua D. Drake wrote: +> +> > Thomas F. O'Connell wrote: +> >> On Aug 8, 2006, at 4:49 PM, Joshua D. Drake wrote: +> >>>> I am considering a setup such as this: +> >>>> - At least dual cpu (possibly with 2 cores each) +> >>>> - 4GB of RAM +> >>>> - 2 disk RAID 1 array for root disk +> >>>> - 4 disk RAID 1+0 array for PGDATA +> >>>> - 2 disk RAID 1 array for pg_xlog +> >>>> Does anyone know a vendor that might be able provide such setup? +> >> Wouldn't it be preferable to put WAL on a multi-disk RAID 10 if +> >> you had the opportunity? This gives you the redundancy of RAID 1 +> >> but approaches the performance of RAID 0, especially as you add +> >> disks to the array. In benchmarking, I've seen consistent success +> >> with this approach. +> > +> > WALL is written in order so RAID 1 is usually fine. We also don't +> > need journaling for WAL so the speed is even faster. +> +> In which case, which is theoretically better (since I don't have a +> convenient test bed at the moment) for WAL in a write-heavy +> environment? More disks in a RAID 10 (which should theoretically +> improve write throughput in general, to a point) or a 2-disk RAID 1? +> Does it become a price/performance question, or is there virtually no +> benefit to throwing more disks at RAID 10 for WAL if you turn off +> journaling on the filesystem? + +Actually, the BIGGEST win comes when you've got battery backed cache on +your RAID controller. In fact, I'd spend money on a separate RAID +controller for xlog with its own cache hitting a simple mirror set +before I'd spring for more drives on pg_xlog. The battery backed cache +on the pg_xlog likely wouldn't need to be big, just there and set to +write-back. + +Then put all the rest of your cash into disks on a big RAID 10 config, +and as big of a battery backed cache as you can afford for it and memory +for the machine. + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:23:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id EC3D79FB29E + for ; + Wed, 9 Aug 2006 13:23:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 62763-03 for + ; + Wed, 9 Aug 2006 13:23:09 -0300 (ADT) +X-Greylist: delayed 00:26:00.514811 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id F216D9FB304 + for ; + Wed, 9 Aug 2006 13:23:08 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by svr4.postgresql.org (Postfix) with ESMTP id 98F825AF02D + for ; + Wed, 9 Aug 2006 15:57:02 +0000 (GMT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_001_01C6BBCC.6E775949" +Subject: Dell PowerEdge 2950 performance +Date: Wed, 9 Aug 2006 11:56:52 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104953@MAIL.corp.lumeta.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Dell PowerEdge 2950 performance +Thread-Index: Aca7zG4xp+B9ApHQT2a70o6sGEKncg== +From: "Bucky Jordan" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/153 +X-Sequence-Number: 20338 + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01C6BBCC.6E775949 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hello, + +=20 + +I've recently been tasked with scalability/performance testing of a Dell +PowerEdge 2950. This is the one with the new Intel Woodcrest Xeons. +Since I haven't seen any info on this box posted to the list, I figured +people might be interested in the results, and maybe in return share a +few tips on performance tweaks. + +=20 + +After doing some reading on the performance list, I realize that there's +a preference for Opteron; however, the goal of these experiments is to +see what I can get the 2950 to do. I will also be comparing performance +vs. a 1850 at some point, if there's any interest I can post those +numbers too. + +=20 + +Here's the hardware: + +2xDual Core 3.0 Ghz CPU (Xeon 5160- 1333Mhz FSB, 4 MB shared cache per +socket) + +8 GB RAM (DDR2, fully buffered, Dual Ranked, 667 Mhz) + +6x300 10k RPM SAS drives + +Perc 5i w/256 MB battery backed cache + +=20 + +The target application: + +Mostly OLAP (large bulk loads, then lots of reporting, possibly moving +to real-time loads in the future). All of this will be run on FreeBSD +6.1 amd64. (If I have some extra time, I might be able to run a few +tests on linux just for comparison's sake) + +=20 + +Test strategy: + +Make sure the RAID is giving reasonable performance: + +bonnie++ -d /u/bonnie -s 1000:8k + +time bash -c "(dd if=3D/dev/zero of=3Dbigfile count=3D125000 bs=3D8k && = +sync)" + +=20 + +Now, I realize that the above are overly simple, and not indicative of +overall performance, however here's what I'm seeing: + +Single 10K 300 GB drive - ~75 Mb/s on both tests, more or less + +RAID 10, 6 disks (3 sets of mirrored pairs) - ~117 Mb/s + +=20 + +The RAID 10 numbers look way off to me, so my next step is to go test +some different RAID configs. I'm going to look at a mirrored pair, and a +striped pair first, just to make sure the setup is sane. Then, RAID 5 x +6 disks, and mirrored pair + raid 10 with 4. Possibly software raid, +however I'm not very familiar with this on FreeBSD. + +=20 + +Once I get the RAID giving me reasonable results (I would think that a +raid 10 with 6 10k drives should be able to push >200 MB/s sustained +IO...no?) I will move on to other more DB specific tests.=20 + +=20 + +A few questions: + +1) Does anyone have other suggestions for testing raw IO for the RAID? + +=20 + +2) What is reasonable IO (bonnie++, dd) for 4 or 6 disks- RAID 10? + +=20 + +3) For DB tests, I would like to compare performance on the different +RAID configs and vs. the 1850. Maybe to assist also in some basic +postgresql.conf and OS tuning (but that will be saved mostly for when I +start application level testing). I realize that benchmarks don't +necessarily map to application performance, but it helps me establish a +baseline for the hardware. I'm currently running pgbench, but would like +something with a few more features (but hopefully without too much setup +time). I've heard mention of the OSDL's DBT tests, and I'm specifically +interested in DBT-2 and DBT-3. Any suggestions here? + +=20 + +Here's some initial numbers from pgbench (-s 50 -c 10 -t 100). Please +keep in mind that these are default installs of FreeBSD 6.1 and Postgres +8.1.4- NO tuning yet. + +1850: run1: 121 tps, run2: 132 tps, run3: 229 tps + +2950: run1: 178 tps, run2: 201 tps, run3:259 tps + +=20 + +Obviously neither PG nor FreeBSD are taking advantage of all the +hardware available in either case. + +=20 + +I will post the additional RAID numbers shortly... + +=20 + +Thanks, + +=20 + +Bucky + +=20 + +=20 + + +------_=_NextPart_001_01C6BBCC.6E775949 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + + + + + + + + + +
+ +

Hello,

+ +

 

+ +

I’ve recently been tasked with = +scalability/performance +testing of a Dell PowerEdge 2950. This is the one with the new Intel = +Woodcrest +Xeons. Since I haven’t seen any info on this box posted to the = +list, I +figured people might be interested in the results, and maybe in return = +share a +few tips on performance tweaks.

+ +

 

+ +

After doing some reading on the performance list, I = +realize +that there’s a preference for Opteron; however, the goal of these = +experiments +is to see what I can get the 2950 to do. I will also be comparing = +performance vs. +a 1850 at some point, if there’s any interest I can post those = +numbers +too.

+ +

 

+ +

Here’s the = +hardware:

+ +

2xDual Core 3.0 Ghz CPU (Xeon 5160- 1333Mhz FSB, 4 MB = +shared +cache per socket)

+ +

8 GB RAM (DDR2, fully buffered, Dual Ranked, 667 = +Mhz)

+ +

6x300 10k RPM SAS drives

+ +

Perc 5i w/256 MB battery backed = +cache

+ +

 

+ +

The target application:

+ +

Mostly OLAP (large bulk loads, then lots of = +reporting, +possibly moving to real-time loads in the future). All of this will be = +run on +FreeBSD 6.1 amd64. (If I have some extra time, I might be able to run a = +few +tests on linux just for comparison’s = +sake)

+ +

 

+ +

Test strategy:

+ +

Make sure the RAID is giving reasonable = +performance:

+ +

bonnie++ -d /u/bonnie -s = +1000:8k

+ +

time bash -c "(dd if=3D/dev/zero of=3Dbigfile = +count=3D125000 +bs=3D8k && sync)"

+ +

 

+ +

Now, I realize that the above are overly simple, and = +not +indicative of overall performance, however here’s what I’m = +seeing:

+ +

Single 10K 300 GB drive - ~75 Mb/s on both tests, = +more or +less

+ +

RAID 10, 6 disks (3 sets of mirrored pairs) - ~117 = +Mb/s

+ +

 

+ +

The RAID 10 numbers look way off to me, so my next = +step is +to go test some different RAID configs. I’m going to look at a = +mirrored +pair, and a striped pair first, just to make sure the setup is sane. = +Then, RAID +5 x 6 disks, and mirrored pair + raid 10 with 4. Possibly software raid, +however I’m not very familiar with this on = +FreeBSD.

+ +

 

+ +

Once I get the RAID giving me reasonable results (I = +would +think that a raid 10 with 6 10k drives should be able to push >200 = +MB/s +sustained IO…no?) I will move on to other more DB specific tests. = +

+ +

 

+ +

A few questions:

+ +

1) Does anyone have other suggestions for testing raw = +IO for +the RAID?

+ +

 

+ +

2) What is reasonable IO (bonnie++, dd) for 4 or 6 = +disks- +RAID 10?

+ +

 

+ +

3) For DB tests, I would like to compare performance = +on the +different RAID configs and vs. the 1850. Maybe to assist also in some = +basic +postgresql.conf and OS tuning (but that will be saved mostly for when I = +start +application level testing). I realize that benchmarks don’t = +necessarily +map to application performance, but it helps me establish a baseline for = +the +hardware. I’m currently running pgbench, but would like something = +with a +few more features (but hopefully without too much setup time). = +I’ve heard +mention of the OSDL’s DBT tests, and I’m specifically = +interested in +DBT-2 and DBT-3. Any suggestions here?

+ +

 

+ +

Here’s some initial numbers from pgbench (-s 50 = +–c +10 –t 100). Please keep in mind that these are default installs of +FreeBSD 6.1 and Postgres 8.1.4- NO tuning = +yet.

+ +

1850: run1: 121 tps, run2: 132 tps, run3: 229 = +tps

+ +

2950: run1: 178 tps, run2: 201 tps, run3:259 = +tps

+ +

 

+ +

Obviously neither PG nor FreeBSD are taking advantage = +of all +the hardware available in either case.

+ +

 

+ +

I will post the additional RAID numbers = +shortly…

+ +

 

+ +

Thanks,

+ +

 

+ +

Bucky

+ +

 

+ +

 

+ +
+ + + + + +------_=_NextPart_001_01C6BBCC.6E775949-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:20:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8B5C69FB29E + for ; + Wed, 9 Aug 2006 13:20:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 26626-07 for + ; + Wed, 9 Aug 2006 13:20:18 -0300 (ADT) +X-Greylist: delayed 14:09:46.499162 by SQLgrey- +Received: from bifrost.lang.hm (dsl081-033-126.lax1.dsl.speakeasy.net + [64.81.33.126]) by postgresql.org (Postfix) with ESMTP id 335549FB309 + for ; + Wed, 9 Aug 2006 13:20:04 -0300 (ADT) +Received: from david.lang.hm (IDENT:1000@david.lang.hm [10.0.0.5]) + by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id + k79GJreP002937; Wed, 9 Aug 2006 09:19:53 -0700 +Date: Wed, 9 Aug 2006 09:19:53 -0700 (PDT) +From: David Lang +X-X-Sender: dlang@david.lang.hm +To: Stephen Frost +cc: Alex Turner , Alvaro Nunes Melo , + pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +In-Reply-To: <20060809103012.GN20016@kenobi.snowman.net> +Message-ID: +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/151 +X-Sequence-Number: 20336 + +On Wed, 9 Aug 2006, Stephen Frost wrote: + +> * David Lang (david@lang.hm) wrote: +>> there's a huge difference between 'works on debian' and 'supported on +>> debian'. I do use debian extensivly, (along with slackware on my personal +>> machines), so i am comfortable getting things to work. but 'supported' +>> means that when you run into a problem you can call for help without being +>> told 'sorry, switch distros, then call us back'. +> +> Have you ever actually had that happen? I havn't and I've called +> support for a number of different issues for various commercial +> software. In the end it might boil down to some distribution-specific +> issue that they're not willing to fix but honestly that's pretty rare. + +unfortunantly I have, repeatedly with different products. + +if you can manage to get past the first couple of levels of support to +people who really understand things rather then just useing checklists you +are more likly to get help, but even there I've run into people who seem +eager to take the easy way out by assuming that it must be a distro thing +rather then anything with their product (even in cases where it ended up +being a simple config thing) + +David Lang + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:21:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 73F909FB29F + for ; + Wed, 9 Aug 2006 13:21:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 50178-07 for + ; + Wed, 9 Aug 2006 13:21:03 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from bifrost.lang.hm (dsl081-033-126.lax1.dsl.speakeasy.net + [64.81.33.126]) by postgresql.org (Postfix) with ESMTP id 00CDC9FB29E + for ; + Wed, 9 Aug 2006 13:21:02 -0300 (ADT) +Received: from david.lang.hm (IDENT:1000@david.lang.hm [10.0.0.5]) + by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id + k79GKtWm002958; Wed, 9 Aug 2006 09:20:55 -0700 +Date: Wed, 9 Aug 2006 09:20:55 -0700 (PDT) +From: David Lang +X-X-Sender: dlang@david.lang.hm +To: "Joshua D. Drake" +cc: Alex Turner , Alvaro Nunes Melo , + pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +In-Reply-To: <44D9DA20.3010506@commandprompt.com> +Message-ID: +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> + <44D9DA20.3010506@commandprompt.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/152 +X-Sequence-Number: 20337 + +On Wed, 9 Aug 2006, Joshua D. Drake wrote: + +>>> even many of the companies that offer support for postgres have this +>>> problem. the explination is always that they can't test every distro out +>>> there so they pick a few and support those (this is one of the reasons why +> +> Ahh and which companies would these be? As a representative of the most +> prominent one in the US I can tell you that you are not speaking from a +> knowledgeable position. + +note I said many, not all. I am aware that your company does not fall into +this catagory. + +David Lang + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:26:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4DD4A9FB2A6 + for ; + Wed, 9 Aug 2006 13:26:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 16624-01 for + ; + Wed, 9 Aug 2006 16:26:24 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.239]) + by postgresql.org (Postfix) with ESMTP id 2ADA99FB2A5 + for ; + Wed, 9 Aug 2006 13:26:23 -0300 (ADT) +Received: by wx-out-0506.google.com with SMTP id t13so198122wxc + for ; + Wed, 09 Aug 2006 09:26:23 -0700 (PDT) +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=lGPZlR5VOOj1xuno8QTUy+d9g5V0SoePhtrGuRQCGvvy6vXvtf5mYwD90rVLxgbmE86q0nz0fr+WIT2FoXBHh9NU6px4qpDFF67I2s2uou0X7MO/3GnVs3FohIYdcZVt/SBIQKuzXXcMBdsX4C3rSEkTY831LK6ZfAzgU2r82/U= +Received: by 10.70.99.11 with SMTP id w11mr1541836wxb; + Wed, 09 Aug 2006 09:26:22 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Wed, 9 Aug 2006 09:26:21 -0700 (PDT) +Message-ID: +Date: Wed, 9 Aug 2006 12:26:21 -0400 +From: "Merlin Moncure" +To: "Kenji Morishige" +Subject: Re: most bang for buck with ~ $20,000 +Cc: "Arjen van der Meijden" , + pgsql-performance@postgresql.org +In-Reply-To: <20060809063014.GO6418@juniper.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> <20060809063014.GO6418@juniper.net> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/154 +X-Sequence-Number: 20339 + +On 8/9/06, Kenji Morishige wrote: +> I have unlimited rack space, so 2U is not the issue. The boxes are stored in +> our lab for internal software tools. I'm going to research those boxes you +> mention. Regarding the JBOD enclosures, are these generally just 2U or 4U +> units with SCSI interface connectors? I didn't see these types of boxes +> availble on Dell website, I'll look again. +> -Kenji +> +> On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +> > With such a budget you should easily be able to get something like: +> > - A 1U high-performance server (for instance the Dell 1950 with 2x +> > Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +> > controller and some disks internally) +> > - An external SAS direct attached disks storage enclosure full with 15k +> > rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +> > +> > Going for the dell-solution would set you back "only" (including +> > savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +> > a DL380G5/DL385 with two MSA50's for instance) which also fit in your +> > budget afaik. The other players tend to be (a bit) more expensive, force +> > you to go with Fibre Channel or "ancient" SCSI external storage ;) +> > +> > If you'd like to have a product by a generic vendor, have a look at the +> > Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +> > sas/sata bays in 2U) for storage. + +I am really curious about the Adaptec SAS product to see what it can +do. If you don't know what SAS is, it is Sata Attached SCSI. SAS +cables use 4 sata lanes (3gb/sec each) bonded together in a single +cable. The raid is handled with via the raid controller or the o/s in +a software configuration. + +SAS is the evolution of SCSI and I think will ultimately replace scsi +in enterprise setups becuase it is faster, cheaper, and more flexible. + SAS enclosures generally accept sata or sas drives in mix/match +configurations. so, you get to choose between cheap, large, 7200 rpm +sata drives or small, expensive sas 10k or 15k rpm drives *in the +same enclosure*. You also get a compromise drive in the form of the +raptor which is 10k rpm sata drive. + +You could buy a 2u 12 drive SAS encloure (3000$), 12 150g raptors +(3000$) and spend another grand on cables/controller and have a +hellishly performing raid system for the money assuming sas performs +like it does on paper. note that i would not be trying this with my +own money unless I was guaranteed a money back rma for a 30 day +evaluation period. + +that would leave you with 12 grand or so to pick up a quad (8 core) +opeteron if you bought it right. + +regards, +merlin + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:28:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6CF289FB29F + for ; + Wed, 9 Aug 2006 13:28:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 17823-01 for + ; + Wed, 9 Aug 2006 16:27:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id A42CF9FB2A6 + for ; + Wed, 9 Aug 2006 13:27:57 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k79GRkYp008262 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Wed, 9 Aug 2006 09:27:47 -0700 +Message-ID: <44DA0CFD.6080308@commandprompt.com> +Date: Wed, 09 Aug 2006 09:27:41 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: David Lang +CC: Alex Turner , Alvaro Nunes Melo , + pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> + <44D9DA20.3010506@commandprompt.com> + +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Wed, 09 Aug 2006 09:27:47 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/155 +X-Sequence-Number: 20340 + + +>> Ahh and which companies would these be? As a representative of the +>> most prominent one in the US I can tell you that you are not speaking +>> from a knowledgeable position. +> +> note I said many, not all. I am aware that your company does not fall +> into this catagory. + +I know, but I am curious as to *what* companies. Any reputable +PostgreSQL company is going to support Linux as a whole except maybe +some fringe distros like Gentoo or RedFlag. Not to mention FreeBSD and +Solaris. + +Sincerely, + +Joshua D. Drake + + +> +> David Lang +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:37:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 394749FB2F6 + for ; + Wed, 9 Aug 2006 13:37:59 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 17961-03 for + ; + Wed, 9 Aug 2006 16:37:53 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from bifrost.lang.hm (dsl081-033-126.lax1.dsl.speakeasy.net + [64.81.33.126]) by postgresql.org (Postfix) with ESMTP id D05799FB2D5 + for ; + Wed, 9 Aug 2006 13:37:48 -0300 (ADT) +Received: from david.lang.hm (IDENT:1000@david.lang.hm [10.0.0.5]) + by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id + k79Gbbhv002995; Wed, 9 Aug 2006 09:37:37 -0700 +Date: Wed, 9 Aug 2006 09:37:37 -0700 (PDT) +From: David Lang +X-X-Sender: dlang@david.lang.hm +To: "Joshua D. Drake" +cc: Alex Turner , Alvaro Nunes Melo , + pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +In-Reply-To: <44DA0CFD.6080308@commandprompt.com> +Message-ID: +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> + <44D9DA20.3010506@commandprompt.com> + + <44DA0CFD.6080308@commandprompt.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/156 +X-Sequence-Number: 20341 + +On Wed, 9 Aug 2006, Joshua D. Drake wrote: + +>>> Ahh and which companies would these be? As a representative of the most +>>> prominent one in the US I can tell you that you are not speaking from a +>>> knowledgeable position. +>> +>> note I said many, not all. I am aware that your company does not fall into +>> this catagory. +> +> I know, but I am curious as to *what* companies. Any reputable PostgreSQL +> company is going to support Linux as a whole except maybe some fringe distros +> like Gentoo or RedFlag. Not to mention FreeBSD and Solaris. + +I'm not going to name names in public, but I will point out that different +companies definitions of what constatutes 'fringe distros' are different. +For some any linux other then RedHat Enterprise or SuSE is a fringe distro +(with SuSE being a relativly recent addition, for a while RedHat were +frequently the only supported distro versions) + +and please note, when I'm talking about support, it's not just postgresql +support, but also hardware/driver support that can run into these problems + +David Lang + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:45:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A0E539FB2F4 + for ; + Wed, 9 Aug 2006 13:45:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 22651-02 for + ; + Wed, 9 Aug 2006 16:45:15 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 2C7A29FB1F8 + for ; + Wed, 9 Aug 2006 13:45:14 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Wed, 9 Aug 2006 16:45:13 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 09 Aug 2006 11:45:13 -0500 +Subject: Re: Hardware upgraded but performance still ain't good +From: Scott Marlowe +To: David Lang +Cc: "Joshua D. Drake" , Alex Turner , + Alvaro Nunes Melo , pgsql-performance@postgresql.org +In-Reply-To: +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> + <44D9DA20.3010506@commandprompt.com> + + <44DA0CFD.6080308@commandprompt.com> + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155141913.20252.96.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Wed, 09 Aug 2006 11:45:13 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/157 +X-Sequence-Number: 20342 + +On Wed, 2006-08-09 at 11:37, David Lang wrote: +> On Wed, 9 Aug 2006, Joshua D. Drake wrote: +> +> >>> Ahh and which companies would these be? As a representative of the most +> >>> prominent one in the US I can tell you that you are not speaking from a +> >>> knowledgeable position. +> >> +> >> note I said many, not all. I am aware that your company does not fall into +> >> this catagory. +> > +> > I know, but I am curious as to *what* companies. Any reputable PostgreSQL +> > company is going to support Linux as a whole except maybe some fringe distros +> > like Gentoo or RedFlag. Not to mention FreeBSD and Solaris. +> +> I'm not going to name names in public, but I will point out that different +> companies definitions of what constatutes 'fringe distros' are different. +> For some any linux other then RedHat Enterprise or SuSE is a fringe distro +> (with SuSE being a relativly recent addition, for a while RedHat were +> frequently the only supported distro versions) +> +> and please note, when I'm talking about support, it's not just postgresql +> support, but also hardware/driver support that can run into these problems + +I've run into this as well. Generally speaking, the larger the company, +the more likely you are to get the "we don't support that" line. + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:52:16 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id F1C299FB21B + for ; + Wed, 9 Aug 2006 13:52:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 74032-07 for + ; + Wed, 9 Aug 2006 13:51:56 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from m.wordtothewise.com (goliath.word-to-the-wise.com + [208.187.80.130]) + by postgresql.org (Postfix) with ESMTP id 242B09FB1F8 + for ; + Wed, 9 Aug 2006 13:51:55 -0300 (ADT) +Received: from [10.3.2.25] (184.word-to-the-wise.com [208.187.80.184]) + (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by m.wordtothewise.com (Postfix) with ESMTP id C00BAFF96 + for ; + Wed, 9 Aug 2006 09:51:54 -0700 (PDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <44D9D96E.7030706@commandprompt.com> +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <44D9D96E.7030706@commandprompt.com> +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <9157C32A-0C41-4805-884B-CE3FEEE8CF30@blighty.com> +Content-Transfer-Encoding: 7bit +From: Steve Atkins +Subject: Re: Hardware upgraded but performance still ain't good +Date: Wed, 9 Aug 2006 09:50:58 -0700 +To: pgsql-performance@postgresql.org +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/158 +X-Sequence-Number: 20343 + + +On Aug 9, 2006, at 5:47 AM, Joshua D. Drake wrote: + +> Alex Turner wrote: +>> First off - very few third party tools support debian. Debian is +>> a sure +>> fire way to have an unsupported system. Use RedHat or SuSe (flame +>> me all +>> you want, it doesn't make it less true). +> +> *cough* BS *cough* +> +> Linux is Linux. It doesn't matter what trademark you put on top of +> it. As long as they are running a current version of Linux (e.g; +> kernel 2.6) they should be fine. + +That's really not the case, at least to the degree that makes a +difference between "supported" and "unsupported". +> +> With Debian that may or may not be the case and that could be an +> issue. +> To get the best luck, I would suggest (if you want to stay with a +> Debian base) Ubuntu Dapper LTS. + +Different Linux distributions include different shared libraries, put +different things in different places and generally break applications +in a variety of different ways (SELinux would be one example of +that commonly seen here). + +If I don't QA my application on it, it isn't supported. I can't +necessarily +replicate problems on Linux distributions I don't have installed in +my QA lab, so I can't guarantee to fix problems that are specific +to that distribution. I can't even be sure that it will install and run +correctly without doing basic QA of the installation process on +that distribution. + +And in my case that's just for user space applications. It's got to +be even worse for hardware drivers. + +Our usual phrase is "We support RedHat versions *mumble* +only. We expect our application to run correctly on any Linux +distribution, though you may have to install additional shared +libraries." + +I'm quite happy with customers running Debian, SuSe or what +have you, as long as they have access to a sysadmin who's +comfortable with that distribution. (I'd probably deny support to +anyone running Gentoo, though :) ) + +We've never had big problems with people running our apps on +"unsupported" problems, but those users have had to do some +more diagnosis of problems themselves, and we've been less +able to support them than we can users who use the same +distribution we QA on. + +(It's not just Linux, either. We "support" Windows XP, but we run +just fine on 2000 and 95/98.) + +Cheers, + Steve + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 13:54:00 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3622E9FB21B + for ; + Wed, 9 Aug 2006 13:54:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 25714-03 for + ; + Wed, 9 Aug 2006 16:53:50 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 0F7769FB1F8 + for ; + Wed, 9 Aug 2006 13:53:49 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k79GrZ9j008943 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Wed, 9 Aug 2006 09:53:36 -0700 +Message-ID: <44DA130E.9010801@commandprompt.com> +Date: Wed, 09 Aug 2006 09:53:34 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Scott Marlowe +CC: David Lang , Alex Turner , + Alvaro Nunes Melo , pgsql-performance@postgresql.org +Subject: Re: Hardware upgraded but performance still ain't good +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <20060808120529.GL20016@kenobi.snowman.net> + + <20060809103012.GN20016@kenobi.snowman.net> + <44D9DA20.3010506@commandprompt.com> + + <44DA0CFD.6080308@commandprompt.com> + + <1155141913.20252.96.camel@state.g2switchworks.com> +In-Reply-To: <1155141913.20252.96.camel@state.g2switchworks.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Wed, 09 Aug 2006 09:53:37 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/159 +X-Sequence-Number: 20344 + +>> +>> and please note, when I'm talking about support, it's not just postgresql +>> support, but also hardware/driver support that can run into these problems +> +> I've run into this as well. Generally speaking, the larger the company, +> the more likely you are to get the "we don't support that" line. +> + +/me *chuckles* and whispers to himself.. no wonder were winning. + +Sincerely, + +Joshua D. Drake + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:06:09 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 26C2C9FB1F0 + for ; + Wed, 9 Aug 2006 18:06:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 74800-05 for + ; + Wed, 9 Aug 2006 21:05:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id B2B109FB25E + for ; + Wed, 9 Aug 2006 18:05:57 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 5575056442; Wed, 9 Aug 2006 16:05:41 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 16:05:40 -0500 +Date: Wed, 9 Aug 2006 16:05:40 -0500 +From: "Jim C. Nasby" +To: Steve Poe +Cc: Luke Lonergan , Alex Turner , + pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060809210539.GR40481@pervasive.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060809:steve.poe@gmail.com::ZIW4J+1x1aY6q/Gs:000000000000000000 + 00000000000000000000000001xc +X-Hashcash: + 1:20:060809:llonergan@greenplum.com::XW4+h9XsdYcUq9/E:00000000000000 + 00000000000000000000000002WG +X-Hashcash: 1:20:060809:armtuk@gmail.com::xkSNi2as1no0ARlA:05Urj +X-Hashcash: + 1:20:060809:pgsql-performance@postgresql.org::3fm/xeu80X87/Qae:00000 + 0000000000000000000000009UaZ +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/160 +X-Sequence-Number: 20345 + +On Tue, Aug 08, 2006 at 10:45:07PM -0700, Steve Poe wrote: +> Luke, +> +> I thought so. In my test, I tried to be fair/equal since my Sun box has two +> 4-disc arrays each on their own channel. So, I just used one of them which +> should be a little slower than the 6-disc with 192MB cache. +> +> Incidently, the two internal SCSI drives, which are on the 6i adapter, +> generated a TPS of 18. + +You should try putting pg_xlog on the 6 drive array with the data. My +(limited) experience with such a config is that on a good controller +with writeback caching enabled it won't hurt you, and if the internal +drives aren't caching writes it'll probably help you a lot. + +> I thought this server would impressive from notes I've read in the group. +> This is why I thought I might be doing something wrong. I stumped which way +> to take this. There is no obvious fault but something isn't right. +> +> Steve +> +> On 8/8/06, Luke Lonergan wrote: +> > +> >Steve, +> > +> >> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 +> >> LSI MegaRAID 128MB). This is after 8 runs. +> >> +> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> >> +> >> Average TPS is 75 +> >> +> >> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +> >> with 192MB RAM. After 8 runs, I see: +> >> +> >> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> >> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> >> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> >> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> >> +> >> Average TPS is 31. +> > +> >Note that the I/O wait (wa) on the HP box high, low and average are all +> >*much* higher than on the Sun box. The average I/O wait was 50% of one +> >CPU, which is huge. By comparison there was virtually no I/O wait on +> >the Sun machine. +> > +> >This is indicating that your HP machine is indeed I/O bound and +> >furthermore is tying up a PG process waiting for the disk to return. +> > +> >- Luke +> > +> > + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:09:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 36CE79FB2F8 + for ; + Wed, 9 Aug 2006 18:09:15 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 04551-04 for + ; + Wed, 9 Aug 2006 18:09:05 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 8AEBA9FB1F0 + for ; + Wed, 9 Aug 2006 18:09:05 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 35B6A5643D; Wed, 9 Aug 2006 16:09:04 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 16:09:04 -0500 +Date: Wed, 9 Aug 2006 16:09:04 -0500 +From: "Jim C. Nasby" +To: pgsql-performance@postgresql.org +Subject: Re: Performance with 2 AMD/Opteron 2.6Ghz and 8gig +Message-ID: <20060809210903.GS40481@pervasive.com> +References: <7F10D26ECFA1FB458B89C5B4B0D72C2B4E4D9B@sesrv12.wirelesscar.com> + + <44D72D11.7050203@logix-tt.com> + <33c6269f0608071302h6429cfcn71074709c5cd53ff@mail.gmail.com> + <20060807202002.GA7380@uio.no> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060807202002.GA7380@uio.no> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060809:pgsql-performance@postgresql.org::Hou3/JpKSuLBb6J7:00000 + 000000000000000000000000011s +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.103 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/161 +X-Sequence-Number: 20346 + +On Mon, Aug 07, 2006 at 10:20:02PM +0200, Steinar H. Gunderson wrote: +> On Mon, Aug 07, 2006 at 04:02:52PM -0400, Alex Turner wrote: +> > Although I for one have yet to see a controller that actualy does this (I +> > believe software RAID on linux doesn't either). +> +> Linux' software RAID does. See earlier threads for demonstrations. + +The real question: will it balance within a single thread? + +Cheaper raid setups will balance individual requests between devices, +but good ones should be able to service a single request from both +devices (assuming it's reading more than whatever the stripe size is). +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:12:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D14679FB302 + for ; + Wed, 9 Aug 2006 18:12:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 74800-07 for + ; + Wed, 9 Aug 2006 21:11:53 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.187]) + by postgresql.org (Postfix) with ESMTP id 460499FB1F0 + for ; + Wed, 9 Aug 2006 18:11:49 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so322118nfc + for ; + Wed, 09 Aug 2006 14:11:38 -0700 (PDT) +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:references; + b=g2zD1dd/WXLNDwmTFHr0lV5x/cmu8ILpeIBWyBd9boAHrFGqGtbv6yURraViJ+U26egUYUBQav40v3QcbuiWoujFQyu3oM880Kh6czayvqVYuictzDApUvpPMA4H4LX5CfCNu16sxB+FhLQJRYdML7Lzj2yUQlPJ/2HYULoKSCg= +Received: by 10.78.200.3 with SMTP id x3mr680330huf; + Wed, 09 Aug 2006 14:11:37 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Wed, 9 Aug 2006 14:11:37 -0700 (PDT) +Message-ID: <721b21dc0608091411g3a1a6e60q449de0d91020f9dc@mail.gmail.com> +Date: Wed, 9 Aug 2006 14:11:37 -0700 +From: "Steve Poe" +To: "Jim C. Nasby" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Luke Lonergan" , + "Alex Turner" , + pgsql-performance@postgresql.org +In-Reply-To: <20060809210539.GR40481@pervasive.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_45863_33074066.1155157897673" +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/162 +X-Sequence-Number: 20347 + +------=_Part_45863_33074066.1155157897673 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Jim, + +I'll give it a try. However, I did not see anywhere in the BIOS +configuration of the 642 RAID adapter to enable writeback. It may have been +mislabled cache accelerator where you can give a percentage to read/write. +That aspect did not change the performance like the LSI MegaRAID adapter +does. + +Steve + +On 8/9/06, Jim C. Nasby wrote: +> +> On Tue, Aug 08, 2006 at 10:45:07PM -0700, Steve Poe wrote: +> > Luke, +> > +> > I thought so. In my test, I tried to be fair/equal since my Sun box has +> two +> > 4-disc arrays each on their own channel. So, I just used one of them +> which +> > should be a little slower than the 6-disc with 192MB cache. +> > +> > Incidently, the two internal SCSI drives, which are on the 6i adapter, +> > generated a TPS of 18. +> +> You should try putting pg_xlog on the 6 drive array with the data. My +> (limited) experience with such a config is that on a good controller +> with writeback caching enabled it won't hurt you, and if the internal +> drives aren't caching writes it'll probably help you a lot. +> +> > I thought this server would impressive from notes I've read in the +> group. +> > This is why I thought I might be doing something wrong. I stumped which +> way +> > to take this. There is no obvious fault but something isn't right. +> > +> > Steve +> > +> > On 8/8/06, Luke Lonergan wrote: +> > > +> > >Steve, +> > > +> > >> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 +> > >> LSI MegaRAID 128MB). This is after 8 runs. +> > >> +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> > >> +> > >> Average TPS is 75 +> > >> +> > >> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +> > >> with 192MB RAM. After 8 runs, I see: +> > >> +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> > >> +> > >> Average TPS is 31. +> > > +> > >Note that the I/O wait (wa) on the HP box high, low and average are all +> > >*much* higher than on the Sun box. The average I/O wait was 50% of one +> > >CPU, which is huge. By comparison there was virtually no I/O wait on +> > >the Sun machine. +> > > +> > >This is indicating that your HP machine is indeed I/O bound and +> > >furthermore is tying up a PG process waiting for the disk to return. +> > > +> > >- Luke +> > > +> > > +> +> -- +> Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +> Pervasive Software http://pervasive.com work: 512-231-6117 +> vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 +> + +------=_Part_45863_33074066.1155157897673 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Jim,

I'll give it a try. However, I did not see anywhere in the BIOS configuration of the 642 RAID adapter to enable writeback. It may have been mislabled cache accelerator where you can give a percentage to read/write. That aspect did not change the performance like the LSI MegaRAID adapter does. +

Steve

On 8/9/06, Jim C. Nasby <jnasby@pervasive.com> wrote:
+On Tue, Aug 08, 2006 at 10:45:07PM -0700, Steve Poe wrote:
> Luke,
>
> I thought so. In my test, I tried to be fair/equal since my Sun box has two
> 4-disc arrays each on their own channel. So, I just used one of them which +
> should be a little slower than the 6-disc with 192MB cache.
>
> Incidently, the two internal SCSI drives, which are on the 6i adapter,
> generated a TPS of 18.

You should try putting pg_xlog on the 6 drive array with the data. My +
(limited) experience with such a config is that on a good controller
with writeback caching enabled it won't hurt you, and if the internal
drives aren't caching writes it'll probably help you a lot.

> I thought this server would impressive from notes I've read in the group. +
> This is why I thought I might be doing something wrong. I stumped which way
> to take this. There is no obvious fault but something isn't right.
>
> Steve
>
> On 8/8/06, Luke Lonergan < +LLonergan@greenplum.com> wrote:
> >
> >Steve,
> >
> >> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10
> >> LSI MegaRAID 128MB). This is after 8 runs. +
> >>
> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5
> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53
> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +
> >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38
> >>
> >> Average TPS is 75
> >>
> >> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +
> >> with 192MB RAM. After 8 runs, I see:
> >>
> >> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3
> >> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1
> >> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +
> >> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42
> >>
> >> Average TPS is 31.
> >
> >Note that the I/O wait (wa) on the HP box high, low and average are all
+> >*much* higher than on the Sun box.  The average I/O wait was 50% of one
> >CPU, which is huge.  By comparison there was virtually no I/O wait on
> >the Sun machine.
> >
> >This is indicating that your HP machine is indeed I/O bound and +
> >furthermore is tying up a PG process waiting for the disk to return.
> >
> >- Luke
> >
> >

--
Jim C. Nasby, Sr. Engineering Consultant       +jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf +       cell: 512-569-9461

+ +------=_Part_45863_33074066.1155157897673-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:20:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ED6D79FB2F8 + for ; + Wed, 9 Aug 2006 18:20:52 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 17573-03 for + ; + Wed, 9 Aug 2006 18:20:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id DF0359FB1F0 + for ; + Wed, 9 Aug 2006 18:20:47 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 9459C56440; Wed, 9 Aug 2006 16:20:46 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 16:20:46 -0500 +Date: Wed, 9 Aug 2006 16:20:46 -0500 +From: "Jim C. Nasby" +To: Eugeny N Dzhurinsky +Cc: pgsql-performance@postgresql.org +Subject: Re: vacuuming +Message-ID: <20060809212045.GT40481@pervasive.com> +References: <20060808073956.GA2087@office.redwerk.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060808073956.GA2087@office.redwerk.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: 1:20:060809:bofh@redwerk.com::ROz/1tomwpY15rFp:0325Q +X-Hashcash: + 1:20:060809:pgsql-performance@postgresql.org::dJ8chrHcvffEgr6S:00000 + 0000000000000000000000002POF +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.102 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/163 +X-Sequence-Number: 20348 + +On Tue, Aug 08, 2006 at 10:39:56AM +0300, Eugeny N Dzhurinsky wrote: +> Hello +> +> I have pg_autovacuum running with the arguments: +> +> pg_autovacuum -D -s 120 -v 10000 + +It's been a while since I looked at the pg_autovac settings, but I know +that it's threasholds were way, way to high. They were set to something +like 2, when 0.2 is a better idea. + +> the database is postgresql 8.0.0 +> +> Sometimes load average on server raises to 20 and it is almost impossible to +> login via SSH +> +> When I'm logging in finally, I see there is cpu usage: 6% and iowait 95% +> +> ps ax | grep post gives me +> +> postgres: postgres db [local] VACUUM +> +> Is there some solution to avoid such cases? + +Have you turned on vacuum_cost_delay? +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:28:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 08CB09FB2F9 + for ; + Wed, 9 Aug 2006 18:28:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 77583-07 for + ; + Wed, 9 Aug 2006 21:28:07 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 774939FB2F8 + for ; + Wed, 9 Aug 2006 18:28:07 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 882AF56437; Wed, 9 Aug 2006 16:28:05 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 16:28:04 -0500 +Date: Wed, 9 Aug 2006 16:28:04 -0500 +From: "Jim C. Nasby" +To: Christopher Browne +Cc: pgsql-performance@postgresql.org +Subject: Re: shared_buffer optimization +Message-ID: <20060809212804.GU40481@pervasive.com> +References: <44D86A00.90106@rentalia.com> <87u04nv2q6.fsf@wolfe.cbbrowne.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <87u04nv2q6.fsf@wolfe.cbbrowne.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: 1:20:060809:cbbrowne@acm.org::Y7rCP3hnDROzrHGa:041La +X-Hashcash: + 1:20:060809:pgsql-performance@postgresql.org::BZ73PPnBs2x5eO0x:00000 + 0000000000000000000000004OUr +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/164 +X-Sequence-Number: 20349 + +On Tue, Aug 08, 2006 at 08:20:01AM -0400, Christopher Browne wrote: +> I'm not aware of any actual evidence having emerged that it is of any +> value to set shared buffers higher than 10000. + +http://flightaware.com + +They saw a large increase in how many concurrent connections they could +handle when they bumped shared_buffers up from ~10% to 50% of memory. +Back then they had 4G of memory. They're up to 12G right now, but +haven't bumped shared_buffers up. + +Every single piece of advice I've seen on shared_buffers comes from the +7.x era, when our buffer management was extremely simplistic. IMO all of +that knowledge was made obsolete when 8.0 came out, and our handling of +shared_buffers has improved ever further since then. This is definately +an area that could use a lot more testing. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:36:00 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 81BB19FB2F9 + for ; + Wed, 9 Aug 2006 18:35:59 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 82381-06 for + ; + Wed, 9 Aug 2006 21:35:48 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 4A7989FB2F8 + for ; + Wed, 9 Aug 2006 18:35:46 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 9D26E56435; Wed, 9 Aug 2006 16:35:44 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 16:35:43 -0500 +Date: Wed, 9 Aug 2006 16:35:43 -0500 +From: "Jim C. Nasby" +To: Scott Marlowe +Cc: "Thomas F. O'Connell" , + "Joshua D.Drake" , + Kenji Morishige , pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060809213543.GV40481@pervasive.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> + <1155136527.20252.90.camel@state.g2switchworks.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1155136527.20252.90.camel@state.g2switchworks.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060809:smarlowe@g2switchworks.com::mJ9Lus2rbvmK0ndn:00000000000 + 0000000000000000000000002EkL +X-Hashcash: 1:20:060809:tfo@sitening.com::N33ZVivTZB32gM2b:00bF9 +X-Hashcash: + 1:20:060809:jd@commandprompt.com::6+xag+Kn0dT8lsSy:00000000000000000 + 0000000000000000000000001l2t +X-Hashcash: + 1:20:060809:kenjim@juniper.net::RCnzXRDTI5AdK5A+:0000000000000000000 + 0000000000000000000000003plI +X-Hashcash: + 1:20:060809:pgsql-performance@postgresql.org::SqndjHObEoCEXgD6:00000 + 0000000000000000000000004aaW +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/165 +X-Sequence-Number: 20350 + +On Wed, Aug 09, 2006 at 10:15:27AM -0500, Scott Marlowe wrote: +> Actually, the BIGGEST win comes when you've got battery backed cache on +> your RAID controller. In fact, I'd spend money on a separate RAID +> controller for xlog with its own cache hitting a simple mirror set +> before I'd spring for more drives on pg_xlog. The battery backed cache +> on the pg_xlog likely wouldn't need to be big, just there and set to +> write-back. +> +> Then put all the rest of your cash into disks on a big RAID 10 config, +> and as big of a battery backed cache as you can afford for it and memory +> for the machine. + +Actually, my (limited) testing has show than on a good battery-backed +controller, there's no penalty to leaving pg_xlog in with the rest of +PGDATA. This means that the OP could pile all 8 drives into a RAID10, +which would almost certainly do better than 6+2. + +Note that some controllers (such as 3ware) need to periodically test the +life of the BBU, and they disable write caching when they do so, which +would tank performance. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:37:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8F6AD9FB2F9 + for ; + Wed, 9 Aug 2006 18:37:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 06816-09 for + ; + Wed, 9 Aug 2006 18:37:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 17A2C9FB2F8 + for ; + Wed, 9 Aug 2006 18:37:29 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Wed, 9 Aug 2006 21:37:28 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 09 Aug 2006 16:37:28 -0500 +Subject: Re: Postgresql Performance on an HP DL385 and +From: Scott Marlowe +To: Steve Poe +Cc: "Jim C. Nasby" , + Luke Lonergan , + Alex Turner , pgsql-performance@postgresql.org +In-Reply-To: <721b21dc0608091411g3a1a6e60q449de0d91020f9dc@mail.gmail.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <721b21dc0608091411g3a1a6e60q449de0d91020f9dc@mail.gmail.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155159448.20252.121.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Wed, 09 Aug 2006 16:37:28 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.107 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/166 +X-Sequence-Number: 20351 + +On Wed, 2006-08-09 at 16:11, Steve Poe wrote: +> Jim, +> +> I'll give it a try. However, I did not see anywhere in the BIOS +> configuration of the 642 RAID adapter to enable writeback. It may have +> been mislabled cache accelerator where you can give a percentage to +> read/write. That aspect did not change the performance like the LSI +> MegaRAID adapter does. + +Nope, that's not the same thing. + +Does your raid controller have batter backed cache, or plain or regular +cache? write back is unsafe without battery backup. + +The default is write through (i.e. the card waits for the data to get +written out before acking an fsync). In write back, the card's driver +writes the data to the bb cache, then returns on an fsync while the +cache gets written out at leisure. In the event of a loss of power, the +cache is flushed on restart. + +From pgsql-performance-owner@postgresql.org Wed Aug 9 18:50:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 99E649FA430 + for ; + Wed, 9 Aug 2006 18:50:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 42090-01 for + ; + Wed, 9 Aug 2006 18:50:32 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 23AB29FA383 + for ; + Wed, 9 Aug 2006 18:50:32 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Wed, 9 Aug 2006 21:50:30 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 09 Aug 2006 16:50:30 -0500 +Subject: Re: most bang for buck with ~ $20,000 +From: Scott Marlowe +To: "Jim C. Nasby" +Cc: "Thomas F. O'Connell" , + "Joshua D.Drake" , + Kenji Morishige , pgsql-performance@postgresql.org +In-Reply-To: <20060809213543.GV40481@pervasive.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> + <1155136527.20252.90.camel@state.g2switchworks.com> + <20060809213543.GV40481@pervasive.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155160230.20252.124.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Wed, 09 Aug 2006 16:50:30 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.105 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/167 +X-Sequence-Number: 20352 + +On Wed, 2006-08-09 at 16:35, Jim C. Nasby wrote: +> On Wed, Aug 09, 2006 at 10:15:27AM -0500, Scott Marlowe wrote: +> > Actually, the BIGGEST win comes when you've got battery backed cache on +> > your RAID controller. In fact, I'd spend money on a separate RAID +> > controller for xlog with its own cache hitting a simple mirror set +> > before I'd spring for more drives on pg_xlog. The battery backed cache +> > on the pg_xlog likely wouldn't need to be big, just there and set to +> > write-back. +> > +> > Then put all the rest of your cash into disks on a big RAID 10 config, +> > and as big of a battery backed cache as you can afford for it and memory +> > for the machine. +> +> Actually, my (limited) testing has show than on a good battery-backed +> controller, there's no penalty to leaving pg_xlog in with the rest of +> PGDATA. This means that the OP could pile all 8 drives into a RAID10, +> which would almost certainly do better than 6+2. + +I've seen a few posts that said that before. I wonder if there's a +point where the single RAID array / controller would get saturated and a +second one would help. I think most of the testing I've seen so far has +been multiple RAID arrays under the same controller, hasn't it? + +> Note that some controllers (such as 3ware) need to periodically test the +> life of the BBU, and they disable write caching when they do so, which +> would tank performance. + +ugh, that's a scary thing. Can you at least schedule it? + +From pgsql-performance-owner@postgresql.org Wed Aug 9 19:00:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C4E219FA6BB + for ; + Wed, 9 Aug 2006 19:00:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 46801-01 for + ; + Wed, 9 Aug 2006 19:00:00 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id F374A9FA148 + for ; + Wed, 9 Aug 2006 18:59:59 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 3B6B05644C; Wed, 9 Aug 2006 16:59:58 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 16:59:56 -0500 +Date: Wed, 9 Aug 2006 16:59:56 -0500 +From: "Jim C. Nasby" +To: Scott Marlowe +Cc: "Thomas F. O'Connell" , + "Joshua D.Drake" , + Kenji Morishige , pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060809215955.GB40481@pervasive.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> + <1155136527.20252.90.camel@state.g2switchworks.com> + <20060809213543.GV40481@pervasive.com> + <1155160230.20252.124.camel@state.g2switchworks.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1155160230.20252.124.camel@state.g2switchworks.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060809:smarlowe@g2switchworks.com::Ex50qwm9zLidM30p:00000000000 + 000000000000000000000000332s +X-Hashcash: 1:20:060809:tfo@sitening.com::jhM34cAW3Xop0Szu:03k2h +X-Hashcash: + 1:20:060809:jd@commandprompt.com::q6/wMEK2ihpeDnPf:00000000000000000 + 0000000000000000000000000XzB +X-Hashcash: + 1:20:060809:kenjim@juniper.net::f1MOdDnXhHPVCZT0:0000000000000000000 + 0000000000000000000000008zV3 +X-Hashcash: + 1:20:060809:pgsql-performance@postgresql.org::XU5+dBgidJsmBZKf:00000 + 0000000000000000000000008T2S +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.098 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/168 +X-Sequence-Number: 20353 + +On Wed, Aug 09, 2006 at 04:50:30PM -0500, Scott Marlowe wrote: +> On Wed, 2006-08-09 at 16:35, Jim C. Nasby wrote: +> > On Wed, Aug 09, 2006 at 10:15:27AM -0500, Scott Marlowe wrote: +> > > Actually, the BIGGEST win comes when you've got battery backed cache on +> > > your RAID controller. In fact, I'd spend money on a separate RAID +> > > controller for xlog with its own cache hitting a simple mirror set +> > > before I'd spring for more drives on pg_xlog. The battery backed cache +> > > on the pg_xlog likely wouldn't need to be big, just there and set to +> > > write-back. +> > > +> > > Then put all the rest of your cash into disks on a big RAID 10 config, +> > > and as big of a battery backed cache as you can afford for it and memory +> > > for the machine. +> > +> > Actually, my (limited) testing has show than on a good battery-backed +> > controller, there's no penalty to leaving pg_xlog in with the rest of +> > PGDATA. This means that the OP could pile all 8 drives into a RAID10, +> > which would almost certainly do better than 6+2. +> +> I've seen a few posts that said that before. I wonder if there's a +> point where the single RAID array / controller would get saturated and a +> second one would help. I think most of the testing I've seen so far has +> been multiple RAID arrays under the same controller, hasn't it? + +Yeah. I've had one client try it so far, but it was a pretty small array +(8 drives, IIRC). + +I suspect that by the time you get to a size where you're saturating a +controller, you're looking at enough drives where having two extra +(instead of dedicating them to pg_xlog) won't make much difference. + +> > Note that some controllers (such as 3ware) need to periodically test the +> > life of the BBU, and they disable write caching when they do so, which +> > would tank performance. +> +> ugh, that's a scary thing. Can you at least schedule it? + +Yeah, it's not automatic at all. Which itself is somewhat scarry.... +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-bugs-owner@postgresql.org Wed Aug 9 19:27:01 2006 +X-Original-To: pgsql-bugs-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A51519FB2E3 + for ; + Wed, 9 Aug 2006 19:27:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 18322-02 for ; + Wed, 9 Aug 2006 22:26:52 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id A4C619FB2CC + for ; Wed, 9 Aug 2006 19:26:52 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 166E056435; Wed, 9 Aug 2006 17:26:51 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); + Wed, 9 Aug 2006 17:26:50 -0500 +Date: Wed, 9 Aug 2006 17:26:50 -0500 +From: "Jim C. Nasby" +To: kumarselvan +Cc: pgsql-performance@postgresql.org +Subject: Re: BUG #2567: High IOWAIT +Message-ID: <20060809222650.GC40481@pervasive.com> +References: <200608080842.k788g2hG044049@wwwmaster.postgresql.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <200608080842.k788g2hG044049@wwwmaster.postgresql.org> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060809:pgsql-bugs@postgresql.org::rG54YMPdloBhxO5z:000000000000 + 000000000000000000000000203g +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/68 +X-Sequence-Number: 15543 + +This isn't a bug; moving to pgsql-performance. + +On Tue, Aug 08, 2006 at 08:42:02AM +0000, kumarselvan wrote: +> i have installed the postgres as mentioned in the Install file. it is a 4 +> cpu 8 GB Ram Machine installed with Linux Enterprise version 3. when i am +> running a load which will perfrom 40 inserts persecond on 2 tables and 10 +> updates per 10seconds on differnt table IOWait on avg going upto 70% due to +> which i am not able to increase the load. Is there is any other way to +> install the postgres on multiprocessor machine.. can any one help me on +> this... + +You haven't given us nearly enough information. What kind of hardware is +this? RAID? What changes have you made to postgresql.conf? +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 9 19:37:17 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 02C639FB265 + for ; + Wed, 9 Aug 2006 19:37:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 43717-01 for + ; + Wed, 9 Aug 2006 22:37:08 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 0350C9FB2D5 + for ; + Wed, 9 Aug 2006 19:37:07 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k79Mb0db000920; + Wed, 9 Aug 2006 18:37:00 -0400 (EDT) +To: "Jim C. Nasby" +cc: Christopher Browne , pgsql-performance@postgresql.org +Subject: Re: shared_buffer optimization +In-reply-to: <20060809212804.GU40481@pervasive.com> +References: <44D86A00.90106@rentalia.com> <87u04nv2q6.fsf@wolfe.cbbrowne.com> + <20060809212804.GU40481@pervasive.com> +Comments: In-reply-to "Jim C. Nasby" + message dated "Wed, 09 Aug 2006 16:28:04 -0500" +Date: Wed, 09 Aug 2006 18:37:00 -0400 +Message-ID: <919.1155163020@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/170 +X-Sequence-Number: 20355 + +"Jim C. Nasby" writes: +> Every single piece of advice I've seen on shared_buffers comes from the +> 7.x era, when our buffer management was extremely simplistic. IMO all of +> that knowledge was made obsolete when 8.0 came out, and our handling of +> shared_buffers has improved ever further since then. This is definately +> an area that could use a lot more testing. + +Actually I think it was probably 8.1 that made the significant +difference there, by getting rid of the single point of contention +for shared-buffer management. I concur that 7.x-era rules of thumb +may well be obsolete --- we need some credible scaling tests ... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 9 20:47:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 802319FB30D + for ; + Wed, 9 Aug 2006 20:47:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 53306-07-3 + for ; + Wed, 9 Aug 2006 23:47:15 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.185]) + by postgresql.org (Postfix) with ESMTP id E69D99FB2EC + for ; + Wed, 9 Aug 2006 20:47:14 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so370662nfc + for ; + Wed, 09 Aug 2006 16:47:10 -0700 (PDT) +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:references; + b=ceAXRr6Rpnw0xPOanA0Wmu159A9H5xK0JJQvEnSnKArEuI1Q2s51ICEYChF8ObeUEwToAuxNCZ6v71tK1t0s1niL1pnVIkuGq/w9KTVP3KC7xNk0K1zcErnO13cu2dmqWkZZ28j9FClmkmfXVDbSJHPBcAzHIy9sT7dm+EA4r2w= +Received: by 10.78.177.3 with SMTP id z3mr837618hue; + Wed, 09 Aug 2006 16:47:10 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Wed, 9 Aug 2006 16:47:10 -0700 (PDT) +Message-ID: <721b21dc0608091647w7116e1b6xf1313d4d1df34a4d@mail.gmail.com> +Date: Wed, 9 Aug 2006 16:47:10 -0700 +From: "Steve Poe" +To: "Scott Marlowe" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Jim C. Nasby" , + "Luke Lonergan" , + "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <1155159448.20252.121.camel@state.g2switchworks.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_48267_7541056.1155167230719" +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <721b21dc0608091411g3a1a6e60q449de0d91020f9dc@mail.gmail.com> + <1155159448.20252.121.camel@state.g2switchworks.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/171 +X-Sequence-Number: 20356 + +------=_Part_48267_7541056.1155167230719 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + + I believe it does, I'll need to check.Thanks for the correction. + +Steve + +On 8/9/06, Scott Marlowe wrote: +> +> On Wed, 2006-08-09 at 16:11, Steve Poe wrote: +> > Jim, +> > +> > I'll give it a try. However, I did not see anywhere in the BIOS +> > configuration of the 642 RAID adapter to enable writeback. It may have +> > been mislabled cache accelerator where you can give a percentage to +> > read/write. That aspect did not change the performance like the LSI +> > MegaRAID adapter does. +> +> Nope, that's not the same thing. +> +> Does your raid controller have batter backed cache, or plain or regular +> cache? write back is unsafe without battery backup. +> +> The default is write through (i.e. the card waits for the data to get +> written out before acking an fsync). In write back, the card's driver +> writes the data to the bb cache, then returns on an fsync while the +> cache gets written out at leisure. In the event of a loss of power, the +> cache is flushed on restart. +> + +------=_Part_48267_7541056.1155167230719 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + + I believe it does, I'll need to check.Thanks for the correction.
+
+Steve

On 8/9/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
+On Wed, 2006-08-09 at 16:11, Steve Poe wrote:
> Jim,
>
> I'll give it a try. However, I did not see anywhere in the BIOS
> configuration of the 642 RAID adapter to enable writeback. It may have
+> been mislabled cache accelerator where you can give a percentage to
> read/write. That aspect did not change the performance like the LSI
> MegaRAID adapter does.

Nope, that's not the same thing.
+
Does your raid controller have batter backed cache, or plain or regular
cache?  write back is unsafe without battery backup.

The default is write through (i.e. the card waits for the data to get
written out before acking an fsync).  In write back, the card's driver +
writes the data to the bb cache, then returns on an fsync while the
cache gets written out at leisure.  In the event of a loss of power, the
cache is flushed on restart.

+ +------=_Part_48267_7541056.1155167230719-- + +From pgsql-performance-owner@postgresql.org Wed Aug 9 22:24:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 480E69FB30D + for ; + Wed, 9 Aug 2006 22:24:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 67646-08 for + ; + Thu, 10 Aug 2006 01:24:11 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.186]) + by postgresql.org (Postfix) with ESMTP id 6D0859FB305 + for ; + Wed, 9 Aug 2006 22:24:10 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so397690nfc + for ; + Wed, 09 Aug 2006 18:24:09 -0700 (PDT) +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:references; + b=qq4FChU9Q/dZS4RWfB+EWumzR4lN/gjplSp/ZdinTNSYoX6naH2C3A2rp6PVSe8+TQhExyzcNdCHqQ34a8GGoEv80/umxERjwG4n8vZYKD8aEH5te4PwFB4pkDwO3sASU0q+78cBeK9slTD50PyUaWJRP69DUpsRsv6Er/P/qqE= +Received: by 10.78.124.2 with SMTP id w2mr898676huc; + Wed, 09 Aug 2006 18:24:07 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Wed, 9 Aug 2006 18:24:07 -0700 (PDT) +Message-ID: <721b21dc0608091824j684dc35do887da4e1fa58069@mail.gmail.com> +Date: Wed, 9 Aug 2006 18:24:07 -0700 +From: "Steve Poe" +To: "Scott Marlowe" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Jim C. Nasby" , + "Luke Lonergan" , + "Alex Turner" , pgsql-performance@postgresql.org +In-Reply-To: <1155159448.20252.121.camel@state.g2switchworks.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_49680_27151713.1155173047649" +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <721b21dc0608091411g3a1a6e60q449de0d91020f9dc@mail.gmail.com> + <1155159448.20252.121.camel@state.g2switchworks.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/172 +X-Sequence-Number: 20357 + +------=_Part_49680_27151713.1155173047649 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Scott, + +Do you know how to activate the writeback on the RAID controller from HP? + +Steve + +On 8/9/06, Scott Marlowe wrote: +> +> On Wed, 2006-08-09 at 16:11, Steve Poe wrote: +> > Jim, +> > +> > I'll give it a try. However, I did not see anywhere in the BIOS +> > configuration of the 642 RAID adapter to enable writeback. It may have +> > been mislabled cache accelerator where you can give a percentage to +> > read/write. That aspect did not change the performance like the LSI +> > MegaRAID adapter does. +> +> Nope, that's not the same thing. +> +> Does your raid controller have batter backed cache, or plain or regular +> cache? write back is unsafe without battery backup. +> +> The default is write through (i.e. the card waits for the data to get +> written out before acking an fsync). In write back, the card's driver +> writes the data to the bb cache, then returns on an fsync while the +> cache gets written out at leisure. In the event of a loss of power, the +> cache is flushed on restart. +> + +------=_Part_49680_27151713.1155173047649 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Scott,

Do you know how to activate the writeback on the RAID controller from HP?

Steve

On 8/9/06, Scott Marlowe < +smarlowe@g2switchworks.com> wrote:
On Wed, 2006-08-09 at 16:11, Steve Poe wrote: +
> Jim,
>
> I'll give it a try. However, I did not see anywhere in the BIOS
> configuration of the 642 RAID adapter to enable writeback. It may have
> been mislabled cache accelerator where you can give a percentage to +
> read/write. That aspect did not change the performance like the LSI
> MegaRAID adapter does.

Nope, that's not the same thing.

Does your raid controller have batter backed cache, or plain or regular +
cache?  write back is unsafe without battery backup.

The default is write through (i.e. the card waits for the data to get
written out before acking an fsync).  In write back, the card's driver
writes the data to the bb cache, then returns on an fsync while the +
cache gets written out at leisure.  In the event of a loss of power, the
cache is flushed on restart.

+ +------=_Part_49680_27151713.1155173047649-- + +From pgsql-performance-owner@postgresql.org Thu Aug 10 00:29:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D548A9FB30F + for ; + Thu, 10 Aug 2006 00:29:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 23555-10 for + ; + Thu, 10 Aug 2006 03:29:24 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.185]) + by postgresql.org (Postfix) with ESMTP id 8E4E09FB2D5 + for ; + Thu, 10 Aug 2006 00:29:24 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so432275nfc + for ; + Wed, 09 Aug 2006 20:29:23 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:subject:from:reply-to:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=fdha7PmEHw+tv98zKp6qmDXegYyYldRs3I0bLfy2+sU5mjQxCEx0/9kbsT+GPqyQhd8WoKs3K6SvKMrwpE78aGFTbLrBA50n36TzF8h7FUyz1kbqAlN0pqPsQ8EBU72XDOXiIIeWjcLnm13jS+Caq7j2rfTeXTNtyO7DnjVHS/M= +Received: by 10.78.107.8 with SMTP id f8mr989407huc; + Wed, 09 Aug 2006 20:29:23 -0700 (PDT) +Received: from amd64-gentoo-laptop ( [66.167.206.205]) + by mx.gmail.com with ESMTP id 4sm392213hue.2006.08.09.20.29.21; + Wed, 09 Aug 2006 20:29:22 -0700 (PDT) +Subject: Re: Postgresql Performance on an HP DL385 and +From: Steve Poe +Reply-To: steve.poe@gmail.com +To: "Jim C. Nasby" +Cc: Luke Lonergan , Alex Turner , + pgsql-performance@postgresql.org +In-Reply-To: <20060809210539.GR40481@pervasive.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> +Content-Type: text/plain +Date: Wed, 09 Aug 2006 20:29:13 -0700 +Message-Id: <1155180553.13315.0.camel@amd64-gentoo-laptop> +Mime-Version: 1.0 +X-Mailer: Evolution 2.4.2.1 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/173 +X-Sequence-Number: 20358 + +Jim, + +I tried as you suggested and my performance dropped by 50%. I went from +a 32 TPS to 16. Oh well. + +Steve + +On Wed, 2006-08-09 at 16:05 -0500, Jim C. Nasby wrote: +> On Tue, Aug 08, 2006 at 10:45:07PM -0700, Steve Poe wrote: +> > Luke, +> > +> > I thought so. In my test, I tried to be fair/equal since my Sun box has two +> > 4-disc arrays each on their own channel. So, I just used one of them which +> > should be a little slower than the 6-disc with 192MB cache. +> > +> > Incidently, the two internal SCSI drives, which are on the 6i adapter, +> > generated a TPS of 18. +> +> You should try putting pg_xlog on the 6 drive array with the data. My +> (limited) experience with such a config is that on a good controller +> with writeback caching enabled it won't hurt you, and if the internal +> drives aren't caching writes it'll probably help you a lot. +> +> > I thought this server would impressive from notes I've read in the group. +> > This is why I thought I might be doing something wrong. I stumped which way +> > to take this. There is no obvious fault but something isn't right. +> > +> > Steve +> > +> > On 8/8/06, Luke Lonergan wrote: +> > > +> > >Steve, +> > > +> > >> Sun box with 4-disc array (4GB RAM. 4 167GB 10K SCSI RAID10 +> > >> LSI MegaRAID 128MB). This is after 8 runs. +> > >> +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,us,12,2,5 +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,sy,59,50,53 +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,wa,1,0,0 +> > >> dbserver-dual-opteron-centos,08/08/06,Tuesday,20,id,45,26,38 +> > >> +> > >> Average TPS is 75 +> > >> +> > >> HP box with 8GB RAM. six disc array RAID10 on SmartArray 642 +> > >> with 192MB RAM. After 8 runs, I see: +> > >> +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,us,31,0,3 +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,sy,16,0,1 +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,wa,99,6,50 +> > >> intown-vetstar-amd64,08/09/06,Tuesday,23,id,78,0,42 +> > >> +> > >> Average TPS is 31. +> > > +> > >Note that the I/O wait (wa) on the HP box high, low and average are all +> > >*much* higher than on the Sun box. The average I/O wait was 50% of one +> > >CPU, which is huge. By comparison there was virtually no I/O wait on +> > >the Sun machine. +> > > +> > >This is indicating that your HP machine is indeed I/O bound and +> > >furthermore is tying up a PG process waiting for the disk to return. +> > > +> > >- Luke +> > > +> > > +> + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 01:00:09 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 286239FA5FC + for ; + Thu, 10 Aug 2006 01:00:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 75772-05 for + ; + Thu, 10 Aug 2006 01:00:04 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.188]) + by postgresql.org (Postfix) with ESMTP id 1B93A9FA13E + for ; + Thu, 10 Aug 2006 01:00:02 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so440560nfc + for ; + Wed, 09 Aug 2006 21:00:00 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; + b=WHIRuaIe4c094TT4ijdV2nvKT2WeOAOp5GGImUEIx48AHgu5JhZ2MHTOCAbxcT/gXFTIOVMFgJxiabeeNNiVqD5SZmh9Ib+Nj0m6+WX5j2vORAn7eBFNTpXIPd5mJHibJNA9J7ICuLuxtUh+lN0E8xXAMdgnMl24Q1iJnrpXlXw= +Received: by 10.78.203.15 with SMTP id a15mr989203hug; + Wed, 09 Aug 2006 21:00:00 -0700 (PDT) +Received: by 10.78.158.10 with HTTP; Wed, 9 Aug 2006 21:00:00 -0700 (PDT) +Message-ID: +Date: Wed, 9 Aug 2006 22:00:00 -0600 +From: "Carl Youngblood" +To: pgsql-performance@postgresql.org +Subject: Beginner optimization questions, + esp. regarding Tsearch2 configuration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +X-Google-Sender-Auth: 6d38fea0414e292c +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/174 +X-Sequence-Number: 20359 + +I'm trying to optimize a resume search engine that is using Tsearch2 +indexes. It's running on a dual-opteron 165 system with 4GB of ram +and a raid1 3Gb/sec SATA array. Each text entry is about 2-3K of +text, and there are about 23,000 rows in the search table, with a goal +of reaching about 100,000 rows eventually. + +I'm running Ubuntu 6.06 amd64 server edition. The raid array is a +software-based linux array with LVM on top of it and the file system +for the database mount point is XFS. The only optimization I've done +so far is to put the following in /etc/sysctl.conf: + +kernel.shmall = 2097152 +kernel.shmmax = 2147483648 +kernel.shmmni = 4096 +kernel.sem = 250 32000 100 128 +fs.file-max = 65536 + +And in postgresql.conf I set the following parameters: + +shared_buffers = 131072 +work_mem = 65536 +max_stack_depth = 4096 +max_fsm_pages = 40000 +max_fsm_relations = 2000 + +These probably aren't ideal but I was hoping they would perform a +little better than the defaults. I got the following results from a +pgbench script I picked up off the web: + +CHECKPOINT +===== sync ====== +10 concurrent users... +transaction type: TPC-B (sort of) +scaling factor: 10 +number of clients: 10 +number of transactions per client: 100 +number of transactions actually processed: 1000/1000 +tps = 632.146016 (including connections establishing) +tps = 710.474526 (excluding connections establishing) + +Once again I don't know if these results are good or not for my hardware. + +I have a couple of questions: + +- Does anyone have some good advice for optimizing postgres for +tsearch2 queries? +- I noticed that there are six different postmaster daemons running. +Only one of them is taking up a lot of RAM (1076m virtual and 584m +resident). The second one is using 181m resident while the others are +less than 20m each. Is it normal to have multiple postmaster +processes? Even the biggest process doesn't seem to be using near as +much RAM as I have on this machine. Is that bad? What percentage of +my physical memory should I expect postgres to use for itself? How +can I encourage it to cache more query results in memory? + +Thanks in advance for your time. + +Carl Youngblood + +From pgsql-performance-owner@postgresql.org Thu Aug 10 04:30:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AE3C69FB2BA + for ; + Thu, 10 Aug 2006 04:30:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 54727-01 for + ; + Thu, 10 Aug 2006 04:30:39 -0300 (ADT) +X-Greylist: delayed 17:24:16.218149 by SQLgrey- +Received: from mx.mall.cz (unknown [82.100.0.98]) + by postgresql.org (Postfix) with ESMTP id D11529FB2B4 + for ; + Thu, 10 Aug 2006 04:30:39 -0300 (ADT) +Received: from localhost (asterix [127.0.0.1]) + by mx.mall.cz (Postfix) with ESMTP id AB5B613F63B + for ; + Thu, 10 Aug 2006 09:30:37 +0200 (CEST) +Received: from mx.mall.cz ([127.0.0.1]) + by localhost (asterix [127.0.0.1]) (amavisd-new, port 10025) with ESMTP + id 13111-07 for ; + Thu, 10 Aug 2006 09:30:35 +0200 (CEST) +Message-ID: <44DAE09B.20009@mall.cz> +Date: Thu, 10 Aug 2006 09:30:35 +0200 +From: Michal Taborsky - Internet Mall +Organization: Internet Mall, a.s. +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: 3-table query optimization +References: <44D9EBEB.9010704@mall.cz> <20367.1155136139@sss.pgh.pa.us> +In-Reply-To: <20367.1155136139@sss.pgh.pa.us> +Content-Type: text/plain; charset=ISO-8859-2; format=flowed +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: by amavisd-new at mall.cz +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.827 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/175 +X-Sequence-Number: 20360 + +Tom Lane napsal(a): +> Michal Taborsky - Internet Mall writes: +>> SELECT product.product_id +>> FROM action +>> JOIN product ON (product.product_id=action.product_id) +>> WHERE action.shop_group_id=1 +>> AND EXISTS (SELECT 1 +>> FROM catalog.product_program +>> WHERE product_id=product.product_id +>> AND product_program.program_id =1104322 +>> ) +> +> Try converting the EXISTS subquery to an IN. + +The performance is roughly the same. For some groups it's better, for +some groups, the bigger ones, it's a bit worse. I forgot to mention, +that the server is running 8.0.2. Upgrading would be a bit painful, as +it is a 24/7 production system, but if it would help significantly, we'd +give it a go. + +-- +Michal T�borsk� + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 05:05:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5930D9FB2D5 + for ; + Thu, 10 Aug 2006 05:05:42 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 31150-10 for + ; + Thu, 10 Aug 2006 08:05:37 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) + by postgresql.org (Postfix) with ESMTP id 603A39FB2BE + for ; + Thu, 10 Aug 2006 05:05:36 -0300 (ADT) +Received: from [129.215.218.230] (skibo.inf.ed.ac.uk [129.215.218.230]) + by nutty.inf.ed.ac.uk (8.13.6/8.13.6) with ESMTP id k7A85ZZa019279 + for ; Thu, 10 Aug 2006 09:05:35 +0100 +Message-ID: <44DAE8CF.1030107@inf.ed.ac.uk> +Date: Thu, 10 Aug 2006 09:05:35 +0100 +From: Sue Fitt +User-Agent: Thunderbird 1.5.0.4 (X11/20060620) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: setting up foreign keys +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.313 tagged_above=0 required=5 tests=SARE_MILLIONSOF, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/176 +X-Sequence-Number: 20361 + +Hi all, + +This is my first post to the performance list, I hope someone can help me. + +I'm setting up a table with 2 columns, both of which reference a column +in another table: + +CREATE TABLE headwords_core_lexemes ( +core_id int REFERENCES headwords_core(core_id), +lexeme_id int REFERENCES headwords_core(core_id), +); + +Trouble is, it's taken 18 hours and counting! The table headwords_core +only has about 13,000 lines, and core_id is the primary key on that +table. However, I assume it must be those 13,000 lines that are the +problem, since if I try it referencing a similar table with 360 lines +the new table is created almost instantly. + +I found a post on a similar subject from quite a while ago, but no +answer, and that was for millions of rows anyway. I only have 13,000. +Surely it should be faster than this? Is there a way to speed it up? + +Sue Fitt + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 05:15:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6D9579FB2D5 + for ; + Thu, 10 Aug 2006 05:15:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 50472-08 for + ; + Thu, 10 Aug 2006 05:15:05 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.183]) + by postgresql.org (Postfix) with ESMTP id 52D379FB2BE + for ; + Thu, 10 Aug 2006 05:15:04 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id n25so663642pyg + for ; + Thu, 10 Aug 2006 01:15:03 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=nULVFIwEWe5uBVcp/daLkxkao4JQu7KrAPviciyUlDW3oXdpkQUt3g5BAq/1WdP+kIigG3h8jcITOFkH+S5SALW6zyFEVkr/jaCWtNYW0GmcGzSTk3KUtLpU3qf3t6aF3wVSp6V1nS0CF8JV5O2dlUGUF1+k2C71fKh/QhXTPbE= +Received: by 10.35.100.6 with SMTP id c6mr3383642pym; + Thu, 10 Aug 2006 01:15:03 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id 40sm414923nzf.2006.08.10.01.15.01; + Thu, 10 Aug 2006 01:15:03 -0700 (PDT) +Message-ID: <44DAEB04.9050306@gmail.com> +Date: Thu, 10 Aug 2006 18:15:00 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Sue Fitt +CC: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <44DAE8CF.1030107@inf.ed.ac.uk> +In-Reply-To: <44DAE8CF.1030107@inf.ed.ac.uk> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.187 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/177 +X-Sequence-Number: 20362 + +Sue Fitt wrote: +> Hi all, +> +> This is my first post to the performance list, I hope someone can help me. +> +> I'm setting up a table with 2 columns, both of which reference a column +> in another table: +> +> CREATE TABLE headwords_core_lexemes ( +> core_id int REFERENCES headwords_core(core_id), +> lexeme_id int REFERENCES headwords_core(core_id), +> ); + +One problem here is both of these are referencing the same column ;) I'm +sure that's a typo. + +It sounds like you have something blocking or locking the other table. +Check pg_locks (I think it is), 13,000 rows shouldn't take *that* long. + + +Make sure there is an index on headwords_core(core_id) and whatever the +other column should be. + +Foreign keys have to check the other table so without those indexes, it +will be slow(er). + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Thu Aug 10 06:05:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1EC039FB2B2 + for ; + Thu, 10 Aug 2006 06:05:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 57868-09 for + ; + Thu, 10 Aug 2006 06:04:57 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) + by postgresql.org (Postfix) with ESMTP id AC19C9FB2AA + for ; + Thu, 10 Aug 2006 06:04:56 -0300 (ADT) +Received: from [129.215.218.230] (skibo.inf.ed.ac.uk [129.215.218.230]) + by nutty.inf.ed.ac.uk (8.13.6/8.13.6) with ESMTP id k7A94trr029883 + for ; Thu, 10 Aug 2006 10:04:55 +0100 +Message-ID: <44DAF6B7.1090800@inf.ed.ac.uk> +Date: Thu, 10 Aug 2006 10:04:55 +0100 +From: Sue Fitt +User-Agent: Thunderbird 1.5.0.4 (X11/20060620) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <44DAE8CF.1030107@inf.ed.ac.uk> <44DAEB04.9050306@gmail.com> +In-Reply-To: <44DAEB04.9050306@gmail.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.282 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/178 +X-Sequence-Number: 20363 + +Thanks Chris and Chris, you've solved it. + +I had a gui open that connects to the database. It was doing nothing +(and not preventing me adding to or altering headwords_core via psql), +but having closed it the table is instantly created. Weird. + +BTW, referencing the same column twice is deliberate, it's a +cross-reference. + +Sue + +Chris Mair wrote: + >> This is my first post to the performance list, I hope someone can +help me. + >> + >> I'm setting up a table with 2 columns, both of which reference a +column in another table: + >> + >> CREATE TABLE headwords_core_lexemes ( + >> core_id int REFERENCES headwords_core(core_id), + >> lexeme_id int REFERENCES headwords_core(core_id), + >> ); + >> + >> Trouble is, it's taken 18 hours and counting! The table +headwords_core only has about 13,000 lines, and core_id is the primary +key on that table. However, I assume it must be those 13,000 lines that +are the problem, since if I try it referencing a similar table with 360 +lines the new table is created almost instantly. + >> + > + > Hi, + > + > the 13000 rows in headwords_core don't matter at all for what this + > statement concerns. I bet you have another idle transaction that keeps + > headwords_core locked, for example because you did an + > alter table headwords_core there... + > + > Bye, + > Chris. + > + > + +From pgsql-performance-owner@postgresql.org Thu Aug 10 06:13:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D912A9FB2B2 + for ; + Thu, 10 Aug 2006 06:13:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 59272-09 for + ; + Thu, 10 Aug 2006 06:13:35 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.179]) + by postgresql.org (Postfix) with ESMTP id 7A3949FB2AA + for ; + Thu, 10 Aug 2006 06:13:35 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so822263pyd + for ; + Thu, 10 Aug 2006 02:13:34 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=ZMs2zoQUu/NpyYWpVR0BDf7QsQfaX6d3KlNPM2RZKe+ZV6QqwOicA8Lefv5TkFGnbjqQeGwAzrF1TgHzjJNVJfbkVIjwa7Ot7KbsG/MBB3xHrsECMkUsxMUI8kGKmejkAQrp52VVG8+xHs2KJEDX09JZaBKxdYlQq/oPwyx/m6k= +Received: by 10.35.99.5 with SMTP id b5mr3480550pym; + Thu, 10 Aug 2006 02:13:33 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id 17sm1245003nzo.2006.08.10.02.13.31; + Thu, 10 Aug 2006 02:13:33 -0700 (PDT) +Message-ID: <44DAF8B9.2080000@gmail.com> +Date: Thu, 10 Aug 2006 19:13:29 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Sue Fitt +CC: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <44DAE8CF.1030107@inf.ed.ac.uk> <44DAEB04.9050306@gmail.com> + <44DAF6B7.1090800@inf.ed.ac.uk> +In-Reply-To: <44DAF6B7.1090800@inf.ed.ac.uk> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.189 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/179 +X-Sequence-Number: 20364 + +Sue Fitt wrote: +> Thanks Chris and Chris, you've solved it. +> +> I had a gui open that connects to the database. It was doing nothing +> (and not preventing me adding to or altering headwords_core via psql), +> but having closed it the table is instantly created. Weird. +> +> BTW, referencing the same column twice is deliberate, it's a +> cross-reference. + +The same column and the same table? + +Same column different table I could understand but not the same column & +table ;) + +I'm sure there's a reason for it though :) + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Thu Aug 10 06:21:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id AC1279FB2B2 + for ; + Thu, 10 Aug 2006 06:21:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 57983-04 for + ; + Thu, 10 Aug 2006 09:20:57 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) + by postgresql.org (Postfix) with ESMTP id C34069FB2D5 + for ; + Thu, 10 Aug 2006 06:20:55 -0300 (ADT) +Received: from [129.215.218.230] (skibo.inf.ed.ac.uk [129.215.218.230]) + by nutty.inf.ed.ac.uk (8.13.6/8.13.6) with ESMTP id k7A9KjIb000405; + Thu, 10 Aug 2006 10:20:45 +0100 +Message-ID: <44DAFA6D.4070606@inf.ed.ac.uk> +Date: Thu, 10 Aug 2006 10:20:45 +0100 +From: Sue Fitt +User-Agent: Thunderbird 1.5.0.4 (X11/20060620) +MIME-Version: 1.0 +To: Chris +CC: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <44DAE8CF.1030107@inf.ed.ac.uk> <44DAEB04.9050306@gmail.com> + <44DAF6B7.1090800@inf.ed.ac.uk> <44DAF8B9.2080000@gmail.com> +In-Reply-To: <44DAF8B9.2080000@gmail.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/180 +X-Sequence-Number: 20365 + +Well they don't necessarily have the same value! + +It's a dictionary with cross-referenced words, e.g. 'bring' and +'brought' are both headwords in the dictionary, but 'brought' is +cross-referenced to 'bring'. So, the table stores the information (using +integer id's rather than words) that + bring: bring + brought: see bring + sing: sing + sang: see sing +etc. + +Sue + +Chris wrote: +> Sue Fitt wrote: +>> Thanks Chris and Chris, you've solved it. +>> +>> I had a gui open that connects to the database. It was doing nothing +>> (and not preventing me adding to or altering headwords_core via +>> psql), but having closed it the table is instantly created. Weird. +>> +>> BTW, referencing the same column twice is deliberate, it's a +>> cross-reference. +> +> The same column and the same table? +> +> Same column different table I could understand but not the same column +> & table ;) +> +> I'm sure there's a reason for it though :) +> + +From pgsql-performance-owner@postgresql.org Thu Aug 10 06:25:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 622AF9FB31B + for ; + Thu, 10 Aug 2006 06:25:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 62737-02 for + ; + Thu, 10 Aug 2006 09:25:21 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) + by postgresql.org (Postfix) with ESMTP id 75C699FB2FF + for ; + Thu, 10 Aug 2006 06:25:19 -0300 (ADT) +Received: from mainbox.archonet.com + (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) + by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 830A873A0B; + Thu, 10 Aug 2006 10:23:56 +0100 (BST) +Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) + by mainbox.archonet.com (Postfix) with ESMTP id 290FA15EA6; + Thu, 10 Aug 2006 10:23:56 +0100 (BST) +Message-ID: <44DAFB2B.4070307@archonet.com> +Date: Thu, 10 Aug 2006 10:23:55 +0100 +From: Richard Huxton +User-Agent: Thunderbird 1.5.0.5 (X11/20060719) +MIME-Version: 1.0 +To: Carl Youngblood +Cc: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +References: +In-Reply-To: +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/181 +X-Sequence-Number: 20366 + +Carl Youngblood wrote: +> - I noticed that there are six different postmaster daemons running. +> Only one of them is taking up a lot of RAM (1076m virtual and 584m +> resident). The second one is using 181m resident while the others are +> less than 20m each. Is it normal to have multiple postmaster +> processes? + +You should have one master backend process and one per connection. PG is +a classic multi-process designed server. + + > Even the biggest process doesn't seem to be using near as +> much RAM as I have on this machine. Is that bad? What percentage of +> my physical memory should I expect postgres to use for itself? How +> can I encourage it to cache more query results in memory? + +OK - one of the key things with PostgreSQL is that it relies on the O.S. +to cache its disk files. So, allocating too much memory to PG can be +counterproductive. + + From your figures, you're allocating about 64MB to work_mem, which is +per sort. So, a complex query could use several times that amount. If +you don't have many concurrent queries that might be what you want. + +Also, you've allocated 1GB to your shared_buffers which is more than I'd +use as a starting point. + +You've only mentioned one main table with 100,000 rows, so presumably +you're going to cache the entire DB in RAM. So, you'll want to increase +effective_cache_size and reduce random_page_cost. + +-- + Richard Huxton + Archonet Ltd + +From pgsql-performance-owner@postgresql.org Thu Aug 10 15:52:43 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8742F9FB1DE + for ; + Thu, 10 Aug 2006 07:00:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 66194-05 for + ; + Thu, 10 Aug 2006 10:00:51 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id 38E019FA148 + for ; + Thu, 10 Aug 2006 07:00:51 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id CB52830E16; Thu, 10 Aug 2006 12:00:49 +0200 (MET DST) +From: Phil Cairns +X-Newsgroups: pgsql.performance +Subject: Slow access to PostgreSQL server +Date: Thu, 10 Aug 2006 20:00:38 +1000 +Organization: Posted via Supernews, http://www.supernews.com +Message-ID: <12dm0u95lncnte0@corp.supernews.com> +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Complaints-To: abuse@supernews.com +Lines: 34 +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/195 +X-Sequence-Number: 20380 + +Hi all, + +I have an application that uses PostgreSQL to store its data. The +application and an instance of the database have been installed in three +different locations, and none of these three locations have anything to +do with any of the others. I'm observing a problem in that large +transfers to some machines on the network (specifically while running +pg_dump) are dead slow. In fact, the information is going from the +server to the client machine at dialup speeds over a 100 Mb LAN to some +machines, and full speed to others. + +This not a universal problem. Obviously, I'm not experiencing it at my +development location, or I would have found and fixed it by now. One of +the production installations had no problems. The second of the +production environments experienced the problem on one out of 4 laptops +(all the desktop machines were OK) until their technical guy uninstalled +AVG (anti-virus). The third location has 4 laptops that are all slow in +transferring PostgreSQL data, while the desktop machines are OK. There +are no problems with copying files across the network. At the third +location, they have the same software installed on the laptops and +desktops, including the Vet security suite. Suspecting that something +was screwing up the transfers by fiddling with packets, we suspended +Vet, but that didn't help. We're going to try changing NICs and checking +to see what happens when Pg runs on port 80. + +Has anyone experienced this sort of thing before? We're running with +8.0.4. My application uses libpg, while another application is using +OLEDB. Both the native and OLEDB layers exhibit the delay on the "slow" +machines, and have no problems on the "fast" machines. Note that the +laptops are in no way inferior to the desktop machines in terms of CPU, +RAM, etc. + +TIA, + Phil (yak from the build farm). + +From pgsql-performance-owner@postgresql.org Thu Aug 10 08:07:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E079D9FB2DA + for ; + Thu, 10 Aug 2006 08:07:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 77374-08 for + ; + Thu, 10 Aug 2006 11:06:57 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id B750B9FB2AB + for ; + Thu, 10 Aug 2006 08:06:57 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D2020.dip0.t-ipconnect.de + [84.157.32.32]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 499C2656BE; + Thu, 10 Aug 2006 13:08:52 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id EF3AE18817942; + Thu, 10 Aug 2006 13:07:08 +0200 (CEST) +Message-ID: <44DB135C.8080705@logix-tt.com> +Date: Thu, 10 Aug 2006 13:07:08 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Cc: Carl Youngblood +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +References: + <44DAFB2B.4070307@archonet.com> +In-Reply-To: <44DAFB2B.4070307@archonet.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/182 +X-Sequence-Number: 20367 + +Hi, Richard and Carl, + +Richard Huxton wrote: +> Carl Youngblood wrote: +>> - I noticed that there are six different postmaster daemons running. +>> Only one of them is taking up a lot of RAM (1076m virtual and 584m +>> resident). The second one is using 181m resident while the others are +>> less than 20m each. Is it normal to have multiple postmaster +>> processes? +> +> You should have one master backend process and one per connection. PG is +> a classic multi-process designed server. + +There may be some additional background processes, such as the +background writer, stats collector or autovacuum, depending on your +version and configuration. + +HTH, +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Thu Aug 10 08:10:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 945C89FB2DB + for ; + Thu, 10 Aug 2006 08:10:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 70499-02 for + ; + Thu, 10 Aug 2006 08:09:56 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) + by postgresql.org (Postfix) with ESMTP id 0FCC89FB2AB + for ; + Thu, 10 Aug 2006 08:09:56 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J3S006OC4C5ZXI0@vms042.mailsrvcs.net> for + pgsql-performance@postgresql.org; Thu, 10 Aug 2006 06:09:41 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id A561F6FB9B for + ; + Thu, 10 Aug 2006 07:09:39 -0400 (EDT) +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 YYpqV1Ku8asS for ; Thu, + 10 Aug 2006 07:09:38 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 884446FBB4; Thu, 10 Aug 2006 07:09:38 -0400 (EDT) +Date: Thu, 10 Aug 2006 07:09:38 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <1155180553.13315.0.camel@amd64-gentoo-laptop> +To: pgsql-performance@postgresql.org +Mail-followup-to: pgsql-performance@postgresql.org +Message-id: <20060810110935.GF2900@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: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.071 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/183 +X-Sequence-Number: 20368 + +On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +>I tried as you suggested and my performance dropped by 50%. I went from +>a 32 TPS to 16. Oh well. + +If you put data & xlog on the same array, put them on seperate +partitions, probably formatted differently (ext2 on xlog). + +Mike Stone + +From pgsql-performance-owner@postgresql.org Thu Aug 10 10:16:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 61FCA9FB2DA + for ; + Thu, 10 Aug 2006 10:16:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 53252-08 for + ; + Thu, 10 Aug 2006 13:16:26 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from insiderscore.com (mail01.insiderscore.com [69.84.139.233]) + by postgresql.org (Postfix) with ESMTP id 898F39FB269 + for ; + Thu, 10 Aug 2006 10:16:26 -0300 (ADT) +Received: from [10.10.10.105] (pool-72-70-43-141.bstnma.fios.verizon.net + [72.70.43.141]) + by insiderscore.com (Postfix) with ESMTP id 984DB11C4271; + Thu, 10 Aug 2006 09:16:24 -0400 (EDT) +In-Reply-To: <20060809213543.GV40481@pervasive.com> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <9EE66C7F-0B04-4472-9EBD-CD567AC9EA1D@sitening.com> + <44D90FFE.7010807@commandprompt.com> + <82C06632-148B-4489-90EB-BBB8A6BD1159@sitening.com> + <1155136527.20252.90.camel@state.g2switchworks.com> + <20060809213543.GV40481@pervasive.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <03794290-BBB0-4C13-AB12-6BC0EB660DB4@torgo.978.org> +Cc: Pgsql performance +Content-Transfer-Encoding: 7bit +From: Jeff Trout +Subject: Re: most bang for buck with ~ $20,000 +Date: Thu, 10 Aug 2006 09:16:23 -0400 +To: Jim C. Nasby +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/184 +X-Sequence-Number: 20369 + + +On Aug 9, 2006, at 5:35 PM, Jim C. Nasby wrote: + +> Note that some controllers (such as 3ware) need to periodically +> test the +> life of the BBU, and they disable write caching when they do so, which +> would tank performance. + +Yep. I did the battery capacity test before I went live with our +9550sx controller. +The only downside I see by not doing it is its estimated battery +lifetime number may be inaccurate, and once a week you get an alarm +message about the capacity test being overdue. + +It does seem like a big design flaw needing to do it, but if you +think about it, you don't want to have data in the cache while seeing +how long it takes for the battery to drain :) + +-- +Jeff Trout +http://www.dellsmartexitin.com/ +http://www.stuarthamm.net/ + + + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 10:33:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3B74E9FB269 + for ; + Thu, 10 Aug 2006 10:33:21 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 17178-09 for + ; + Thu, 10 Aug 2006 10:33:12 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.181]) + by postgresql.org (Postfix) with ESMTP id 09BEA9FA502 + for ; + Thu, 10 Aug 2006 10:33:12 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id n25so768793pyg + for ; + Thu, 10 Aug 2006 06:33:11 -0700 (PDT) +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=Cp0GoVddNENltSsGqND8Zq0jMeAryVB5BFin7/MzcPwymkoOCQnAGHbeobScGmHB8LSXGkjqIMt5Tb4P2lXyMqcbJAdLB0lHbldcMUErq8lG3aahn1u1b5H0du+sqdMJdTup6hN/LWUXKGcg1pNxx3a4nEnrAAK2gBps5nUieAE= +Received: by 10.65.95.20 with SMTP id x20mr2310799qbl; + Thu, 10 Aug 2006 06:33:10 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Thu, 10 Aug 2006 06:33:07 -0700 (PDT) +Message-ID: +Date: Thu, 10 Aug 2006 09:33:07 -0400 +From: "Merlin Moncure" +To: Chris +Subject: Re: setting up foreign keys +Cc: "Sue Fitt" , pgsql-performance@postgresql.org +In-Reply-To: <44DAF8B9.2080000@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44DAE8CF.1030107@inf.ed.ac.uk> <44DAEB04.9050306@gmail.com> + <44DAF6B7.1090800@inf.ed.ac.uk> <44DAF8B9.2080000@gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.395 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/185 +X-Sequence-Number: 20370 + +On 8/10/06, Chris wrote: +> Sue Fitt wrote: +> > Thanks Chris and Chris, you've solved it. +> > +> > I had a gui open that connects to the database. It was doing nothing +> > (and not preventing me adding to or altering headwords_core via psql), +> > but having closed it the table is instantly created. Weird. +> > +> > BTW, referencing the same column twice is deliberate, it's a +> > cross-reference. +> +> The same column and the same table? +> +> Same column different table I could understand but not the same column & +> table ;) + +create table color(color text); + +create table person(eye_color text references color(color), hair_color +text references color(color)); + +;) +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 10 12:16:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C970A9FB2EF + for ; + Thu, 10 Aug 2006 12:16:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 83837-10 for + ; + Thu, 10 Aug 2006 15:16:09 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw04.mi8.com [63.240.6.44]) + by postgresql.org (Postfix) with ESMTP id 9CEB89FB2DA + for ; + Thu, 10 Aug 2006 12:16:09 -0300 (ADT) +Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D4)); Thu, 10 Aug 2006 11:16:02 -0400 +X-Server-Uuid: C8FB4D43-1108-484A-A898-3CBCC7906230 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 10 Aug + 2006 11:15:41 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Thu, 10 Aug + 2006 15:15:40 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Thu, 10 Aug 2006 08:15:38 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: "Michael Stone" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca8j9XNFG1FVSiDEduJGAAWy4o9DA== +In-Reply-To: <20060810110935.GF2900@mathom.us> +MIME-Version: 1.0 +X-OriginalArrivalTime: 10 Aug 2006 15:15:41.0549 (UTC) + FILETIME=[D7EB11D0:01C6BC8F] +X-WSS-ID: 68C592384M41841017-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.635 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/186 +X-Sequence-Number: 20371 + +Mike, + +On 8/10/06 4:09 AM, "Michael Stone" wrote: + +> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +>> I tried as you suggested and my performance dropped by 50%. I went from +>> a 32 TPS to 16. Oh well. +> +> If you put data & xlog on the same array, put them on seperate +> partitions, probably formatted differently (ext2 on xlog). + +If he's doing the same thing on both systems (Sun and HP) and the HP +performance is dramatically worse despite using more disks and having faster +CPUs and more RAM, ISTM the problem isn't the configuration. + +Add to this the fact that the Sun machine is CPU bound while the HP is I/O +wait bound and I think the problem is the disk hardware or the driver +therein. + +- Luke + + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 12:35:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E46A89FB2DA + for ; + Thu, 10 Aug 2006 12:35:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 91311-06 for + ; + Thu, 10 Aug 2006 15:35:11 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 4C7D99FB2EF + for ; + Thu, 10 Aug 2006 12:35:11 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Thu, 10 Aug 2006 15:35:10 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 10 Aug 2006 10:35:10 -0500 +Subject: Re: Postgresql Performance on an HP DL385 and +From: Scott Marlowe +To: Luke Lonergan +Cc: Michael Stone , + pgsql-performance@postgresql.org +In-Reply-To: +References: +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1155224109.20252.144.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Thu, 10 Aug 2006 10:35:10 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/187 +X-Sequence-Number: 20372 + +On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote: +> Mike, +> +> On 8/10/06 4:09 AM, "Michael Stone" wrote: +> +> > On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +> >> I tried as you suggested and my performance dropped by 50%. I went from +> >> a 32 TPS to 16. Oh well. +> > +> > If you put data & xlog on the same array, put them on seperate +> > partitions, probably formatted differently (ext2 on xlog). +> +> If he's doing the same thing on both systems (Sun and HP) and the HP +> performance is dramatically worse despite using more disks and having faster +> CPUs and more RAM, ISTM the problem isn't the configuration. +> +> Add to this the fact that the Sun machine is CPU bound while the HP is I/O +> wait bound and I think the problem is the disk hardware or the driver +> therein. + +I agree. The problem here looks to be the RAID controller. + +Steve, got access to a different RAID controller to test with? + +From pgsql-performance-owner@postgresql.org Thu Aug 10 12:47:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3C8DB9FB2EF + for ; + Thu, 10 Aug 2006 12:47:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 93451-06 for + ; + Thu, 10 Aug 2006 15:47:18 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.189]) + by postgresql.org (Postfix) with ESMTP id 7C4909FB25E + for ; + Thu, 10 Aug 2006 12:47:18 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so651940nfc + for ; + Thu, 10 Aug 2006 08:47:06 -0700 (PDT) +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:references; + b=lcxs9Gybprgx66NQk99JAeFGEuXlKMsp9mSNoti5S+SwxDv8b7Hq1xqSUUNWHJvowtW+apwVIrJXK8BNhmDlpwTiRXijIN1GhiMIOH7keCAuNNN+D3WKXgMAO6/l5WRDfxC7Ugr8t9davG3fX0a2zMgKeWdW4rTQQfa+2xFwR88= +Received: by 10.78.157.8 with SMTP id f8mr1431274hue; + Thu, 10 Aug 2006 08:47:06 -0700 (PDT) +Received: by 10.78.33.3 with HTTP; Thu, 10 Aug 2006 08:47:05 -0700 (PDT) +Message-ID: <721b21dc0608100847i166be1e6x4903357e6d35f82f@mail.gmail.com> +Date: Thu, 10 Aug 2006 08:47:05 -0700 +From: "Steve Poe" +To: "Scott Marlowe" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Luke Lonergan" , + "Michael Stone" , + pgsql-performance@postgresql.org +In-Reply-To: <1155224109.20252.144.camel@state.g2switchworks.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_62928_17604620.1155224825858" +References: + <1155224109.20252.144.camel@state.g2switchworks.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/188 +X-Sequence-Number: 20373 + +------=_Part_62928_17604620.1155224825858 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Scott, + +I *could* rip out the LSI MegaRAID 2X from my Sun box. This belongs to me +for testing. but I don't know if it will fit in the DL385. Do they have +full-heigth/length slots? I've not worked on this type of box before. I was +thinking this is the next step. In the meantime, I've discovered their no +email support for them so I am hoping find a support contact through the +sales rep that this box was purchased from. + +Steve + +On 8/10/06, Scott Marlowe wrote: +> +> On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote: +> > Mike, +> > +> > On 8/10/06 4:09 AM, "Michael Stone" wrote: +> > +> > > On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +> > >> I tried as you suggested and my performance dropped by 50%. I went +> from +> > >> a 32 TPS to 16. Oh well. +> > > +> > > If you put data & xlog on the same array, put them on seperate +> > > partitions, probably formatted differently (ext2 on xlog). +> > +> > If he's doing the same thing on both systems (Sun and HP) and the HP +> > performance is dramatically worse despite using more disks and having +> faster +> > CPUs and more RAM, ISTM the problem isn't the configuration. +> > +> > Add to this the fact that the Sun machine is CPU bound while the HP is +> I/O +> > wait bound and I think the problem is the disk hardware or the driver +> > therein. +> +> I agree. The problem here looks to be the RAID controller. +> +> Steve, got access to a different RAID controller to test with? +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that your +> message can get through to the mailing list cleanly +> + +------=_Part_62928_17604620.1155224825858 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Scott,

I *could* rip out the LSI MegaRAID 2X from my Sun box. This belongs to me for testing. but I don't know if it will fit in the DL385. Do they have full-heigth/length slots? I've not worked on this type of box before. I was thinking this is the next step. In the meantime, I've discovered their no email support for them so I am hoping find a support contact through the sales rep that this box was purchased from. +

Steve

On 8/10/06, Scott Marlowe <smarlowe@g2switchworks.com> wrote:
+On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote:
> Mike,
>
> On 8/10/06 4:09 AM, "Michael Stone" <mstone+postgres@mathom.us> wrote:
> +
> > On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote:
> >> I tried as you suggested and my performance dropped by 50%. I went from
> >> a 32 TPS to 16. Oh well.
> >
> > If you put data & xlog on the same array, put them on seperate +
> > partitions, probably formatted differently (ext2 on xlog).
>
> If he's doing the same thing on both systems (Sun and HP) and the HP
> performance is dramatically worse despite using more disks and having faster +
> CPUs and more RAM, ISTM the problem isn't the configuration.
>
> Add to this the fact that the Sun machine is CPU bound while the HP is I/O
> wait bound and I think the problem is the disk hardware or the driver +
> therein.

I agree.  The problem here looks to be the RAID controller.

Steve, got access to a different RAID controller to test with?

---------------------------(end of broadcast)--------------------------- +
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly +

+ +------=_Part_62928_17604620.1155224825858-- + +From pgsql-performance-owner@postgresql.org Thu Aug 10 12:50:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id CDFE39FB2F8 + for ; + Thu, 10 Aug 2006 12:50:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 95507-04 for + ; + Thu, 10 Aug 2006 15:50:41 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 29CD99FB25E + for ; + Thu, 10 Aug 2006 12:50:41 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-202-139.bk11-dsl.surnet.cl + [201.221.202.139]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7AFoaPk004645; + Thu, 10 Aug 2006 08:50:37 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 9EB4DC45036; Thu, 10 Aug 2006 11:50:17 -0400 (CLT) +Date: Thu, 10 Aug 2006 11:50:17 -0400 +From: Alvaro Herrera +To: Michal Taborsky - Internet Mall +Cc: pgsql-performance@postgresql.org +Subject: Re: 3-table query optimization +Message-ID: <20060810155017.GI23053@alvh.no-ip.org> +Mail-Followup-To: Michal Taborsky - Internet Mall , + pgsql-performance@postgresql.org +References: <44D9EBEB.9010704@mall.cz> <20367.1155136139@sss.pgh.pa.us> + <44DAE09B.20009@mall.cz> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44DAE09B.20009@mall.cz> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Thu, 10 Aug 2006 08:50:38 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.856 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, RCVD_IN_NJABL_PROXY +X-Spam-Level: +X-Archive-Number: 200608/189 +X-Sequence-Number: 20374 + +Michal Taborsky - Internet Mall wrote: +> Tom Lane napsal(a): +> >Michal Taborsky - Internet Mall writes: +> >>SELECT product.product_id +> >> FROM action +> >> JOIN product ON (product.product_id=action.product_id) +> >> WHERE action.shop_group_id=1 +> >> AND EXISTS (SELECT 1 +> >> FROM catalog.product_program +> >> WHERE product_id=product.product_id +> >> AND product_program.program_id =1104322 +> >> ) +> > +> >Try converting the EXISTS subquery to an IN. +> +> The performance is roughly the same. + +That's strange -- IN is usually much more amenable to better plans than +EXISTS. Please post an EXPLAIN ANALYZE of the queries to see what's +going on. It may be that the query is bound to be "slow" for some +cases (depending on the program_id I guess?) + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Thu Aug 10 13:54:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 92A279FB1E2 + for ; + Thu, 10 Aug 2006 13:54:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 33260-06 for + ; + Thu, 10 Aug 2006 13:54:17 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from ausimss.pervasive.com (ausimss.pervasive.com [66.45.103.246]) + by postgresql.org (Postfix) with ESMTP id 96BC29F9FAC + for ; + Thu, 10 Aug 2006 13:54:15 -0300 (ADT) +Received: from ausbayes2.aus.pervasive.com ([172.16.8.6]) by + ausimss.pervasive.com with InterScan Messaging Security Suite; + Thu, 10 Aug 2006 11:54:10 -0500 +Received: from AUSOWA.aus.pervasive.com ([172.16.4.8]) by + ausbayes2.aus.pervasive.com with Microsoft SMTPSVC(5.0.2195.6713); + Thu, 10 Aug 2006 11:54:10 -0500 +Received: from ausmailid.aus.pervasive.com ([172.16.4.64]) by + AUSOWA.aus.pervasive.com with Microsoft SMTPSVC(6.0.3790.1830); + Thu, 10 Aug 2006 11:53:01 -0500 +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +Subject: Re: [BUGS] BUG #2567: High IOWAIT +Date: Thu, 10 Aug 2006 11:53:01 -0500 +Message-ID: + <4D27CB1096EF1C408F4BFAB0046EC7B667D929@ausmailid.aus.pervasive.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [BUGS] BUG #2567: High IOWAIT +Thread-Index: Aca8Au5Dybq9pnYsSbaGu82slT/v4QAL/wWwABojpHA= +References: <20060810043408.9C0277E40C2@smtp1.netmagicians.com> +From: "Jim Nasby" +To: "Kumarselvan S" +Cc: +X-OriginalArrivalTime: 10 Aug 2006 16:53:01.0994 (UTC) + FILETIME=[711840A0:01C6BC9D] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/190 +X-Sequence-Number: 20375 + +Please cc the list so others can help. + +How large is the database? What indexes are on the tables you're = +inserting into? What speed is the drive? + +Since it's a single SCSI drive I'm assuming it's only 10k RPM, which = +means the theoretical maximum you can hit is 160 transfers per second. = +At 40 inserts per second (I'm assuming each insert is it's own = +transaction), you're already at 40 WAL operations per second, minimum. = +Plus whatever traffic you have to the data tables. + +Your biggest win would be to batch those inserts together into = +transactions, if possible. If not, the commit_delay settings might help = +you out. + +There may be some further gains to be had by tweaking the background = +writer settings; it might be too aggressive in your application. + +That update statement could also be causing a lot of activity, depending = +on what it's doing. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + + + +-----Original Message----- +From: Kumarselvan S [mailto:kumar@nexge.com] +Sent: Wed 8/9/2006 11:33 PM +To: Jim Nasby +Subject: RE: [BUGS] BUG #2567: High IOWAIT +=20 +Yes , it is not a Bug.=20 +Here the some Info abt the Hardware +It has an SCSI Drive. +It an dell made quad processor machine.=20 + +The changes to Postgresql.conf +1. max_connections =3D50 +2. shared buffer =3D 30000 +3. Temp buffer 20000 + +Regards, +Kumar +-----Original Message----- +From: Jim C. Nasby [mailto:jnasby@pervasive.com]=20 +Sent: Thursday, August 10, 2006 3:57 AM +To: kumarselvan +Cc: pgsql-performance@postgresql.org +Subject: Re: [BUGS] BUG #2567: High IOWAIT + +This isn't a bug; moving to pgsql-performance. + +On Tue, Aug 08, 2006 at 08:42:02AM +0000, kumarselvan wrote: +> i have installed the postgres as mentioned in the Install file. it is = +a 4 +> cpu 8 GB Ram Machine installed with Linux Enterprise version 3. when i = +am +> running a load which will perfrom 40 inserts persecond on 2 tables and = +10 +> updates per 10seconds on differnt table IOWait on avg going upto 70% = +due +to +> which i am not able to increase the load. Is there is any other way to +> install the postgres on multiprocessor machine.. can any one help me = +on +> this... + +You haven't given us nearly enough information. What kind of hardware is +this? RAID? What changes have you made to postgresql.conf? +--=20 +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + + +quad + + + + +From pgsql-performance-owner@postgresql.org Thu Aug 10 15:32:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A3E089FB235 + for ; + Thu, 10 Aug 2006 15:32:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 26181-06 for + ; + Thu, 10 Aug 2006 18:32:31 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) + by postgresql.org (Postfix) with ESMTP id 2EA9A9FB1F8 + for ; + Thu, 10 Aug 2006 15:32:31 -0300 (ADT) +Received: by megazone.bigpanda.com (Postfix, from userid 1001) + id 70D8E3516D; Thu, 10 Aug 2006 11:32:25 -0700 (PDT) +Received: from localhost (localhost [127.0.0.1]) + by megazone.bigpanda.com (Postfix) with ESMTP + id 6F0013515E; Thu, 10 Aug 2006 11:32:25 -0700 (PDT) +Date: Thu, 10 Aug 2006 11:32:25 -0700 (PDT) +From: Stephan Szabo +To: Sue Fitt +Cc: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +In-Reply-To: <44DAE8CF.1030107@inf.ed.ac.uk> +Message-ID: <20060810113004.K52796@megazone.bigpanda.com> +References: <44DAE8CF.1030107@inf.ed.ac.uk> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/191 +X-Sequence-Number: 20376 + +On Thu, 10 Aug 2006, Sue Fitt wrote: + +> Hi all, +> +> This is my first post to the performance list, I hope someone can help me. +> +> I'm setting up a table with 2 columns, both of which reference a column +> in another table: +> +> CREATE TABLE headwords_core_lexemes ( +> core_id int REFERENCES headwords_core(core_id), +> lexeme_id int REFERENCES headwords_core(core_id), +> ); +> +> Trouble is, it's taken 18 hours and counting! + +What precisely is taking the time, the create table itself? The only thing +that the create should be waiting for as far as I know is a lock on +headwords_core to add the triggers. + +From pgsql-performance-owner@postgresql.org Thu Aug 10 16:02:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 2ACE79FA38D + for ; + Thu, 10 Aug 2006 16:02:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 31822-10 for + ; + Thu, 10 Aug 2006 19:02:18 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from hs5.cfa.cmu.edu (HS5.CFA.cmu.edu [128.2.103.215]) + by postgresql.org (Postfix) with ESMTP id B65E09FB2FA + for ; + Thu, 10 Aug 2006 16:02:13 -0300 (ADT) +Received: from [192.168.100.102] (host82.155.212.198.conversent.net + [155.212.198.82]) (authenticated bits=0) + by hs5.cfa.cmu.edu (8.12.11.20060308/8.12.11) with ESMTP id + k7AJ2BIq006584 + (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) + for ; Thu, 10 Aug 2006 15:02:12 -0400 +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +References: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +Content-Type: multipart/alternative; boundary=Apple-Mail-12-835670872 +Message-Id: +From: AgentM +Subject: Re: slow transfer speeds with PostgreSQL +Date: Thu, 10 Aug 2006 15:02:09 -0400 +To: pgsql-performance@postgresql.org +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=HTML_50_60, + HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/196 +X-Sequence-Number: 20381 + + +--Apple-Mail-12-835670872 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 3, 2006, at 19:39 , hansell baran wrote: +> When we run the following query "SELECT * FROM big_table", we get +> the following resutls: +> Very different results are obtained if a the query "SELECT * from +> big_table ORDER BY "some_column"". In this scenario + +You should perform your test with queries which are identical or +similar to the queries which the database will really be seeing. +Anything else isn't really relevant for tuning because different +configurations cater to different types of workloads. + +-M +--Apple-Mail-12-835670872 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; + charset=ISO-8859-1 + +
On Aug 3, 2006, at = +19:39 , hansell baran wrote:

When we run the following = +query "SELECT * FROM big_table", we get the following = +resutls:

Very = +different results are obtained if a the query "SELECT * from big_table = +ORDER BY "some_column"". In this scenario=A0

= +

You should perform your test with queries = +which are identical or similar to the queries which the database will = +really be seeing. Anything else isn't really relevant for tuning because = +different configurations cater to different types of = +workloads.=A0

-M
= + +--Apple-Mail-12-835670872-- + +From pgsql-performance-owner@postgresql.org Thu Aug 10 17:51:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 1610E9FB31F + for ; + Thu, 10 Aug 2006 17:51:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 43576-09 for + ; + Thu, 10 Aug 2006 20:51:18 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.206]) + by postgresql.org (Postfix) with ESMTP id 208B19FB2F8 + for ; + Thu, 10 Aug 2006 17:51:17 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so110627nzd + for ; + Thu, 10 Aug 2006 13:51:16 -0700 (PDT) +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=MSYDO8r9zbHM+4FrXoECX+wkAheUAeHlhj2aKE8hVeSCU6XuipG9HP9cDX84IjploG4SC17tzDo5y7rS70/JRL56xQ9NfTjF17eG/vsz1u7tklXlC8O9uAvTXfPbFR89nzBnKPzr86F0bW9T82TBpNDX5bFkyv0pETbOi9WiNgk= +Received: by 10.65.234.3 with SMTP id l3mr3134916qbr; + Thu, 10 Aug 2006 13:51:16 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Thu, 10 Aug 2006 13:51:16 -0700 (PDT) +Message-ID: +Date: Thu, 10 Aug 2006 16:51:16 -0400 +From: "Merlin Moncure" +To: "hansell baran" +Subject: Re: slow transfer speeds with PostgreSQL +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/197 +X-Sequence-Number: 20382 + +On 8/3/06, hansell baran wrote: +> Hi. I'm new at using PostgreSQL. +> Where I work, all databases were built with MS Access. The Access files are +> hosted by computers with Windows 2000 and Windows +> +> XP. A new server is on its way and only Open Source Software is going to be +> installed. The OS is going to be SUSE Linux 10.1 +> +> and we are making comparisons between MySQL, PostgreSQL and MS Access. We +> installed MySQL and PostgreSQL on both SUSE and +> +> Windows XP (MySQL & PostgreSQL DO NOT run at the same time)(There is one HDD +> for Windows and one for Linux) +> The "Test Server" in which we install the DBMS has the following +> characteristics: +> +> CPU speed = 1.3 GHz +> RAM = 512 MB +> HDD = 40 GB +> +> The biggest table has 544371 rows(tuples?) with 55 rows. All fields are +> float8. Only 1 is varchar(255) and 1 timestamp. +> We query the MS Access databases through Visual Basic Programs and ODBC +> Drivers. We made a Visual Basic program that uses ADO +> +> to connect to ALL three DBMS using ODBC drivers. +> +> When we run the following query "SELECT * FROM big_table", we get the +> following resutls: +> +> MS Access +> - Execution time ~ 51 seconds (Depending on the client machine, it can go as +> low as 20 seconds) +> - Network Utilization ~ 80 Mbps (According to Windows Task Manager) +> +> MySQL 5.0 (under Windows) +> - Execution time ~ 630 seconds +> - Network Utilization ~ 8 Mbps +> +> PostgreSQL 8.1 (under Windows) +> - Execution time ~ 290 seconds) +> - Network Utilization ~ 13 Mbps +> +> +> MS Access (under Linux. MS Access files are in the Linux computer which has +> the SAMBA server running. The client computer has +> +> a mapped network drive that conects to the Linux files.) +> - Execution time ~ 55 seconds (Depending on the client machine, it can go as +> low as 20 seconds) +> - Network Utilization ~ 76 Mbps (According to Windows Task Manager) +> +> MySQL 5.0(under Linux) +> - Execution time ~ 440 seconds +> - Network Utilization ~ 11 Mbps +> +> PostgreSQL 8.1(under Linux) +> - Execution time ~ 180 seconds) +> - Network Utilization ~ 18 Mbps +> +> +> Very different results are obtained if a the query "SELECT * from big_table +> ORDER BY "some_column"". In this scenario + +you have to be careful comparing access to mysql/postgresql in this +way because the architecture is different...these results are a bit +misleading. access can do some optimization tricks on very simple +queries, especially select * from bigtable becuase the result does not +have to be fully materialized and returned to the client. + +> PostgreSQL is faster than MS Access or MySQL by more than 100 seconds. +> +> We have run many other queries (not complex, at most nesting of 5 inner +> joins) and MS Access is always faster. We have seen + +i find this really hard to believe. is your postgresql database +properly indexed and did you run analyze? do the standard +-performance thing, run the query in with explain analyze: + +explain anaylze 5_table_join_query + +and post the results to this list. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 10 17:56:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 40E8D9FB31F + for ; + Thu, 10 Aug 2006 17:56:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 51158-08 for + ; + Thu, 10 Aug 2006 20:55:58 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.207]) + by postgresql.org (Postfix) with ESMTP id 406029FB2F8 + for ; + Thu, 10 Aug 2006 17:55:57 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so111115nzd + for ; + Thu, 10 Aug 2006 13:55:56 -0700 (PDT) +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=SQOAUszN5osVuaIQVMzpjKI6fQvpuNpNRYH8u5jx2az+eRJNdxuQRbEfMTb3i6HLe/V7nH+DksRyOz9G/3PefsfDMS0JmxwiKlD/WiN5LeURKZby+YZSiUkGDMyfx4e3fPDZwpVHOGfmJq6uxinPDuXYc47eKDfqE4Q0Cj5ixvw= +Received: by 10.65.59.16 with SMTP id m16mr3020261qbk; + Thu, 10 Aug 2006 13:55:56 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Thu, 10 Aug 2006 13:55:54 -0700 (PDT) +Message-ID: +Date: Thu, 10 Aug 2006 16:55:54 -0400 +From: "Merlin Moncure" +To: "Phil Cairns" +Subject: Re: Slow access to PostgreSQL server +Cc: pgsql-performance@postgresql.org +In-Reply-To: <12dm0u95lncnte0@corp.supernews.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <12dm0u95lncnte0@corp.supernews.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/198 +X-Sequence-Number: 20383 + +On 8/10/06, Phil Cairns wrote: +> Hi all, +> +> I have an application that uses PostgreSQL to store its data. The +> application and an instance of the database have been installed in three +> different locations, and none of these three locations have anything to +> do with any of the others. I'm observing a problem in that large +> transfers to some machines on the network (specifically while running +> pg_dump) are dead slow. In fact, the information is going from the +> server to the client machine at dialup speeds over a 100 Mb LAN to some +> machines, and full speed to others. + +there have been numerous problems reported on windows due to various +applications, especially malware and virus scanners, that cause this +problem. be especially cautious about anything that runs in kernel +mode or runs as a LSP. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 10 19:36:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 23F889FA6B5 + for ; + Thu, 10 Aug 2006 19:36:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 87576-08 for + ; + Thu, 10 Aug 2006 19:36:16 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.180]) + by postgresql.org (Postfix) with ESMTP id 1D71B9FB27E + for ; + Thu, 10 Aug 2006 19:36:15 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id n25so938684pyg + for ; + Thu, 10 Aug 2006 15:36:14 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=i15e4ZZAJJO0ZKtvtUDlIrhYxabuoR1eZfFXYxgfWZTBzzEbabDL3Mkk+cVcVzvvub1i6j2xPAYTZQr3ObW7GtlrEb/zNx4LgZuTTLgLFqi64ZjI8oHoCJtW23lUUwlVtXOCor7nY8IE9qab6ew0l1MCRPepy7oOnnvH7C/9OpY= +Received: by 10.35.41.12 with SMTP id t12mr4676233pyj; + Thu, 10 Aug 2006 15:36:14 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id k53sm1688695pyd.2006.08.10.15.36.12; + Thu, 10 Aug 2006 15:36:14 -0700 (PDT) +Message-ID: <44DBB4DB.6020605@gmail.com> +Date: Fri, 11 Aug 2006 08:36:11 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Merlin Moncure +CC: Sue Fitt , pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <44DAE8CF.1030107@inf.ed.ac.uk> <44DAEB04.9050306@gmail.com> + <44DAF6B7.1090800@inf.ed.ac.uk> <44DAF8B9.2080000@gmail.com> + +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.19 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/199 +X-Sequence-Number: 20384 + +Merlin Moncure wrote: +> On 8/10/06, Chris wrote: +>> Sue Fitt wrote: +>> > Thanks Chris and Chris, you've solved it. +>> > +>> > I had a gui open that connects to the database. It was doing nothing +>> > (and not preventing me adding to or altering headwords_core via psql), +>> > but having closed it the table is instantly created. Weird. +>> > +>> > BTW, referencing the same column twice is deliberate, it's a +>> > cross-reference. +>> +>> The same column and the same table? +>> +>> Same column different table I could understand but not the same column & +>> table ;) +> +> create table color(color text); +> +> create table person(eye_color text references color(color), hair_color +> text references color(color)); + +lol. Good point :) + +*back to the hidey hole!* + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Fri Aug 11 01:19:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B77199FB29B + for ; + Fri, 11 Aug 2006 01:18:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 20214-04 for + ; + Fri, 11 Aug 2006 01:18:55 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.190]) + by postgresql.org (Postfix) with ESMTP id 428CE9FB271 + for ; + Fri, 11 Aug 2006 01:18:54 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id n28so871735nfc + for ; + Thu, 10 Aug 2006 21:18:53 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; + b=rc5SCZIm3WvWabZBFdz4Ju1Y2rFCCoe8kF9erE/ZyOoHWS1D2bHRWk59xhNbYpn4Axa+uB+2ND6EhVhlh7LHbJpeDSRYd34eqtv+6nSG4xDqtwVnroE9bsISx6KhDuFzbEtemRLoLOC3Y91+o4TVKzFr/YVHLKBCvZIx9v6Pvww= +Received: by 10.78.116.19 with SMTP id o19mr1998604huc; + Thu, 10 Aug 2006 21:18:53 -0700 (PDT) +Received: by 10.78.158.10 with HTTP; Thu, 10 Aug 2006 21:18:53 -0700 (PDT) +Message-ID: +Date: Thu, 10 Aug 2006 22:18:53 -0600 +From: "Carl Youngblood" +To: "Richard Huxton" +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44DAFB2B.4070307@archonet.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: + <44DAFB2B.4070307@archonet.com> +X-Google-Sender-Auth: 6a1d3f29f71d4abc +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/200 +X-Sequence-Number: 20385 + +Thanks a lot for the advice Richard. I will try those things out and +report back to the list. + +Carl + +On 8/10/06, Richard Huxton wrote: +> From your figures, you're allocating about 64MB to work_mem, which is +> per sort. So, a complex query could use several times that amount. If +> you don't have many concurrent queries that might be what you want. +> +> Also, you've allocated 1GB to your shared_buffers which is more than I'd +> use as a starting point. +> +> You've only mentioned one main table with 100,000 rows, so presumably +> you're going to cache the entire DB in RAM. So, you'll want to increase +> effective_cache_size and reduce random_page_cost. + +From pgsql-performance-owner@postgresql.org Fri Aug 11 05:48:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B218F9FB2A2 + for ; + Fri, 11 Aug 2006 05:48:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 55472-10 for + ; + Fri, 11 Aug 2006 05:48:22 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 0CC119FB2C0 + for ; + Fri, 11 Aug 2006 05:48:22 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com + (80-219-241-140.dclient.hispeed.ch [80.219.241.140]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 9FB2D656BB; + Fri, 11 Aug 2006 10:50:20 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 1D0CE18148BC0; + Fri, 11 Aug 2006 10:48:36 +0200 (CEST) +Message-ID: <44DC4463.5@logix-tt.com> +Date: Fri, 11 Aug 2006 10:48:35 +0200 +From: Markus Schaber +Reply-To: PostgreSQL Performance List +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Cc: Kumarselvan S +Subject: Re: [BUGS] BUG #2567: High IOWAIT +References: <20060810043408.9C0277E40C2@smtp1.netmagicians.com> + <4D27CB1096EF1C408F4BFAB0046EC7B667D929@ausmailid.aus.pervasive.com> +In-Reply-To: + <4D27CB1096EF1C408F4BFAB0046EC7B667D929@ausmailid.aus.pervasive.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/201 +X-Sequence-Number: 20386 + +Hi, Jim, + +Jim Nasby wrote: + +> Your biggest win would be to batch those inserts together into +> transactions, if possible. + +Using COPY instead of INSERT might even give better wins, and AFAIK some +client libs use COPY internally (e. G. tablewriter from libpqxx). + +> If not, the commit_delay settings might help you out. + +As far as I understand, this will only help for concurrent inserts by +different clients, dealing throughput for latency. Please correct me if +I'm wrong. + +HTH, +Markus +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Fri Aug 11 05:53:48 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D17939FB2A2 + for ; + Fri, 11 Aug 2006 05:53:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 32005-09 for + ; + Fri, 11 Aug 2006 08:53:44 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 04B9B9FB2C0 + for ; + Fri, 11 Aug 2006 05:53:43 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com + (80-219-241-140.dclient.hispeed.ch [80.219.241.140]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 99FFF656BB; + Fri, 11 Aug 2006 10:55:42 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 891AC18148BC0; + Fri, 11 Aug 2006 10:53:58 +0200 (CEST) +Message-ID: <44DC45A6.9080807@logix-tt.com> +Date: Fri, 11 Aug 2006 10:53:58 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: contact1981 +Cc: pgsql-performance@postgresql.org +Subject: Re: Migrating data from DB2 to SQL Server +References: <1154637778.693657.161630@i3g2000cwc.googlegroups.com> +In-Reply-To: <1154637778.693657.161630@i3g2000cwc.googlegroups.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/202 +X-Sequence-Number: 20387 + +Hi, Eldhose, + +contact1981 wrote: + +> I am trying to migrate data from a DB2 database to SQL Server 2005 +> database. Does anyone know about any migration tool that does that? I +> have heard about DB2 Migration Tool kit, but I think you can only +> migrate data to a DB2 database with that. Thank you. + +It seems that you, by accident, hit the wrong list with your question. + +But, as you're here, why don't you migrate to PostgreSQL instead? + + +Have a nice day, +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Fri Aug 11 06:02:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 2AEF59FA69A + for ; + Fri, 11 Aug 2006 06:02:02 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 37855-04 for + ; + Fri, 11 Aug 2006 09:01:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 7ECAE9FB2A2 + for ; + Fri, 11 Aug 2006 06:01:58 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com + (80-219-241-140.dclient.hispeed.ch [80.219.241.140]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id D35B3656BB; + Fri, 11 Aug 2006 11:03:56 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id E70E318148BC0; + Fri, 11 Aug 2006 11:02:12 +0200 (CEST) +Message-ID: <44DC4794.2000507@logix-tt.com> +Date: Fri, 11 Aug 2006 11:02:12 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: hansell baran +Cc: pgsql-performance@postgresql.org +Subject: Re: slow transfer speeds with PostgreSQL +References: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +In-Reply-To: <20060803233939.75401.qmail@web30304.mail.mud.yahoo.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/203 +X-Sequence-Number: 20388 + +Hi, Hansell, + +hansell baran wrote: + +> When we run the following query "SELECT * FROM big_table", we get the +> following resutls: + +Just for Curiosity: + +Could you try to "COPY big_table TO stdout" from psql[.exe]? (and +possibly redirect the psql output to /dev/null or so?) + +> Is there a way to increase the transfer rates? + +Which file system do you use? + +Could you try to "VACUUM FULL" the tables? + +I assume that, for complex queries, you have all the appropriate indices +etc. + +Also, I have to admit, that for single-client scenarios and simple, +mostly read-only queries, PostgreSQL tends to be slower than Access and +MySQL. + +However, this changes as soon as you have multiple concurrent writing +clients. You should take this into account when benchmarking your +servers (by modelling the appropriate benchmarks), and when deciding +which database to use (by trying to estimate future usage patterns). + + +HTH, +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Fri Aug 11 06:15:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3D0779FB355 + for ; + Fri, 11 Aug 2006 06:15:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 42024-03 for + ; + Fri, 11 Aug 2006 09:15:50 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id C788C9FB2A2 + for ; + Fri, 11 Aug 2006 06:15:49 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com + (80-219-241-140.dclient.hispeed.ch [80.219.241.140]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 3B9DC656BB; + Fri, 11 Aug 2006 11:17:48 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 3A3FF18148BC0; + Fri, 11 Aug 2006 11:16:04 +0200 (CEST) +Message-ID: <44DC4AD3.1030809@logix-tt.com> +Date: Fri, 11 Aug 2006 11:16:03 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Phil Cairns +Cc: pgsql-performance@postgresql.org +Subject: Re: Slow access to PostgreSQL server +References: <12dm0u95lncnte0@corp.supernews.com> +In-Reply-To: <12dm0u95lncnte0@corp.supernews.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/204 +X-Sequence-Number: 20389 + +Hi, Phil, + +Phil Cairns wrote: + +> Has anyone experienced this sort of thing before? We're running with +> 8.0.4. My application uses libpg, while another application is using +> OLEDB. Both the native and OLEDB layers exhibit the delay on the "slow" +> machines, and have no problems on the "fast" machines. Note that the +> laptops are in no way inferior to the desktop machines in terms of CPU, +> RAM, etc. + +Can you try to rsync / netcat some large files / random data through +nonstandard ports in both directions, and see whether that reproduces +the behaviour? I also think using PostgreSQL on port 80 might be an +interesting test. + +It might be a driver or "security software" issue... + +When http and network drive transfers work fast, but transfers on +nonstandard ports (postgreSQL uses 5432) work slow, I'd suspect some +personal firewall or antivirus network filtering software. + +HTH, +Marku + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Fri Aug 11 06:34:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 087539FB2A2 + for ; + Fri, 11 Aug 2006 06:34:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 47806-01 for + ; + Fri, 11 Aug 2006 09:34:49 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 7017A9FA425 + for ; + Fri, 11 Aug 2006 06:34:49 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mail.rp-online.de (mail.rp-online.de [149.221.1.199]) + by svr4.postgresql.org (Postfix) with ESMTP id 735375AF881 + for ; + Fri, 11 Aug 2006 09:34:48 +0000 (GMT) +Received: from idefix.d.rp-online.de (idefix.d.rp-online.de [149.221.100.194]) + by mail.rp-online.de (Postfix) with ESMTP id EA11E2E5D4 + for ; + Fri, 11 Aug 2006 11:34:45 +0200 (CEST) +From: Thomas Pundt +Reply-To: Thomas Pundt +Organization: RP Online Verlagsgesellschaft mbH +To: pgsql-performance@postgresql.org +Subject: Re: Slow access to PostgreSQL server +Date: Fri, 11 Aug 2006 11:34:49 +0200 +User-Agent: KMail/1.9.4 +References: <12dm0u95lncnte0@corp.supernews.com> +In-Reply-To: <12dm0u95lncnte0@corp.supernews.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +Message-Id: <200608111134.50277.mlists@rp-online.de> +X-Anti-Virus: Kaspersky Anti-Virus for MailServers 5.5.3/RELEASE, + bases: 11082006 #201361, status: clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.069 tagged_above=0 required=5 tests=SPF_NEUTRAL +X-Spam-Level: * +X-Archive-Number: 200608/205 +X-Sequence-Number: 20390 + +Hi, + +On Thursday 10 August 2006 12:00, Phil Cairns wrote: +| In fact, the information is going from the +| server to the client machine at dialup speeds over a 100 Mb LAN to some +| machines, and full speed to others. +[...] +| There are no problems with copying files across the network. + +and you are really really sure that this is not a network issue? I'd +double check that this is not a duplex mismatch, misconfigured router +or switch or something in that direction. + +Ciao, +Thomas + +-- +Thomas Pundt ---- http://rp-online.de/ ---- + +From pgsql-performance-owner@postgresql.org Fri Aug 11 08:48:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id AC2029FB2A4 + for ; + Fri, 11 Aug 2006 08:48:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 71694-02 for + ; + Fri, 11 Aug 2006 11:48:11 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) + by postgresql.org (Postfix) with ESMTP id 8D2869FB1E7 + for ; + Fri, 11 Aug 2006 08:48:10 -0300 (ADT) +Received: from [129.215.218.230] (skibo.inf.ed.ac.uk [129.215.218.230]) + by nutty.inf.ed.ac.uk (8.13.6/8.13.6) with ESMTP id k7BBm1Gn025812; + Fri, 11 Aug 2006 12:48:04 +0100 +Message-ID: <44DC6E71.3030401@inf.ed.ac.uk> +Date: Fri, 11 Aug 2006 12:48:01 +0100 +From: Sue Fitt +User-Agent: Thunderbird 1.5.0.4 (X11/20060620) +MIME-Version: 1.0 +To: Stephan Szabo +CC: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <44DAE8CF.1030107@inf.ed.ac.uk> + <20060810113004.K52796@megazone.bigpanda.com> +In-Reply-To: <20060810113004.K52796@megazone.bigpanda.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/206 +X-Sequence-Number: 20391 + +Solved, it turned out to be a lock caused by a gui connected to the +database, even though the gui wasn't actually doing anything at the time... + +Sue + +Stephan Szabo wrote: +> On Thu, 10 Aug 2006, Sue Fitt wrote: +> +> +>> Hi all, +>> +>> This is my first post to the performance list, I hope someone can help me. +>> +>> I'm setting up a table with 2 columns, both of which reference a column +>> in another table: +>> +>> CREATE TABLE headwords_core_lexemes ( +>> core_id int REFERENCES headwords_core(core_id), +>> lexeme_id int REFERENCES headwords_core(core_id), +>> ); +>> +>> Trouble is, it's taken 18 hours and counting! +>> +> +> What precisely is taking the time, the create table itself? The only thing +> that the create should be waiting for as far as I know is a lock on +> headwords_core to add the triggers. +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> +> + +From pgsql-performance-owner@postgresql.org Fri Aug 11 16:05:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 483C89FB2B1 + for ; + Fri, 11 Aug 2006 16:05:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 80068-07 for + ; + Fri, 11 Aug 2006 19:05:30 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colsweeper.cranel.com (newmail.cranel.com [66.192.200.227]) + by postgresql.org (Postfix) with ESMTP id 314619FB1E7 + for ; + Fri, 11 Aug 2006 16:05:29 -0300 (ADT) +Received: from POSTOFFICE.cranel.local (exchsvr01.cranel.local [192.168.1.38]) + by colsweeper.cranel.com (Clearswift SMTPRS 5.1.7) with ESMTP id + for + ; Fri, 11 Aug 2006 15:00:26 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: setting up foreign keys +Date: Fri, 11 Aug 2006 15:01:15 -0400 +Message-ID: <82E74D266CB9B44390D3CCE44A781ED901368432@POSTOFFICE.cranel.local> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] setting up foreign keys +Thread-Index: Aca8zXmfQUmHzVO4RsyZFZp6tZw6RAAqiIYQ +From: "Spiegelberg, Greg" +To: "Chris" , + "Merlin Moncure" +Cc: "Sue Fitt" , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/207 +X-Sequence-Number: 20392 + +Sort of on topic, how many foreign keys in a single table is good v. +bad? I realize it's relative to the tables the FK's reference so here's +an example: + +Table A: 300 rows +Table B: 15,000,000 rows +Table C: 100,000 rows +Table E: 38 rows +Table F: 9 rows +Table G: is partitioned on the FK from Table A and has a FK column for +each of the above tables + +I'm in the process of normalizing the database and have a schema like +this in mind. Works wonderfully for SELECT's but haven't gotten the +data import process down just yet so I haven't had a chance to put it +through it's paces. Depending on the performance of INSERT, UPDATE, and +COPY I may drop the FK constraints since my app could enforce the FK +checks. + +TIA. + +Greg +=20 + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org=20 +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Chris +> Sent: Thursday, August 10, 2006 6:36 PM +> To: Merlin Moncure +> Cc: Sue Fitt; pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] setting up foreign keys +>=20 +> Merlin Moncure wrote: +> > On 8/10/06, Chris wrote: +> >> Sue Fitt wrote: +> >> > Thanks Chris and Chris, you've solved it. +> >> > +> >> > I had a gui open that connects to the database. It was doing=20 +> >> > nothing (and not preventing me adding to or altering=20 +> headwords_core=20 +> >> > via psql), but having closed it the table is instantly=20 +> created. Weird. +> >> > +> >> > BTW, referencing the same column twice is deliberate, it's a=20 +> >> > cross-reference. +> >> +> >> The same column and the same table? +> >> +> >> Same column different table I could understand but not the same=20 +> >> column & table ;) +> >=20 +> > create table color(color text); +> >=20 +> > create table person(eye_color text references color(color),=20 +> hair_color=20 +> > text references color(color)); +>=20 +> lol. Good point :) +>=20 +> *back to the hidey hole!* +>=20 +> -- +> Postgresql & php tutorials +> http://www.designmagick.com/ +>=20 +> ---------------------------(end of=20 +> broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org=20 +> so that your +> message can get through to the mailing list cleanly +>=20 + +From pgsql-performance-owner@postgresql.org Sat Aug 12 11:20:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 53BBF9FB346 + for ; + Sat, 12 Aug 2006 11:20:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 84116-03 for + ; + Sat, 12 Aug 2006 14:20:09 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from isis.sigpipe.cz (fw.sigpipe.cz [62.245.70.224]) + by postgresql.org (Postfix) with ESMTP id 5A9D39FB33B + for ; + Sat, 12 Aug 2006 11:20:08 -0300 (ADT) +Received: from dagan.sigpipe.cz (dagan.sigpipe.cz [10.9.8.90]) + by isis.sigpipe.cz (Postfix) with ESMTP id F39E91F87BF2; + Sat, 12 Aug 2006 16:20:06 +0200 (CEST) +Received: by dagan.sigpipe.cz (Postfix, from userid 1001) + id E37852C918D; Sat, 12 Aug 2006 16:20:19 +0000 (UTC) +Date: Sat, 12 Aug 2006 16:20:19 +0000 +From: Roman Neuhauser +To: "Joshua D. Drake" +Cc: Kenji Morishige , + pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060812162019.GA1340@dagan.sigpipe.cz> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44D906E1.7010405@commandprompt.com> +User-Agent: Mutt/1.5.11 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/208 +X-Sequence-Number: 20393 + +# jd@commandprompt.com / 2006-08-08 14:49:21 -0700: +> >I am considering a setup such as this: +> > - At least dual cpu (possibly with 2 cores each) +> > - 4GB of RAM +> > - 2 disk RAID 1 array for root disk +> > - 4 disk RAID 1+0 array for PGDATA +> > - 2 disk RAID 1 array for pg_xlog +> > +> >Does anyone know a vendor that might be able provide such setup? +> +> I would look at the HP DL 385 or 585. The 385 is going to max a (2) dual +> core cpus. The 585 is (4) dual core cpus. + + I don't know about DL385 or DL585, but DL380 seem to go south within + 1 year of heavy hitting; precisely the Smart Array RAID controllers + (4 out of 6 disks suddenly "red"; insert new disks, ooops red as + well). + + I've seen this happen several times, and came away with a conclusion + that DL380 is sexy, but you don't want to marry it. Then again, + maybe the DL385 is different, though I seem to remember that both + G3 (Smart Array 5i) and G4 (6i) did this. + +-- +How many Vietnam vets does it take to screw in a light bulb? +You don't know, man. You don't KNOW. +Cause you weren't THERE. http://bash.org/?255991 + +From pgsql-performance-owner@postgresql.org Sun Aug 13 23:14:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E54959FB261 + for ; + Sun, 13 Aug 2006 23:14:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 83081-07 for + ; + Mon, 14 Aug 2006 02:14:13 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.181]) + by postgresql.org (Postfix) with ESMTP id C6B319FB20E + for ; + Sun, 13 Aug 2006 23:14:12 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so357090pyd + for ; + Sun, 13 Aug 2006 19:14:11 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=lEZWEFISTQwohO5VfucZSi8mQszEWd7wJ9JtBvd+z6jM6O7MWKBB1YBzayqiT5uvDnZDtelu7HnaPkCb72+6OaI/qA2ZwnrT6lWrTUI8GFelSAkWNZGhDRU0DsYO303ZLQA0BngMKM9fUUgQtHiYYS+hb/1xgm/rDDQ6kFcwMlg= +Received: by 10.35.41.14 with SMTP id t14mr12146141pyj; + Sun, 13 Aug 2006 19:14:11 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id 5sm379471nzk.2006.08.13.19.14.09; + Sun, 13 Aug 2006 19:14:11 -0700 (PDT) +Message-ID: <44DFDC73.8000701@gmail.com> +Date: Mon, 14 Aug 2006 12:14:11 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: "Spiegelberg, Greg" +CC: pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +References: <82E74D266CB9B44390D3CCE44A781ED901368432@POSTOFFICE.cranel.local> +In-Reply-To: + <82E74D266CB9B44390D3CCE44A781ED901368432@POSTOFFICE.cranel.local> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/209 +X-Sequence-Number: 20394 + +Spiegelberg, Greg wrote: +> Sort of on topic, how many foreign keys in a single table is good v. +> bad? I realize it's relative to the tables the FK's reference so here's +> an example: +> +> Table A: 300 rows +> Table B: 15,000,000 rows +> Table C: 100,000 rows +> Table E: 38 rows +> Table F: 9 rows +> Table G: is partitioned on the FK from Table A and has a FK column for +> each of the above tables +> +> I'm in the process of normalizing the database and have a schema like +> this in mind. Works wonderfully for SELECT's but haven't gotten the +> data import process down just yet so I haven't had a chance to put it +> through it's paces. Depending on the performance of INSERT, UPDATE, and +> COPY I may drop the FK constraints since my app could enforce the FK +> checks. + +As long as both sides of the FK's are indexed I don't think you'll have +a problem with a particular number of FK's per table. + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Mon Aug 14 12:38:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 0FE5F9FB2A0 + for ; + Mon, 14 Aug 2006 12:38:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 19270-04 for + ; + Mon, 14 Aug 2006 15:38:44 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 5EAE29FB1E8 + for ; + Mon, 14 Aug 2006 12:38:42 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 9449B56435; Mon, 14 Aug 2006 10:38:41 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Mon, 14 Aug 2006 10:38:41 -0500 +Date: Mon, 14 Aug 2006 10:38:41 -0500 +From: "Jim C. Nasby" +To: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060814153841.GF27928@pervasive.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060810110935.GF2900@mathom.us> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060814:pgsql-performance@postgresql.org::dxvtlLgK2xQk+SNL:00000 + 0000000000000000000000001KzW +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/210 +X-Sequence-Number: 20395 + +On Thu, Aug 10, 2006 at 07:09:38AM -0400, Michael Stone wrote: +> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +> >I tried as you suggested and my performance dropped by 50%. I went from +> >a 32 TPS to 16. Oh well. +> +> If you put data & xlog on the same array, put them on seperate +> partitions, probably formatted differently (ext2 on xlog). + +Got any data to back that up? + +The problem with seperate partitions is that it means more head movement +for the drives. If it's all one partition the pg_xlog data will tend to +be interspersed with the heap data, meaning less need for head +repositioning. + +Of course, if ext2 provided enough of a speed improvement over ext3 with +data=writeback then it's possible that this would be a win, though if +the controller is good enough to make putting pg_xlog on the same array +as $PGDATA a win, I suspect it would make up for most filesystem +performance issues associated with pg_xlog as well. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Mon Aug 14 12:51:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 91BCC9FB2A0 + for ; + Mon, 14 Aug 2006 12:51:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 53722-04 for + ; + Mon, 14 Aug 2006 12:51:11 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.198]) + by postgresql.org (Postfix) with ESMTP id DD3C29FB1E8 + for ; + Mon, 14 Aug 2006 12:51:10 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so294780nzd + for ; + Mon, 14 Aug 2006 08:51:09 -0700 (PDT) +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:references; + b=OT/kKuO9rOciZ2XHb1iZnbFSqfi2NJ9hnfObVFJ8ilG6J+FuStTTMlmT/bwHLrWDlbGRZ4AHWGw2uqCOJWYxCfIUUXquV0Ryrtuq9kamVSovQ55Atv6neqrogfEIu82JmC1hyGPG7Krrf0Een93Tc79C5UpsBgcat3oHqbd0jsY= +Received: by 10.65.219.4 with SMTP id w4mr7173567qbq; + Mon, 14 Aug 2006 08:51:09 -0700 (PDT) +Received: by 10.65.163.12 with HTTP; Mon, 14 Aug 2006 08:51:09 -0700 (PDT) +Message-ID: <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> +Date: Mon, 14 Aug 2006 08:51:09 -0700 +From: "Steve Poe" +To: "Jim C. Nasby" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060814153841.GF27928@pervasive.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_44049_24674198.1155570669611" +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.307 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/211 +X-Sequence-Number: 20396 + +------=_Part_44049_24674198.1155570669611 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Jim, + +I have to say Michael is onto something here to my surprise. I partitioned +the RAID10 on the SmartArray 642 adapter into two parts, PGDATA formatted +with XFS and pg_xlog as ext2. Performance jumped up to median of 98 TPS. I +could reproduce the similar result with the LSI MegaRAID 2X adapter as well +as with my own 4-disc drive array. + +The problem lies with the HP SmartArray 6i adapter and/or the internal SCSI +discs. Putting the pg_xlog on it kills the performance. + +Steve + +On 8/14/06, Jim C. Nasby wrote: +> +> On Thu, Aug 10, 2006 at 07:09:38AM -0400, Michael Stone wrote: +> > On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +> > >I tried as you suggested and my performance dropped by 50%. I went from +> > >a 32 TPS to 16. Oh well. +> > +> > If you put data & xlog on the same array, put them on seperate +> > partitions, probably formatted differently (ext2 on xlog). +> +> Got any data to back that up? +> +> The problem with seperate partitions is that it means more head movement +> for the drives. If it's all one partition the pg_xlog data will tend to +> be interspersed with the heap data, meaning less need for head +> repositioning. +> +> Of course, if ext2 provided enough of a speed improvement over ext3 with +> data=writeback then it's possible that this would be a win, though if +> the controller is good enough to make putting pg_xlog on the same array +> as $PGDATA a win, I suspect it would make up for most filesystem +> performance issues associated with pg_xlog as well. +> -- +> Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +> Pervasive Software http://pervasive.com work: 512-231-6117 +> vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: don't forget to increase your free space map settings +> + +------=_Part_44049_24674198.1155570669611 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Jim,

I have to say Michael is onto something here to my surprise. I partitioned the RAID10 on the SmartArray 642 adapter into two parts, PGDATA formatted with XFS and pg_xlog as ext2. Performance jumped up to median of 98 TPS. I could reproduce the similar result with the LSI MegaRAID 2X adapter as well as with my own 4-disc drive array. +

The problem lies with the HP SmartArray 6i adapter and/or the internal SCSI discs. Putting the pg_xlog on it kills the performance.

Steve

On 8/14/06, +Jim C. Nasby <jnasby@pervasive.com> wrote:
+On Thu, Aug 10, 2006 at 07:09:38AM -0400, Michael Stone wrote:
> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote:
> >I tried as you suggested and my performance dropped by 50%. I went from
> >a 32 TPS to 16. Oh well. +
>
> If you put data & xlog on the same array, put them on seperate
> partitions, probably formatted differently (ext2 on xlog).

Got any data to back that up?

The problem with seperate partitions is that it means more head movement +
for the drives. If it's all one partition the pg_xlog data will tend to
be interspersed with the heap data, meaning less need for head
repositioning.

Of course, if ext2 provided enough of a speed improvement over ext3 with +
data=writeback then it's possible that this would be a win, though if
the controller is good enough to make putting pg_xlog on the same array
as $PGDATA a win, I suspect it would make up for most filesystem
performance issues associated with pg_xlog as well. +
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117 +
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings +

+ +------=_Part_44049_24674198.1155570669611-- + +From pgsql-performance-owner@postgresql.org Mon Aug 14 14:04:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 726F79FB391 + for ; + Mon, 14 Aug 2006 14:04:21 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60059-03 for + ; + Mon, 14 Aug 2006 14:04:05 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) + by postgresql.org (Postfix) with ESMTP id E586B9FB283 + for ; + Mon, 14 Aug 2006 14:04:04 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J3Z00A0OZEA5T35@vms046.mailsrvcs.net> for + pgsql-performance@postgresql.org; Mon, 14 Aug 2006 12:03:47 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id F379A6E9A4; Mon, + 14 Aug 2006 13:03:43 -0400 (EDT) +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 uXxL8ePKCKDl; Mon, 14 Aug 2006 13:03:42 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id D64FD6EA05; Mon, 14 Aug 2006 13:03:41 -0400 (EDT) +Date: Mon, 14 Aug 2006 13:03:41 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060814153841.GF27928@pervasive.com> +To: "Jim C. Nasby" +Cc: pgsql-performance@postgresql.org +Mail-followup-to: "Jim C. Nasby" , + pgsql-performance@postgresql.org +Message-id: <20060814170338.GM2900@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: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.937 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/212 +X-Sequence-Number: 20397 + +On Mon, Aug 14, 2006 at 10:38:41AM -0500, Jim C. Nasby wrote: +>Got any data to back that up? + +yes. that I'm willing to dig out? no. :) + +>The problem with seperate partitions is that it means more head movement +>for the drives. If it's all one partition the pg_xlog data will tend to +>be interspersed with the heap data, meaning less need for head +>repositioning. + +The pg_xlog files will tend to be created up at the front of the disk +and just sit there. Any affect the positioning has one way or the other +isn't going to be measurable/repeatable. With a write cache for pg_xlog +the positioning isn't really going to matter anyway, since you don't +have to wait for a seek to do the write. + + From what I've observed in testing, I'd guess that the issue is that +certain filesystem operations (including, possibly, metadata operations) +are handled in order. If you have xlog on a seperate partition there +will never be anything competing with a log write on the server side, +which won't necessarily be true on a shared filesystem. Even if you have +a battery backed write cache, you might still have to wait a relatively +long time for the pg_xlog data to be written out if there's already a +lot of other stuff in a filesystem write queue. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Mon Aug 14 14:05:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3054E9FB1FE + for ; + Mon, 14 Aug 2006 14:05:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60283-04 for + ; + Mon, 14 Aug 2006 14:05:48 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 1EED99FB283 + for ; + Mon, 14 Aug 2006 14:05:47 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 4440956435; Mon, 14 Aug 2006 12:05:47 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Mon, 14 Aug 2006 12:05:46 -0500 +Date: Mon, 14 Aug 2006 12:05:46 -0500 +From: "Jim C. Nasby" +To: Steve Poe +Cc: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060814170545.GG27928@pervasive.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060814:steve.poe@gmail.com::ddV+WOnwtTFuTfDI:000000000000000000 + 0000000000000000000000009dB3 +X-Hashcash: + 1:20:060814:pgsql-performance@postgresql.org::14ufliCK4mHF2bu1:00000 + 0000000000000000000000004GoV +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.117 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/213 +X-Sequence-Number: 20398 + +On Mon, Aug 14, 2006 at 08:51:09AM -0700, Steve Poe wrote: +> Jim, +> +> I have to say Michael is onto something here to my surprise. I partitioned +> the RAID10 on the SmartArray 642 adapter into two parts, PGDATA formatted +> with XFS and pg_xlog as ext2. Performance jumped up to median of 98 TPS. I +> could reproduce the similar result with the LSI MegaRAID 2X adapter as well +> as with my own 4-disc drive array. +> +> The problem lies with the HP SmartArray 6i adapter and/or the internal SCSI +> discs. Putting the pg_xlog on it kills the performance. + +Wow, interesting. IIRC, XFS is lower performing than ext3, so if your +previous tests were done with XFS, that might be part of it. But without +a doubt, if you don't have a good raid controller you don't want to try +combining pg_xlog with PGDATA. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Mon Aug 14 14:09:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DE2F09FB283 + for ; + Mon, 14 Aug 2006 14:09:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60896-01 for + ; + Mon, 14 Aug 2006 14:09:09 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) + by postgresql.org (Postfix) with ESMTP id 74F169FB1FE + for ; + Mon, 14 Aug 2006 14:09:09 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J3Z00ATZZN860V4@vms046.mailsrvcs.net> for + pgsql-performance@postgresql.org; Mon, 14 Aug 2006 12:09:08 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id 953056E9A4; Mon, + 14 Aug 2006 13:09:06 -0400 (EDT) +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 31k7n6nMUVOI; Mon, 14 Aug 2006 13:09:05 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 116A16EA05; Mon, 14 Aug 2006 13:09:05 -0400 (EDT) +Date: Mon, 14 Aug 2006 13:09:04 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060814170545.GG27928@pervasive.com> +To: "Jim C. Nasby" +Cc: Steve Poe , pgsql-performance@postgresql.org +Mail-followup-to: "Jim C. Nasby" , + Steve Poe , pgsql-performance@postgresql.org +Message-id: <20060814170902.GN2900@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: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.884 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/214 +X-Sequence-Number: 20399 + +On Mon, Aug 14, 2006 at 12:05:46PM -0500, Jim C. Nasby wrote: +>Wow, interesting. IIRC, XFS is lower performing than ext3, + +For xlog, maybe. For data, no. Both are definately slower than ext2 for +xlog, which is another reason to have xlog on a small filesystem which +doesn't need metadata journalling. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Mon Aug 14 15:28:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 90FDF9FB2F5 + for ; + Mon, 14 Aug 2006 15:28:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 64937-05 for + ; + Mon, 14 Aug 2006 15:28:15 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 7779C9FB399 + for ; + Mon, 14 Aug 2006 15:28:14 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id DAD3EB80A; + Mon, 14 Aug 2006 14:28:12 -0400 (EDT) +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D4104953@MAIL.corp.lumeta.com> +References: <78ED28FACE63744386D68D8A9D1CF5D4104953@MAIL.corp.lumeta.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-7--968250699; + protocol="application/pkcs7-signature" +Message-Id: <8FF469B9-CD72-47ED-AD5C-1A2811787180@khera.org> +Cc: +From: Vivek Khera +Subject: Re: Dell PowerEdge 2950 performance +Date: Mon, 14 Aug 2006 14:28:11 -0400 +To: "Bucky Jordan" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.025 tagged_above=0 required=5 tests=AWL, + HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/215 +X-Sequence-Number: 20400 + + +--Apple-Mail-7--968250699 +Content-Type: multipart/alternative; + boundary=Apple-Mail-6--968250824 + + +--Apple-Mail-6--968250824 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; + charset=WINDOWS-1252; + delsp=yes; + format=flowed + + +On Aug 9, 2006, at 11:56 AM, Bucky Jordan wrote: + +> Here=92s the hardware: +> +> 2xDual Core 3.0 Ghz CPU (Xeon 5160- 1333Mhz FSB, 4 MB shared cache =20 +> per socket) +> +> 8 GB RAM (DDR2, fully buffered, Dual Ranked, 667 Mhz) +> +> 6x300 10k RPM SAS drives +> +> Perc 5i w/256 MB battery backed cache + +Is the PERC 5/i dual channel? If so, are 1/2 the drives on one =20 +channel and the other half on the other channel? I find this helps =20 +RAID10 performance when the mirrored pairs are on separate channels. + +Your transfer rate seems pretty good for Dell hardware, but I'm not =20 +experienced with SAS drives to know if those numbers are good in an =20 +absolute sense. + +Also, which driver picked up the SAS controller? amr(4) or aac(4) or =20= + +some other? That makes a big difference too. I think the amr driver =20= + +is "better" than the aac driver. + + +--Apple-Mail-6--968250824 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; + charset=WINDOWS-1252 + +
On Aug 9, 2006, at = +11:56 AM, Bucky Jordan wrote:

Here=92s the hardware:

2xDual Core 3.0 Ghz = +CPU (Xeon 5160- 1333Mhz FSB, 4 MB shared cache per socket)

8 GB RAM (DDR2, = +fully buffered, Dual Ranked, 667 Mhz)

6x300 10k RPM SAS drives

Perc 5i w/256 MB = +battery backed cache


Is the PERC = +5/i dual channel?=A0 If so, are 1/2 the drives on one channel and the = +other half on the other channel?=A0 I find this helps RAID10 performance = +when the mirrored pairs are on separate channels.

Your transfer rate seems = +pretty good for Dell hardware, but I'm not experienced with SAS drives = +to know if those numbers are good in an absolute sense.

Also, which driver picked = +up the SAS controller?=A0 amr(4) or aac(4) or some other?=A0 That makes = +a big difference too.=A0 I think the amr driver is "better" than the aac = +driver.

= + +--Apple-Mail-6--968250824-- + +--Apple-Mail-7--968250699 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MTQxODI4MTJa +MCMGCSqGSIb3DQEJBDEWBBRhDgQBlyG9lMbHIWalEwYaw8toWzCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAp+krdu2R67CCcR0r +tVpMA0KLerRoLFLaqpoB9yX2JL/qFPCxw0v/BkWONDFX0NRr2Kn1iqagy7zDREQiBqQcv57sNcx8 +O8+3G9ueGttXlkM7dVD/UoR7qL5cNc1NMxlMGf7NWw8QDm6W2LhQvz7uIaIbRZeLRiBPCRVXFnHo +bBQK8EH6K8mfpfvwER9Tmr0Yq2SYcFjMf81GclgqQEM+/AAbn6Vx0ymvUWzjNq0uQALd9hqx9aQc +f6o7+WM378gXbyjlkjskzKs3ZCFuG8noecRFvTP6nz+gON9GdVc0Ggk9CA6y/KMvDdhe23WnXhbO +sMaYCTm8XYW2/O8Oi2HgswAAAAAAAA== + +--Apple-Mail-7--968250699-- + +From pgsql-performance-owner@postgresql.org Mon Aug 14 16:57:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C214E9FB1BA + for ; + Mon, 14 Aug 2006 16:57:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 68986-07 for + ; + Mon, 14 Aug 2006 16:56:53 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 7499C9FA48B + for ; + Mon, 14 Aug 2006 16:56:53 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by svr4.postgresql.org (Postfix) with ESMTP id 4784A5AF02D + for ; + Mon, 14 Aug 2006 19:56:52 +0000 (GMT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Dell PowerEdge 2950 performance +Date: Mon, 14 Aug 2006 15:56:46 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D41049CB@MAIL.corp.lumeta.com> +In-Reply-To: <8FF469B9-CD72-47ED-AD5C-1A2811787180@khera.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Dell PowerEdge 2950 performance +Thread-Index: Aca/z3a0WrIX1R8XSSml5Zmoy1SdfQACYPPQ +From: "Bucky Jordan" +To: "Vivek Khera" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/216 +X-Sequence-Number: 20401 + +... +Is the PERC 5/i dual channel?=A0 If so, are 1/2 the drives on one = +channel and the other half on the other channel?=A0 I find this helps = +RAID10 performance when the mirrored pairs are on separate channels. +... + +With the SAS controller (PERC 5/i), every drive gets it's own 3 GB/s = +port.=20 + +... +Your transfer rate seems pretty good for Dell hardware, but I'm not = +experienced with SAS drives to know if those numbers are good in an = +absolute sense. + +Also, which driver picked up the SAS controller?=A0 amr(4) or aac(4) or = +some other?=A0 That makes a big difference too.=A0 I think the amr = +driver is "better" than the aac driver. +.. + +The internals of the current SAS drives are similar to the U320's they = +replaced in terms of read/write/seek performance, however the benefit is = +the SAS bus, which helps eliminate some of the U320 limitations (e.g. = +with Perc4, you only get 160 MB/s per channel as you mentioned). It's = +using the mfi driver...=20 + +Here's some simplistic performance numbers: +time bash -c "(dd if=3D/dev/zero of=3Dbigfile count=3D125000 bs=3D8k && = +sync)" + +Raid0 x 2 (2 spindles) ~138 MB/s on BSD +Raid5 x 4 ~160 MB/s BSD, ~274 MB/s Knoppix (ext2) +Raid5 x 6 ~255 MB/s BSD, 265 MB/s Knoppix (ext3) +Raid10 x 4 ~25 MB/s BSD +Raid50 x 6 ~144 MB/s BSD, 271 MB/s Knoppix + +* BSD is 6.1-RELEASE amd64 with UFS + Soft updates, Knoppix is 5.1 (ext2 = +didn't like the > 1TB partition for the 6 disk RAID 5, hence ext3) + +Seems to me the PERC5 has issues with layered raid (10, 50) as others = +have suggested on this list is a common problem with lower end raid = +cards. For now, I'm going with the RAID 5 option, however if I have = +time, I would like to test having the hardware do raid 0 and doing raid = +1 in the os, or vice versa, as proposed in other posts. + +Also, I ran a pgbench -s 50 -c 10 -t 1000 on a completely default BSD = +6.1 and PG 8.1.4 install with RAID5 x 6 disks, and got 442 tps on a = +fresh run (the numbers climb very rapidly due to caching after running = +simultaneous tests without reinitializing the test db. I'm guessing this = +is due to OS caching since the default postgresql.conf is pretty limited = +in terms of resource use). I probably need to up the scaling factor = +significantly so the whole data set doesn't get cached in RAM if I want = +realistic results from simultaneous tests, but it seems quicker to just = +reinit each time at this point. + +On to some kernel tweaks and some adjustments to postgresql.conf...=20 + +- Bucky + + +From pgsql-performance-owner@postgresql.org Mon Aug 14 18:24:32 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 7022B9FB21B + for ; + Mon, 14 Aug 2006 18:24:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 97500-05 for + ; + Mon, 14 Aug 2006 18:24:21 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 92F989FB1C2 + for ; + Mon, 14 Aug 2006 18:24:21 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id ABCC6B80A + for ; + Mon, 14 Aug 2006 17:24:17 -0400 (EDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D41049CB@MAIL.corp.lumeta.com> +References: <78ED28FACE63744386D68D8A9D1CF5D41049CB@MAIL.corp.lumeta.com> +Content-Type: multipart/signed; micalg=sha1; + boundary=Apple-Mail-10--957685707; + protocol="application/pkcs7-signature" +Message-Id: <73726D4E-D336-4678-B1C1-B0AE4D2D7C1F@khera.org> +From: Vivek Khera +Subject: Re: Dell PowerEdge 2950 performance +Date: Mon, 14 Aug 2006 17:24:16 -0400 +To: "Pgsql-Performance ((E-mail))" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.02 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/217 +X-Sequence-Number: 20402 + + +--Apple-Mail-10--957685707 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 14, 2006, at 3:56 PM, Bucky Jordan wrote: + +> Seems to me the PERC5 has issues with layered raid (10, 50) as +> others have suggested on this list is a common problem with lower +> end raid cards. For now, I'm going with the RAID 5 option, however +> if I have time, I would like to test having the hardware do raid 0 +> and doing raid 1 in the os, or vice versa, as proposed in other posts. + +Wow, those are pretty awesome numbers.... I'm actually inclined to +try these as my DB servers again! Lately I've been using Sun X4100 +with Adaptec RAID cards, but they don't transfer nearly as fast as +that on simple tests. + +Of more interest would be a test which involved large files with lots +of seeks all around (something like bonnie++ should do that). + +I too have noticed that Dell controllers don't like doing layered +RAID levels very well. All of mine are doing plain old RAID5 or +RAID1 only, and at that they are acceptable. The PERC 4/Si in the +1850 has been pretty fast at RAID1. + +Thanks for sharing your numbers. +--Apple-Mail-10--957685707 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MTQyMTI0MTda +MCMGCSqGSIb3DQEJBDEWBBTMDIL9GyX0QIZDtRCVxu6QyCUL/DCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAi79MBxOOG266qn4s +YyXivfO6LS2GuUAvVkgtLqKIH1X5wYWC6jPkzORO5an8aDctbN9UjKd6fjHoXutAgB97v2xSNsT1 +6zOaakIde7ZHgNh2XydlQjo9ndarvqQxN+evg9IAIMwZT3R2yyOLCYMw0pDgbuO+wrurqSWqoBlH +qQc5+0HgIm4UU/4FZUCM6hrZbo0WHzJVqGFG9sXC5i9mmqy9wn258rnbiUyJrb9vRguNPFM4SRZJ +EH6gI7w/7L81+ijc02N52CIIRS9yL+1W6gwxay1q32ETu74RY+8HCV1nNdmPxF96BqsDT8KelBET +bB6qgfjGQ0I8eFzbnKOrFAAAAAAAAA== + +--Apple-Mail-10--957685707-- + +From pgsql-performance-owner@postgresql.org Mon Aug 14 20:38:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A5EC99FB265 + for ; + Mon, 14 Aug 2006 20:38:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 19825-01 for + ; + Mon, 14 Aug 2006 20:38:07 -0300 (ADT) +X-Greylist: delayed 03:41:14.966933 by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by postgresql.org (Postfix) with ESMTP id AD3DD9FA231 + for ; + Mon, 14 Aug 2006 20:38:07 -0300 (ADT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Dell PowerEdge 2950 performance +Date: Mon, 14 Aug 2006 19:38:03 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D41049DB@MAIL.corp.lumeta.com> +In-Reply-To: <73726D4E-D336-4678-B1C1-B0AE4D2D7C1F@khera.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: Aca/6BSoubeH1essTG2W8Qsqr6hOVwAEMupg +From: "Bucky Jordan" +To: "Vivek Khera" , + "Pgsql-Performance \(\(E-mail\)\)" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/218 +X-Sequence-Number: 20403 + +... +Of more interest would be a test which involved large files with lots =20 +of seeks all around (something like bonnie++ should do that). +... + +Here's the bonnie++ numbers for the RAID 5 x 6 disks. I believe this was +with write-through and 64k striping. I plan to run a few others with +different block sizes and larger files- I'd be happy to send out a link +to the list when I get a chance to post them somewhere. I've also been +running some basic tests with pgbench just to help jumpstart customizing +postgresql.conf, so that might be of interest too. + +bash-2.05b$ bonnie++ -d bonnie -s 1000:8k +Version 1.93c ------Sequential Output------ --Sequential Input- +--Random- +Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 1000M 587 99 246900 71 225124 76 1000 99 585723 99 +8573 955 +Latency 14367us 50829us 410ms 57965us 1656us +432ms +Version 1.93c ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 28192 91 +++++ +++ +++++ +++ 26076 89 +++++ +++ ++++++ +++ +Latency 25988us 75us 37us 24756us 36us +41us +1.93c,1.93c, +,1,1155223901,1000M,,587,99,246900,71,225124,76,1000,99,585723,99,8573,9 +55,16,,,,,28192,91,+++++,+++,+++++,+++,26076,89,+++++,+++,+++++,+++,1436 +7us,50829us,410ms,57965us,1656us,432ms,25988us,75us,37us,24756us,36us,41 +us + +... +Thanks for sharing your numbers. +... + +You're welcome- I prefer to see actual numbers rather than people simply +stating that RAID controller X is better, so hopefully more people will +do the same. + +- Bucky + +From pgsql-performance-owner@postgresql.org Tue Aug 15 02:29:03 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A627D9FB30F + for ; + Tue, 15 Aug 2006 02:29:02 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 88790-01 for + ; + Tue, 15 Aug 2006 02:28:54 -0300 (ADT) +X-Greylist: delayed 00:05:11.040776 by SQLgrey- +Received: from exprod6og51.obsmtp.com (exprod6og51.obsmtp.com [64.18.1.183]) + by postgresql.org (Postfix) with SMTP id 9B1A79FA318 + for ; + Tue, 15 Aug 2006 02:28:53 -0300 (ADT) +Received: from source ([63.240.6.46]) by exprod6ob51.postini.com + ([64.18.5.12]) with SMTP; Mon, 14 Aug 2006 22:28:52 PDT +Received: from 172.16.1.110 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Tue, 15 Aug 2006 01:23:21 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP01.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 15 Aug + 2006 01:23:15 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Tue, 15 Aug + 2006 05:23:14 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Mon, 14 Aug 2006 22:23:13 -0700 +Subject: Re: Dell PowerEdge 2950 performance +From: "Luke Lonergan" +To: "Bucky Jordan" , "Vivek Khera" , + "Pgsql-Performance ((E-mail))" +Message-ID: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: Aca/6BSoubeH1essTG2W8Qsqr6hOVwAEMupgAAyBxX4= +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D41049DB@MAIL.corp.lumeta.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 15 Aug 2006 05:23:15.0995 (UTC) + FILETIME=[E92EB6B0:01C6C02A] +X-WSS-ID: 68FF85B22NG1230052-03-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.659 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/219 +X-Sequence-Number: 20404 + +Bucky, + +I see you are running bonnie++ version 1.93c. The numbers it reports are +very different from version 1.03a, which is the one everyone runs - can you +post your 1.03a numbers from bonnie++? + +- Luke + + +On 8/14/06 4:38 PM, "Bucky Jordan" wrote: + +> ... +> Of more interest would be a test which involved large files with lots +> of seeks all around (something like bonnie++ should do that). +> ... +> +> Here's the bonnie++ numbers for the RAID 5 x 6 disks. I believe this was +> with write-through and 64k striping. I plan to run a few others with +> different block sizes and larger files- I'd be happy to send out a link +> to the list when I get a chance to post them somewhere. I've also been +> running some basic tests with pgbench just to help jumpstart customizing +> postgresql.conf, so that might be of interest too. +> +> bash-2.05b$ bonnie++ -d bonnie -s 1000:8k +> Version 1.93c ------Sequential Output------ --Sequential Input- +> --Random- +> Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +> --Seeks-- +> Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +> /sec %CP +> 1000M 587 99 246900 71 225124 76 1000 99 585723 99 +> 8573 955 +> Latency 14367us 50829us 410ms 57965us 1656us +> 432ms +> Version 1.93c ------Sequential Create------ --------Random +> Create-------- +> -Create-- --Read--- -Delete-- -Create-- --Read--- +> -Delete-- +> files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +> /sec %CP +> 16 28192 91 +++++ +++ +++++ +++ 26076 89 +++++ +++ +> +++++ +++ +> Latency 25988us 75us 37us 24756us 36us +> 41us +> 1.93c,1.93c, +> ,1,1155223901,1000M,,587,99,246900,71,225124,76,1000,99,585723,99,8573,9 +> 55,16,,,,,28192,91,+++++,+++,+++++,+++,26076,89,+++++,+++,+++++,+++,1436 +> 7us,50829us,410ms,57965us,1656us,432ms,25988us,75us,37us,24756us,36us,41 +> us +> +> ... +> Thanks for sharing your numbers. +> ... +> +> You're welcome- I prefer to see actual numbers rather than people simply +> stating that RAID controller X is better, so hopefully more people will +> do the same. +> +> - Bucky +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: explain analyze is your friend +> + + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 10:56:43 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 0E5969FB2EA + for ; + Tue, 15 Aug 2006 10:56:42 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 75821-07 for + ; + Tue, 15 Aug 2006 10:56:35 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by postgresql.org (Postfix) with ESMTP id 96B6B9FB2DB + for ; + Tue, 15 Aug 2006 10:56:35 -0300 (ADT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Dell PowerEdge 2950 performance +Date: Tue, 15 Aug 2006 09:56:32 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D41049E5@MAIL.corp.lumeta.com> +In-Reply-To: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: Aca/6BSoubeH1essTG2W8Qsqr6hOVwAEMupgAAyBxX4AEWviAA== +From: "Bucky Jordan" +To: "Luke Lonergan" , + "Vivek Khera" , + "Pgsql-Performance \(\(E-mail\)\)" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/220 +X-Sequence-Number: 20405 + +... +I see you are running bonnie++ version 1.93c. The numbers it reports are +very different from version 1.03a, which is the one everyone runs - can +you +post your 1.03a numbers from bonnie++? +... + +Luke, + +Thanks for the pointer. Here's the 1.03 numbers, but at the moment I'm +only able to run them on the 6 disk RAID 5 setup (128k stripe, writeback +enabled since the Perc5 does have a battery backed cache).=20 + +bonnie++ -d bonnie -s 1000:8k +Version 1.03 ------Sequential Output------ --Sequential Input- +--Random- + -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 1000M 155274 95 265359 44 232958 52 166884 99 +1054455 99 +++++ +++ + ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 +++++ +++ +++++ +++ +++++ +++ 30550 88 +++++ +++ ++++++ +++ +,1000M,155274,95,265359,44,232958,52,166884,99,1054455,99,+++++,+++,16,+ +++++,+++,+++++,+++,+++++,+++,30550,88,+++++,+++,+++++,+++ + +- Bucky + +From pgsql-performance-owner@postgresql.org Tue Aug 15 11:45:10 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3652B9FB274 + for ; + Tue, 15 Aug 2006 11:45:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 91386-01 for + ; + Tue, 15 Aug 2006 14:44:57 +0000 (UTC) +X-Greylist: delayed 00:06:40.617611 by SQLgrey- +Received: from web36109.mail.mud.yahoo.com (web36109.mail.mud.yahoo.com + [66.163.179.223]) + by postgresql.org (Postfix) with SMTP id D83459FB269 + for ; + Tue, 15 Aug 2006 11:44:55 -0300 (ADT) +Received: (qmail 69496 invoked by uid 60001); 15 Aug 2006 14:38:12 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.ar; + h=Message-ID:Received:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=NODwgyH/fecdOv9unjRIxt+L2B/NWHRkCUDO3ydLhIni8SVcCJq28O5ed/DoceHBod4qt1Gfa4uQwK8zga99MxUiKBd4UMhv/TE3nyaUYgFy90118LmFPPAzblpbEiuem+71Et12uh6Jow31Jaoe/fF2jfng2sG2nDHunF1Gz88= + ; +Message-ID: <20060815143812.69494.qmail@web36109.mail.mud.yahoo.com> +Received: from [200.49.144.50] by web36109.mail.mud.yahoo.com via HTTP; + Tue, 15 Aug 2006 14:38:12 GMT +Date: Tue, 15 Aug 2006 14:38:12 +0000 (GMT) +From: =?iso-8859-1?q?Sebasti=E1n=20Baioni?= +Reply-To: sebaioni-postgresql@yahoo.com.ar +Subject: Inner Join of the same table +To: Performance PostgreSQL +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="0-455872028-1155652692=:68034" +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE, + UPPERCASE_25_50 +X-Spam-Level: +X-Archive-Number: 200608/221 +X-Sequence-Number: 20406 + +--0-455872028-1155652692=:68034 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + + Hello, I'm migrating from MS SQL Server to PostgreSQL 8.1 and I have a serious problem: +Table: APORTES - Rows: 9,000,000 (9 million) +*cuiT (char 11) +*cuiL (char 11) +*PERI (char 6) +FAMI (numeric 6) + +I need all the cuiLs whose max(PERI) are from a cuiT, and the Max(FAMI) of those cuiLs, so the sentence is: + +SELECT DISTINCT T.cuiT, T.cuiL. U.MAXPERI, U.MAXFAMI + FROM APORTES T + INNER JOIN + (SELECT cuiL, MAX(PERI) AS MAXPERI, + MAX(FAMI) AS MAXFAMI + FROM APORTES + GROUP BY cuiL) AS U + ON T.cuiL = U.cuiL AND T.PERI=U.MAXPERI +WHERE T.cuiT='12345678901' + +In MS SQL Server it lasts 1minute, in PostgreSQL for Windows it lasts 40minutes and in PostgreSQL for Linux (FreeBSD) it lasts 20minuts. + +Do you know if there is any way to tune the server or optimize this sentence? + +Thanks + Sebasti�n Baioni + + Sebasti�n Baioni + +--------------------------------- + Pregunt�. Respond�. Descubr�. + Todo lo que quer�as saber, y lo que ni imaginabas, + est� en Yahoo! Respuestas (Beta). + Probalo ya! +--0-455872028-1155652692=:68034 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit + + Hello, I'm migrating from MS SQL Server to PostgreSQL 8.1 and I have a serious problem:
Table: APORTES - Rows: 9,000,000 (9 million)
*cuiT (char 11)
*cuiL (char 11)
*PERI (char 6)
FAMI (numeric 6)

I need all the cuiLs whose max(PERI) are from a cuiT, and the Max(FAMI) of those cuiLs, so the sentence is:

SELECT DISTINCT T.cuiT, T.cuiL. U.MAXPERI, U.MAXFAMI
       FROM APORTES T
       INNER JOIN
       (SELECT cuiL, MAX(PERI) AS MAXPERI,
               MAX(FAMI) AS MAXFAMI

        FROM APORTES
        GROUP BY cuiL) AS U
       ON T.cuiL = U.cuiL AND T.PERI=U.MAXPERI
WHERE T.cuiT='12345678901'

In MS SQL Server it lasts 1minute, in PostgreSQL for Windows it lasts 40minutes and in PostgreSQL for Linux (FreeBSD) it lasts 20minuts.

Do you know if there is any way to tune the server or optimize this sentence?

Thanks
     Sebasti�n Baioni

+ + Instrumentos musicalesSebasti�n Baioni + + Ofertas n�uticas

+


+Pregunt�. Respond�. Descubr�.
+Todo lo que quer�as saber, y lo que ni imaginabas,
+est� en Yahoo! Respuestas (Beta).
+Probalo ya! +--0-455872028-1155652692=:68034-- + +From pgsql-performance-owner@postgresql.org Tue Aug 15 12:05:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D40009FB274 + for ; + Tue, 15 Aug 2006 12:05:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 82897-08 for + ; + Tue, 15 Aug 2006 15:05:32 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 9BEA59FB269 + for ; + Tue, 15 Aug 2006 12:05:32 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 160575644D; Tue, 15 Aug 2006 10:05:31 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 10:05:30 -0500 +Date: Tue, 15 Aug 2006 10:05:30 -0500 +From: "Jim C. Nasby" +To: Richard Huxton +Cc: Carl Youngblood , + pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +Message-ID: <20060815150529.GO27928@pervasive.com> +References: + <44DAFB2B.4070307@archonet.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44DAFB2B.4070307@archonet.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: 1:20:060815:dev@archonet.com::Bi1lfT/jWgMC5mUz:01T+m +X-Hashcash: + 1:20:060815:carl@youngbloods.org::sXUHiTUli47gX7wp:00000000000000000 + 0000000000000000000000005mwP +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::zgQsLc+HblCanYrY:00000 + 0000000000000000000000001Qg8 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/222 +X-Sequence-Number: 20407 + +On Thu, Aug 10, 2006 at 10:23:55AM +0100, Richard Huxton wrote: +> Carl Youngblood wrote: +> >- I noticed that there are six different postmaster daemons running. +> >Only one of them is taking up a lot of RAM (1076m virtual and 584m +> >resident). The second one is using 181m resident while the others are +> >less than 20m each. Is it normal to have multiple postmaster +> >processes? +> +> You should have one master backend process and one per connection. PG is +> a classic multi-process designed server. +> +> > Even the biggest process doesn't seem to be using near as +> >much RAM as I have on this machine. Is that bad? What percentage of +> >my physical memory should I expect postgres to use for itself? How +> >can I encourage it to cache more query results in memory? +> +> OK - one of the key things with PostgreSQL is that it relies on the O.S. +> to cache its disk files. So, allocating too much memory to PG can be +> counterproductive. +> +> From your figures, you're allocating about 64MB to work_mem, which is +> per sort. So, a complex query could use several times that amount. If +> you don't have many concurrent queries that might be what you want. +> +> Also, you've allocated 1GB to your shared_buffers which is more than I'd +> use as a starting point. + +See the recent thread about how old rules of thumb for shared_buffers +are now completely bunk. With 4G of memory, setting shared_buffers to 2G +could easily be reasonable. The OP really needs to test several +different values with their actual workload and see what works best. + +> You've only mentioned one main table with 100,000 rows, so presumably +> you're going to cache the entire DB in RAM. So, you'll want to increase +> effective_cache_size and reduce random_page_cost. +> +> -- +> Richard Huxton +> Archonet Ltd +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster +> + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 12:08:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3DF069FB269 + for ; + Tue, 15 Aug 2006 12:08:42 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 99117-04 for + ; + Tue, 15 Aug 2006 15:08:37 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 93ECD9FB274 + for ; + Tue, 15 Aug 2006 12:08:37 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id ED2E55644D; Tue, 15 Aug 2006 10:08:35 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 10:08:35 -0500 +Date: Tue, 15 Aug 2006 10:08:35 -0500 +From: "Jim C. Nasby" +To: Michal Taborsky - Internet Mall +Cc: pgsql-performance@postgresql.org +Subject: Re: 3-table query optimization +Message-ID: <20060815150834.GP27928@pervasive.com> +References: <44D9EBEB.9010704@mall.cz> <20367.1155136139@sss.pgh.pa.us> + <44DAE09B.20009@mall.cz> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44DAE09B.20009@mall.cz> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:michal.taborsky@mall.cz::akrq/qcyQshHxWRl:00000000000000 + 0000000000000000000000005C7s +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::JFlbl1lc/TuJsZUC:00000 + 0000000000000000000000003Fba +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/223 +X-Sequence-Number: 20408 + +On Thu, Aug 10, 2006 at 09:30:35AM +0200, Michal Taborsky - Internet Mall wrote: +> Tom Lane napsal(a): +> >Michal Taborsky - Internet Mall writes: +> >>SELECT product.product_id +> >> FROM action +> >> JOIN product ON (product.product_id=action.product_id) +> >> WHERE action.shop_group_id=1 +> >> AND EXISTS (SELECT 1 +> >> FROM catalog.product_program +> >> WHERE product_id=product.product_id +> >> AND product_program.program_id =1104322 +> >> ) +> > +> >Try converting the EXISTS subquery to an IN. +> +> The performance is roughly the same. For some groups it's better, for +> some groups, the bigger ones, it's a bit worse. I forgot to mention, +> that the server is running 8.0.2. Upgrading would be a bit painful, as +> it is a 24/7 production system, but if it would help significantly, we'd +> give it a go. + +You're exposing yourself to at least one data-loss bug and a security +hole by running 8.0.2. You should at least move to 8.0.8, which won't +require a lot of downtime. + +If you can make it happen, moving to 8.1.4 would almost certainly net a +noticable performance gain. I've seen 50-100% improvements, but how much +gain you'll actually see is highly workload dependent. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 12:10:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 76D4C9FB274 + for ; + Tue, 15 Aug 2006 12:10:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 40760-07 for + ; + Tue, 15 Aug 2006 12:10:07 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) + by postgresql.org (Postfix) with ESMTP id 3DBCC9FB269 + for ; + Tue, 15 Aug 2006 12:10:07 -0300 (ADT) +Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP + with MS-WebStorage 6.0.6249 +Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; + 15 Aug 2006 08:10:05 -0700 +Subject: Re: Inner Join of the same table +From: Mark Lewis +To: sebaioni-postgresql@yahoo.com.ar +Cc: Performance PostgreSQL +In-Reply-To: <20060815143812.69494.qmail@web36109.mail.mud.yahoo.com> +References: <20060815143812.69494.qmail@web36109.mail.mud.yahoo.com> +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +Organization: MIR3, Inc. +Date: Tue, 15 Aug 2006 08:10:05 -0700 +Message-Id: <1155654605.16967.90.camel@archimedes> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.2 (2.0.2-27) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.417 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY, UPPERCASE_25_50 +X-Spam-Level: +X-Archive-Number: 200608/224 +X-Sequence-Number: 20409 + +Can you provide an EXPLAIN ANALYZE of the query in PG? Have you +analyzed the PG database? How many rows is this query expected to +return? Which version of PG are you running? What indexes have you +defined? + +-- Mark + +On Tue, 2006-08-15 at 14:38 +0000, Sebasti=C3=A1n Baioni wrote: +> Hello, I'm migrating from MS SQL Server to PostgreSQL 8.1 and I have a +> serious problem: +> Table: APORTES - Rows: 9,000,000 (9 million) +> *cuiT (char 11) +> *cuiL (char 11) +> *PERI (char 6) +> FAMI (numeric 6) +>=20 +> I need all the cuiLs whose max(PERI) are from a cuiT, and the Max +> (FAMI) of those cuiLs, so the sentence is: +>=20 +> SELECT DISTINCT T.cuiT, T.cuiL. U.MAXPERI, U.MAXFAMI +> FROM APORTES T +> INNER JOIN +> (SELECT cuiL, MAX(PERI) AS MAXPERI, +> MAX(FAMI) AS MAXFAMI +> FROM APORTES +> GROUP BY cuiL) AS U +> ON T.cuiL =3D U.cuiL AND T.PERI=3DU.MAXPERI +> WHERE T.cuiT=3D'12345678901' +>=20 +> In MS SQL Server it lasts 1minute, in PostgreSQL for Windows it lasts +> 40minutes and in PostgreSQL for Linux (FreeBSD) it lasts 20minuts. +>=20 +> Do you know if there is any way to tune the server or optimize this +> sentence? +>=20 +> Thanks +> Sebasti=C3=A1n Baioni +>=20 +> Instrumentos musicalesSebasti=C3=A1n Baioni Ofertas n=C3=A1uticas +>=20 +>=20 +> ______________________________________________________________________ +> Pregunt=C3=A1. Respond=C3=A9. Descubr=C3=AD. +> Todo lo que quer=C3=ADas saber, y lo que ni imaginabas, +> est=C3=A1 en Yahoo! Respuestas (Beta). +> Probalo ya!=20 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 12:43:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5059E9FB2AD + for ; + Tue, 15 Aug 2006 12:43:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 51338-09 for + ; + Tue, 15 Aug 2006 12:43:32 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from web36108.mail.mud.yahoo.com (web36108.mail.mud.yahoo.com + [66.163.179.222]) + by postgresql.org (Postfix) with SMTP id 2403D9FB2C2 + for ; + Tue, 15 Aug 2006 12:43:31 -0300 (ADT) +Received: (qmail 12248 invoked by uid 60001); 15 Aug 2006 15:43:29 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.ar; + h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=WduBblIciZ/Af4kThVP0oXYRhfY9PZBbcgEax/DanjU92aSL5remILrjmyO48Nv734hLJNMwXsL55M7pQCe4rZsNp5QMINq7/3fALrYht9J4ctabFzkzEqjW/7/uThg2w1F4q1+u28jfLsnUEdl4kvmBbMh7uHFB4KgUjgQ/ASs= + ; +Message-ID: <20060815154329.12246.qmail@web36108.mail.mud.yahoo.com> +Received: from [200.49.144.50] by web36108.mail.mud.yahoo.com via HTTP; + Tue, 15 Aug 2006 15:43:29 GMT +Date: Tue, 15 Aug 2006 15:43:29 +0000 (GMT) +From: =?iso-8859-1?q?Sebasti=E1n=20Baioni?= +Reply-To: sebaioni-postgresql@yahoo.com.ar +Subject: Re: Inner Join of the same table +To: Performance PostgreSQL +In-Reply-To: <1155654605.16967.90.camel@archimedes> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/225 +X-Sequence-Number: 20410 + +Hi Nark, thanks for your answer. + +It's expected to return 1,720 rows (of 80,471 that match with condition WHERE +T.cuiT='12345678901') + +We have indexes by : +uesapt000: cuiT, cuiL, PERI; +uesapt001: cuiL, PERI; +uesapt002: cuiT, PERI; + +We usually make a vacuum analyze and reindex of every table, and we are running 8.0 and 8.1 for +windows and 7.4 for Linux. + +Here is the EXPLAIN: +QUERY PLAN + 1 Unique (cost=37478647.41..37478650.53 rows=312 width=62) + 2 -> Sort (cost=37478647.41..37478648.19 rows=312 width=62) + 3 Sort Key: t.cuiT, t.cuiL, u.maxperi + 4 -> Merge Join (cost=128944.78..37478634.48 rows=312 width=62) + 5 Merge Cond: ("outer".cuiL = "inner".cuiL) + 6 Join Filter: (("inner".PERI)::text = "outer".maxperi) + 7 -> Subquery Scan u (cost=0.00..37348434.56 rows=3951 width=47) + 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) + 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 +rows=9339331 width=25) +10 -> Sort (cost=128944.78..129100.44 rows=62263 width=40) +11 Sort Key: t.cuiL +12 -> Index Scan using uesapt002 on APORTES t (cost=0.00..122643.90 +rows=62263 width=40) +13 Index Cond: (cuiT = '30701965554'::bpchar) + +Thanks + Sebasti�n Baioni + + --- Mark Lewis escribi�: + +> Can you provide an EXPLAIN ANALYZE of the query in PG? Have you +> analyzed the PG database? How many rows is this query expected to +> return? Which version of PG are you running? What indexes have you +> defined? +> +> -- Mark +> +> On Tue, 2006-08-15 at 14:38 +0000, Sebasti�n Baioni wrote: +> > Hello, I'm migrating from MS SQL Server to PostgreSQL 8.1 and I have a +> > serious problem: +> > Table: APORTES - Rows: 9,000,000 (9 million) +> > *cuiT (char 11) +> > *cuiL (char 11) +> > *PERI (char 6) +> > FAMI (numeric 6) +> > +> > I need all the cuiLs whose max(PERI) are from a cuiT, and the Max +> > (FAMI) of those cuiLs, so the sentence is: +> > +> > SELECT DISTINCT T.cuiT, T.cuiL. U.MAXPERI, U.MAXFAMI +> > FROM APORTES T +> > INNER JOIN +> > (SELECT cuiL, MAX(PERI) AS MAXPERI, +> > MAX(FAMI) AS MAXFAMI +> > FROM APORTES +> > GROUP BY cuiL) AS U +> > ON T.cuiL = U.cuiL AND T.PERI=U.MAXPERI +> > WHERE T.cuiT='12345678901' +> > +> > In MS SQL Server it lasts 1minute, in PostgreSQL for Windows it lasts +> > 40minutes and in PostgreSQL for Linux (FreeBSD) it lasts 20minuts. +> > +> > Do you know if there is any way to tune the server or optimize this +> > sentence? +> > +> > Thanks +> > Sebasti�n Baioni + + + + + +__________________________________________________ +Pregunt�. Respond�. Descubr�. +Todo lo que quer�as saber, y lo que ni imaginabas, +est� en Yahoo! Respuestas (Beta). +�Probalo ya! +http://www.yahoo.com.ar/respuestas + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 13:01:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id AD73A9FB2C3 + for ; + Tue, 15 Aug 2006 13:01:52 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 40678-08 for + ; + Tue, 15 Aug 2006 16:01:47 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 8D2C99FB2C2 + for ; + Tue, 15 Aug 2006 13:01:45 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id E977856437; Tue, 15 Aug 2006 11:01:25 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 11:01:24 -0500 +Date: Tue, 15 Aug 2006 11:01:24 -0500 +From: "Jim C. Nasby" +To: Sue Fitt +Cc: Chris , pgsql-performance@postgresql.org +Subject: Re: setting up foreign keys +Message-ID: <20060815160124.GQ27928@pervasive.com> +References: <44DAE8CF.1030107@inf.ed.ac.uk> <44DAEB04.9050306@gmail.com> + <44DAF6B7.1090800@inf.ed.ac.uk> <44DAF8B9.2080000@gmail.com> + <44DAFA6D.4070606@inf.ed.ac.uk> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44DAFA6D.4070606@inf.ed.ac.uk> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: 1:20:060815:sue@inf.ed.ac.uk::5MJ1Ps267INMZO/T:04OZ5 +X-Hashcash: + 1:20:060815:dmagick@gmail.com::FphwRLl5Ch5F9cpU:00000000000000000000 + 0000000000000000000000002egA +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::4qHqwGGSfpyrEqpZ:00000 + 0000000000000000000000003X5x +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/226 +X-Sequence-Number: 20411 + +On Thu, Aug 10, 2006 at 10:20:45AM +0100, Sue Fitt wrote: +> Well they don't necessarily have the same value! +> +> It's a dictionary with cross-referenced words, e.g. 'bring' and +> 'brought' are both headwords in the dictionary, but 'brought' is +> cross-referenced to 'bring'. So, the table stores the information (using +> integer id's rather than words) that +> bring: bring +> brought: see bring +> sing: sing +> sang: see sing +> etc. + +If that's actually how it's represented (a row for both sing and song) +it's denormalized. My rule of thumb is "normalize 'til it hurts, +denormalize 'til it works", meaning only denormalize if you need to for +performance reasons. In this case, it's certainly possible that +performance-wise you're best off denormalized, but you might want to +experiment and find out. + +BTW, the normalized way to store this info would be to only put records +in that table for brought and song. + +> Sue +> +> Chris wrote: +> >Sue Fitt wrote: +> >>Thanks Chris and Chris, you've solved it. +> >> +> >>I had a gui open that connects to the database. It was doing nothing +> >>(and not preventing me adding to or altering headwords_core via +> >>psql), but having closed it the table is instantly created. Weird. +> >> +> >>BTW, referencing the same column twice is deliberate, it's a +> >>cross-reference. +> > +> >The same column and the same table? +> > +> >Same column different table I could understand but not the same column +> >& table ;) +> > +> >I'm sure there's a reason for it though :) +> > +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: explain analyze is your friend +> + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 13:25:32 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id BFC0D9FB2F0 + for ; + Tue, 15 Aug 2006 13:25:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 82996-05 for + ; + Tue, 15 Aug 2006 16:25:26 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 461209FB2DC + for ; + Tue, 15 Aug 2006 13:25:26 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id AA09D56442; Tue, 15 Aug 2006 11:25:24 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 11:25:24 -0500 +Date: Tue, 15 Aug 2006 11:25:24 -0500 +From: "Jim C. Nasby" +To: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815162524.GR27928@pervasive.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <20060814170338.GM2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060814170338.GM2900@mathom.us> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::i+im3mr106dlrXYx:00000 + 0000000000000000000000001LXr +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/227 +X-Sequence-Number: 20412 + +On Mon, Aug 14, 2006 at 01:03:41PM -0400, Michael Stone wrote: +> On Mon, Aug 14, 2006 at 10:38:41AM -0500, Jim C. Nasby wrote: +> >Got any data to back that up? +> +> yes. that I'm willing to dig out? no. :) + +Well, I'm not digging hard numbers out either, so that's fair. :) But it +would be very handy if people posted results from any testing they're +doing as part of setting up new hardware. Actually, a wiki would +probably be ideal for this... + +> >The problem with seperate partitions is that it means more head movement +> >for the drives. If it's all one partition the pg_xlog data will tend to +> >be interspersed with the heap data, meaning less need for head +> >repositioning. +> +> The pg_xlog files will tend to be created up at the front of the disk +> and just sit there. Any affect the positioning has one way or the other +> isn't going to be measurable/repeatable. With a write cache for pg_xlog +> the positioning isn't really going to matter anyway, since you don't +> have to wait for a seek to do the write. + +Certainly... my contention is that if you have a good controller that's +caching writes then drive layout basically won't matter at all, because +the controller will just magically make things optimal. + +> From what I've observed in testing, I'd guess that the issue is that +> certain filesystem operations (including, possibly, metadata operations) +> are handled in order. If you have xlog on a seperate partition there +> will never be anything competing with a log write on the server side, +> which won't necessarily be true on a shared filesystem. Even if you have +> a battery backed write cache, you might still have to wait a relatively +> long time for the pg_xlog data to be written out if there's already a +> lot of other stuff in a filesystem write queue. + +Well, if the controller is caching with a BBU, I'm not sure that order +matters anymore, because the controller should be able to re-order at +will. Theoretically. :) But this is why having some actual data posted +somewhere would be great. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 13:29:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id CCAA59FB270 + for ; + Tue, 15 Aug 2006 13:29:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 84594-06 for + ; + Tue, 15 Aug 2006 16:29:28 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 9A9999FB32B + for ; + Tue, 15 Aug 2006 13:29:28 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 3332056442; Tue, 15 Aug 2006 11:29:27 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 11:29:26 -0500 +Date: Tue, 15 Aug 2006 11:29:26 -0500 +From: "Jim C. Nasby" +To: Steve Poe , pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815162926.GS27928@pervasive.com> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060814170902.GN2900@mathom.us> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:steve.poe@gmail.com::05N9DhK3PH4EZYdQ:000000000000000000 + 0000000000000000000000001cv2 +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::jMO0q0PeHiGRj5q8:00000 + 0000000000000000000000005AdQ +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/228 +X-Sequence-Number: 20413 + +On Mon, Aug 14, 2006 at 01:09:04PM -0400, Michael Stone wrote: +> On Mon, Aug 14, 2006 at 12:05:46PM -0500, Jim C. Nasby wrote: +> >Wow, interesting. IIRC, XFS is lower performing than ext3, +> +> For xlog, maybe. For data, no. Both are definately slower than ext2 for +> xlog, which is another reason to have xlog on a small filesystem which +> doesn't need metadata journalling. + +Are 'we' sure that such a setup can't lose any data? I'm worried about +files getting lost when they get written out before the metadata does. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 13:56:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ED7DC9FB270 + for ; + Tue, 15 Aug 2006 13:56:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 20108-06 for + ; + Tue, 15 Aug 2006 13:56:04 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 0C2D09FB1F1 + for ; + Tue, 15 Aug 2006 13:56:04 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 3D1BA56441; Tue, 15 Aug 2006 11:56:03 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 11:56:03 -0500 +Date: Tue, 15 Aug 2006 11:56:02 -0500 +From: "Jim C. Nasby" +To: Sebasti?n Baioni +Cc: Performance PostgreSQL +Subject: Re: Inner Join of the same table +Message-ID: <20060815165602.GT27928@pervasive.com> +References: <1155654605.16967.90.camel@archimedes> + <20060815154329.12246.qmail@web36108.mail.mud.yahoo.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815154329.12246.qmail@web36108.mail.mud.yahoo.com> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:sebaioni-postgresql@yahoo.com.ar::dvCffIGA4ddpHcX+:00000 + 0000000000000000000000000Zdv +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::NuXgDgJEUT1jDeQs:00000 + 0000000000000000000000002G4l +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.111 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/229 +X-Sequence-Number: 20414 + +On Tue, Aug 15, 2006 at 03:43:29PM +0000, Sebasti?n Baioni wrote: +> Hi Nark, thanks for your answer. +> +> It's expected to return 1,720 rows (of 80,471 that match with condition WHERE +> T.cuiT='12345678901') +> +> We have indexes by : +> uesapt000: cuiT, cuiL, PERI; +> uesapt001: cuiL, PERI; +> uesapt002: cuiT, PERI; +> +> We usually make a vacuum analyze and reindex of every table, and we are running 8.0 and 8.1 for +> windows and 7.4 for Linux. +> +> Here is the EXPLAIN: +> QUERY PLAN +> 1 Unique (cost=37478647.41..37478650.53 rows=312 width=62) +> 2 -> Sort (cost=37478647.41..37478648.19 rows=312 width=62) +> 3 Sort Key: t.cuiT, t.cuiL, u.maxperi +> 4 -> Merge Join (cost=128944.78..37478634.48 rows=312 width=62) +> 5 Merge Cond: ("outer".cuiL = "inner".cuiL) +> 6 Join Filter: (("inner".PERI)::text = "outer".maxperi) +> 7 -> Subquery Scan u (cost=0.00..37348434.56 rows=3951 width=47) +> 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) +> 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 +> rows=9339331 width=25) +> 10 -> Sort (cost=128944.78..129100.44 rows=62263 width=40) +> 11 Sort Key: t.cuiL +> 12 -> Index Scan using uesapt002 on APORTES t (cost=0.00..122643.90 +> rows=62263 width=40) +> 13 Index Cond: (cuiT = '30701965554'::bpchar) + +That's EXPLAIN, not EXPLAIN ANALYZE, which doesn't help us much. Best +bet would be an EXPLAIN ANALYZE from 8.1.x. It would also be useful to +know how MSSQL is executing this query. + +If it would serve your purposes, copying the WHERE clause into the +subquery would really help things. I think it might also mean you could +combine everything into one query. + +> Thanks +> Sebasti?n Baioni +> +> --- Mark Lewis escribi?: +> +> > Can you provide an EXPLAIN ANALYZE of the query in PG? Have you +> > analyzed the PG database? How many rows is this query expected to +> > return? Which version of PG are you running? What indexes have you +> > defined? +> > +> > -- Mark +> > +> > On Tue, 2006-08-15 at 14:38 +0000, Sebasti?n Baioni wrote: +> > > Hello, I'm migrating from MS SQL Server to PostgreSQL 8.1 and I have a +> > > serious problem: +> > > Table: APORTES - Rows: 9,000,000 (9 million) +> > > *cuiT (char 11) +> > > *cuiL (char 11) +> > > *PERI (char 6) +> > > FAMI (numeric 6) +> > > +> > > I need all the cuiLs whose max(PERI) are from a cuiT, and the Max +> > > (FAMI) of those cuiLs, so the sentence is: +> > > +> > > SELECT DISTINCT T.cuiT, T.cuiL. U.MAXPERI, U.MAXFAMI +> > > FROM APORTES T +> > > INNER JOIN +> > > (SELECT cuiL, MAX(PERI) AS MAXPERI, +> > > MAX(FAMI) AS MAXFAMI +> > > FROM APORTES +> > > GROUP BY cuiL) AS U +> > > ON T.cuiL = U.cuiL AND T.PERI=U.MAXPERI +> > > WHERE T.cuiT='12345678901' +> > > +> > > In MS SQL Server it lasts 1minute, in PostgreSQL for Windows it lasts +> > > 40minutes and in PostgreSQL for Linux (FreeBSD) it lasts 20minuts. +> > > +> > > Do you know if there is any way to tune the server or optimize this +> > > sentence? +> > > +> > > Thanks +> > > Sebasti?n Baioni +> +> +> +> +> +> __________________________________________________ +> Pregunt?. Respond?. Descubr?. +> Todo lo que quer?as saber, y lo que ni imaginabas, +> est? en Yahoo! Respuestas (Beta). +> ?Probalo ya! +> http://www.yahoo.com.ar/respuestas +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 14:25:50 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D2F4F9FB274 + for ; + Tue, 15 Aug 2006 14:25:49 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 55297-04 for + ; + Tue, 15 Aug 2006 14:25:38 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) + by postgresql.org (Postfix) with ESMTP id 812C79FB1FB + for ; + Tue, 15 Aug 2006 14:25:39 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J4100HGPV2CY2O1@vms048.mailsrvcs.net> for + pgsql-performance@postgresql.org; Tue, 15 Aug 2006 12:25:25 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id 529C96FBD1; Tue, + 15 Aug 2006 13:25:22 -0400 (EDT) +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 2VvsESnmFF+U; Tue, 15 Aug 2006 13:25:21 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 55A3D6FC68; Tue, 15 Aug 2006 13:25:21 -0400 (EDT) +Date: Tue, 15 Aug 2006 13:25:21 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815162524.GR27928@pervasive.com> +To: "Jim C. Nasby" +Cc: pgsql-performance@postgresql.org +Mail-followup-to: "Jim C. Nasby" , + pgsql-performance@postgresql.org +Message-id: <20060815172519.GT2900@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: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <20060814170338.GM2900@mathom.us> + <20060815162524.GR27928@pervasive.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.796 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/230 +X-Sequence-Number: 20415 + +On Tue, Aug 15, 2006 at 11:25:24AM -0500, Jim C. Nasby wrote: +>Well, if the controller is caching with a BBU, I'm not sure that order +>matters anymore, because the controller should be able to re-order at +>will. Theoretically. :) But this is why having some actual data posted +>somewhere would be great. + +You're missing the point. It's not a question of what happens once it +gets to the disk/controller, it's a question of whether the xlog write +has to compete with some other write activity before the write gets to +the disk (e.g., at the filesystem level). If you've got a bunch of stuff +in a write buffer on the OS level and you try to push the xlog write +out, you may have to wait for the other stuff to get to the controller +write cache before the xlog does. It doesn't matter if you don't have to +wait for the write to get from the controller cache to the disk if you +already had to wait to get to the controller cache. The effect is a +*lot* smaller than not having a non-volatile cache, but it is an +improvement. (Also, the difference between ext2 and xfs for the xlog is +pretty big itself, and a good reason all by itself to put xlog on a +seperate partition that's small enough to not need journalling.) + +Mike Stone + +From pgsql-performance-owner@postgresql.org Tue Aug 15 14:27:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D135F9FB1FB + for ; + Tue, 15 Aug 2006 14:27:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 76531-02 for + ; + Tue, 15 Aug 2006 14:27:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) + by postgresql.org (Postfix) with ESMTP id 090069FB270 + for ; + Tue, 15 Aug 2006 14:27:14 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J4100DQEV4PZ5F0@vms046.mailsrvcs.net> for + pgsql-performance@postgresql.org; Tue, 15 Aug 2006 12:26:50 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id 61BE56FBD1; Tue, + 15 Aug 2006 13:26:49 -0400 (EDT) +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 m9iPmXkCeR0N; Tue, 15 Aug 2006 13:26:47 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 472AA6FC68; Tue, 15 Aug 2006 13:26:47 -0400 (EDT) +Date: Tue, 15 Aug 2006 13:26:46 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815162926.GS27928@pervasive.com> +To: "Jim C. Nasby" +Cc: pgsql-performance@postgresql.org +Mail-followup-to: "Jim C. Nasby" , + pgsql-performance@postgresql.org +Message-id: <20060815172645.GU2900@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: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.759 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/231 +X-Sequence-Number: 20416 + +On Tue, Aug 15, 2006 at 11:29:26AM -0500, Jim C. Nasby wrote: +>Are 'we' sure that such a setup can't lose any data? + +Yes. If you check the archives, you can even find the last time this was +discussed... + +The bottom line is that the only reason you need a metadata journalling +filesystem is to save the fsck time when you come up. On a little +partition like xlog, that's not an issue. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Tue Aug 15 15:32:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id BE36A9FB1FB + for ; + Tue, 15 Aug 2006 15:32:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 66221-06 for + ; + Tue, 15 Aug 2006 18:31:53 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id EA2719FB1F1 + for ; + Tue, 15 Aug 2006 15:31:50 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id 4C49E7F0C9; + Tue, 15 Aug 2006 14:31:48 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id C+XBlYOBNK+f; Tue, 15 Aug 2006 14:31:48 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 122327F0E9; Tue, 15 Aug 2006 14:31:48 -0400 (EDT) +Date: Tue, 15 Aug 2006 14:31:48 -0400 +From: mark@mark.mielke.cc +To: "Jim C. Nasby" +Cc: Steve Poe , pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815183147.GB12834@mark.mielke.cc> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815162926.GS27928@pervasive.com> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.094 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/232 +X-Sequence-Number: 20417 + +On Tue, Aug 15, 2006 at 11:29:26AM -0500, Jim C. Nasby wrote: +> On Mon, Aug 14, 2006 at 01:09:04PM -0400, Michael Stone wrote: +> > On Mon, Aug 14, 2006 at 12:05:46PM -0500, Jim C. Nasby wrote: +> > >Wow, interesting. IIRC, XFS is lower performing than ext3, +> > For xlog, maybe. For data, no. Both are definately slower than ext2 for +> > xlog, which is another reason to have xlog on a small filesystem which +> > doesn't need metadata journalling. +> Are 'we' sure that such a setup can't lose any data? I'm worried about +> files getting lost when they get written out before the metadata does. + +I've been worrying about this myself, and my current conclusion is that +ext2 is bad because: a) fsck, and b) data can be lost or corrupted, which +could lead to the need to trash the xlog. + +Even ext3 in writeback mode allows for the indirect blocks to be updated +without the data underneath, allowing for blocks to point to random data, +or worse, previous apparently sane data (especially if the data is from +a drive only used for xlog - the chance is high that a block might look +partially valid?). + +So, I'm sticking with ext3 in ordered mode. + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 15:33:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 262359FB1F1 + for ; + Tue, 15 Aug 2006 15:33:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 09115-05 for + ; + Tue, 15 Aug 2006 15:33:28 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id 58F969FB28C + for ; + Tue, 15 Aug 2006 15:33:29 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id 5D3207F0C9; + Tue, 15 Aug 2006 14:33:27 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id w89oSpCT1-Ci; Tue, 15 Aug 2006 14:33:27 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 37C147F0E9; Tue, 15 Aug 2006 14:33:27 -0400 (EDT) +Date: Tue, 15 Aug 2006 14:33:27 -0400 +From: mark@mark.mielke.cc +To: "Jim C. Nasby" , pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815183327.GC12834@mark.mielke.cc> +References: <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815172645.GU2900@mathom.us> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.216 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/233 +X-Sequence-Number: 20418 + +On Tue, Aug 15, 2006 at 01:26:46PM -0400, Michael Stone wrote: +> On Tue, Aug 15, 2006 at 11:29:26AM -0500, Jim C. Nasby wrote: +> >Are 'we' sure that such a setup can't lose any data? +> Yes. If you check the archives, you can even find the last time this was +> discussed... + +I looked last night (coincidence actually) and didn't find proof that +you cannot lose data. + +How do you deal with the file system structure being updated before the +data blocks are (re-)written? + +I don't think you can. + +> The bottom line is that the only reason you need a metadata journalling +> filesystem is to save the fsck time when you come up. On a little +> partition like xlog, that's not an issue. + +fsck isn't only about time to fix. fsck is needed, because the file system +is broken. If the file system is broken, how can you guarantee data has +not been corrupted? + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 15:48:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 140809FB1FB + for ; + Tue, 15 Aug 2006 15:48:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 96480-03 for + ; + Tue, 15 Aug 2006 18:47:57 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.185]) + by postgresql.org (Postfix) with ESMTP id DE44E9FB1F1 + for ; + Tue, 15 Aug 2006 15:47:56 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id a4so362552nfc + for ; + Tue, 15 Aug 2006 11:47:54 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; + b=jTf59iaZvXt9Oa9AAGMoLAka9BrEEvh0njGNT7fkWKg9RzCZtHjr1S5kWhiFciZTDX4NebnpGLpRiujQeQrckhNusX+weVF8zwf/NTsx8/qGjBvBbQLL5kcrXWx8hdmZsXotL8xjYKVnUCB+qAtH1264rRUVs2X7zn3fXyJEBXg= +Received: by 10.49.10.3 with SMTP id n3mr1739050nfi; + Tue, 15 Aug 2006 11:47:54 -0700 (PDT) +Received: by 10.78.158.10 with HTTP; Tue, 15 Aug 2006 11:47:54 -0700 (PDT) +Message-ID: +Date: Tue, 15 Aug 2006 12:47:54 -0600 +From: "Carl Youngblood" +To: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +In-Reply-To: <20060815150529.GO27928@pervasive.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: + <44DAFB2B.4070307@archonet.com> <20060815150529.GO27928@pervasive.com> +X-Google-Sender-Auth: ce1c22cfba6dc955 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/234 +X-Sequence-Number: 20419 + +I tried setting it to 2GB and postgres wouldn't start. Didn't +investigate in much greater detail as to why it wouldn't start, but +after switching it back to 1GB it started fine. + +On 8/15/06, Jim C. Nasby wrote: +> See the recent thread about how old rules of thumb for shared_buffers +> are now completely bunk. With 4G of memory, setting shared_buffers to 2G +> could easily be reasonable. The OP really needs to test several +> different values with their actual workload and see what works best. + +From pgsql-performance-owner@postgresql.org Tue Aug 15 15:49:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A06E69FB256 + for ; + Tue, 15 Aug 2006 15:49:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 00410-02 for + ; + Tue, 15 Aug 2006 18:49:08 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.186]) + by postgresql.org (Postfix) with ESMTP id B1B489FB1F1 + for ; + Tue, 15 Aug 2006 15:49:07 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id a4so362844nfc + for ; + Tue, 15 Aug 2006 11:49:05 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; + b=UI8Pk1oXSLmBactpHF9fMph/InKXVdSH4TzMHvpqShchpd76ifx26ITwTM6VI8b5qLVmWjNunsE8gNkKoA+KHTeAzDBizfoS1nxhFrP9t4b5Phnnwgiq48UE29GiOi9ywMH/g0oraxqvCvt8Eu0yRgNNaEG6GaX+amCIOXOnmCE= +Received: by 10.49.43.11 with SMTP id v11mr1731116nfj; + Tue, 15 Aug 2006 11:49:04 -0700 (PDT) +Received: by 10.78.158.10 with HTTP; Tue, 15 Aug 2006 11:49:04 -0700 (PDT) +Message-ID: +Date: Tue, 15 Aug 2006 12:49:04 -0600 +From: "Carl Youngblood" +To: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +In-Reply-To: <20060815150529.GO27928@pervasive.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: + <44DAFB2B.4070307@archonet.com> <20060815150529.GO27928@pervasive.com> +X-Google-Sender-Auth: a7211216ba4ebfa2 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/235 +X-Sequence-Number: 20420 + +By the way, can you please post a link to that thread? + +On 8/15/06, Jim C. Nasby wrote: +> See the recent thread about how old rules of thumb for shared_buffers +> are now completely bunk. With 4G of memory, setting shared_buffers to 2G +> could easily be reasonable. The OP really needs to test several +> different values with their actual workload and see what works best. + +From pgsql-performance-owner@postgresql.org Tue Aug 15 15:51:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 83E0E9FB256 + for ; + Tue, 15 Aug 2006 15:51:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 00186-02 for + ; + Tue, 15 Aug 2006 18:51:38 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exprod6og50.obsmtp.com (exprod6og50.obsmtp.com [64.18.1.181]) + by postgresql.org (Postfix) with SMTP id 981B69FB1FB + for ; + Tue, 15 Aug 2006 15:51:36 -0300 (ADT) +Received: from source ([63.240.6.44]) by exprod6ob50.postini.com + ([64.18.5.12]) with SMTP; Tue, 15 Aug 2006 11:51:26 PDT +Received: from 172.16.1.148 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D4)); Tue, 15 Aug 2006 14:50:32 -0400 +X-Server-Uuid: C8FB4D43-1108-484A-A898-3CBCC7906230 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 15 Aug + 2006 14:50:06 -0400 +Received: from 63.80.24.130 ([63.80.24.130]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.134]) with Microsoft Exchange Server HTTP-DAV ; Tue, 15 Aug + 2006 18:50:04 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Tue, 15 Aug 2006 11:50:02 -0700 +Subject: Re: Dell PowerEdge 2950 performance +From: "Luke Lonergan" +To: "Bucky Jordan" , "Vivek Khera" , + "Pgsql-Performance ((E-mail))" +Message-ID: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: Aca/6BSoubeH1essTG2W8Qsqr6hOVwAEMupgAAyBxX4AEWviAAAKwZ/n +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D41049E5@MAIL.corp.lumeta.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 15 Aug 2006 18:50:06.0235 (UTC) + FILETIME=[9FEF1EB0:01C6C09B] +X-WSS-ID: 68FCC8FD3FW1571275-03-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.5 tagged_above=0 required=5 tests=RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/236 +X-Sequence-Number: 20421 + +Bucky, + +I don't know why I missed this the first time - you need to let bonnie++ +pick the file size - it needs to be 2x memory or the results you get will +not be accurate. + +In this case you've got a 1GB file, which nicely fits in RAM. + +- Luke + + +On 8/15/06 6:56 AM, "Bucky Jordan" wrote: + +> ... +> I see you are running bonnie++ version 1.93c. The numbers it reports are +> very different from version 1.03a, which is the one everyone runs - can +> you +> post your 1.03a numbers from bonnie++? +> ... +> +> Luke, +> +> Thanks for the pointer. Here's the 1.03 numbers, but at the moment I'm +> only able to run them on the 6 disk RAID 5 setup (128k stripe, writeback +> enabled since the Perc5 does have a battery backed cache). +> +> bonnie++ -d bonnie -s 1000:8k +> Version 1.03 ------Sequential Output------ --Sequential Input- +> --Random- +> -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +> --Seeks-- +> Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +> /sec %CP +> 1000M 155274 95 265359 44 232958 52 166884 99 +> 1054455 99 +++++ +++ +> ------Sequential Create------ --------Random +> Create-------- +> -Create-- --Read--- -Delete-- -Create-- --Read--- +> -Delete-- +> files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +> /sec %CP +> 16 +++++ +++ +++++ +++ +++++ +++ 30550 88 +++++ +++ +> +++++ +++ +> ,1000M,155274,95,265359,44,232958,52,166884,99,1054455,99,+++++,+++,16,+ +> ++++,+++,+++++,+++,+++++,+++,30550,88,+++++,+++,+++++,+++ +> +> - Bucky +> + + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 15:53:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2B71C9FB1F1 + for ; + Tue, 15 Aug 2006 15:53:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 44731-01 for + ; + Tue, 15 Aug 2006 15:53:36 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from web36114.mail.mud.yahoo.com (web36114.mail.mud.yahoo.com + [66.163.179.228]) + by postgresql.org (Postfix) with SMTP id 3E10A9FB1FB + for ; + Tue, 15 Aug 2006 15:53:37 -0300 (ADT) +Received: (qmail 14229 invoked by uid 60001); 15 Aug 2006 18:53:35 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.ar; + h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=I9gNtcaYOxP+PXg7ueOYnFOX3nRKDcInNoccBi1KbxzApxCjA8f3y6sMYF3k4iLlG7s3+t2KFJE/fpaCyyB/RfVvG/ChTHsTwiyG+VK2Opd1N4MfY7/kAKzjjeFLytslJDCpdaPA6UmVt2BvsHrdQHBLZrvKpV7aUodCsN9FOBQ= + ; +Message-ID: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> +Received: from [200.49.144.50] by web36114.mail.mud.yahoo.com via HTTP; + Tue, 15 Aug 2006 18:53:35 GMT +Date: Tue, 15 Aug 2006 18:53:35 +0000 (GMT) +From: =?iso-8859-1?q?Sebasti=E1n=20Baioni?= +Reply-To: sebaioni-postgresql@yahoo.com.ar +Subject: Re: Inner Join of the same table +To: Performance PostgreSQL +In-Reply-To: <20060815165602.GT27928@pervasive.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/237 +X-Sequence-Number: 20422 + +Hello Jim, we can't use the Where cuiT='12345678901' in the subquery because we need max(cuiL) +independently of that cuiT: +cuiT cuiL PERI FAMI +1 a 200608 0 +1 a 200601 2 +1 b 200607 3 +1 c 200605 4 +2 a 200605 9 +2 c 200604 4 +2 b 200608 1 +We need: +where cuiT = '1' +cuiT cuiL PERI FAMI +1 a 200608 9 +1 c 200605 4 +If we place the Where cuiT = '1' in the subquery we couldn't get the max(FAMI) of cuiL a = 9 and +we couldn't know if that PERI is the max(PERI) of that cuiL independently of that cuiT. + +Here is the explain analyze with PG 8.0 for Windows: +Explain Analyze +SELECT DISTINCT T.cuiT,T.cuiL, U.MAXPERI AS ULT_APORTE_O_DDJJ + FROM APORTES AS T + INNER JOIN + ( + SELECT cuiL, MAX(PERI) AS MAXPERI + FROM APORTES + GROUP BY cuiL + ) AS U ON T.cuiL=U.cuiL AND T.PERI=U.MAXPERI +WHERE T.cuiT='12345678901' +order by T.cuiT, T.cuiL, U.MAXPERI; + +QUERY PLAN + 1 Unique (cost=37478647.41..37478650.53 rows=312 width=62) (actual time=2677209.000..2677520.000 +rows=1720 loops=1) + 2 -> Sort (cost=37478647.41..37478648.19 rows=312 width=62) (actual +time=2677209.000..2677260.000 rows=3394 loops=1) + 3 Sort Key: t.cuiT, t.cuiL, u.maxperi + 4 -> Merge Join (cost=128944.78..37478634.48 rows=312 width=62) (actual +time=74978.000..2677009.000 rows=3394 loops=1) + 5 Merge Cond: ("outer".cuiL = "inner".cuiL) + 6 Join Filter: (("inner".peri)::text = "outer".maxperi) + 7 -> Subquery Scan u (cost=0.00..37348434.56 rows=3951 width=47) (actual +time=130.000..2634923.000 rows=254576 loops=1) + 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) (actual +time=130.000..2629617.000 rows=254576 loops=1) + 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 +rows=9339331 width=25) (actual time=110.000..2520690.000 rows=9335892 loops=1) +10 -> Sort (cost=128944.78..129100.44 rows=62263 width=40) (actual +time=30684.000..36838.000 rows=80471 loops=1) +11 Sort Key: t.cuiL +12 -> Index Scan using uesapt002 on APORTES t (cost=0.00..122643.90 +rows=62263 width=40) (actual time=170.000..25566.000 rows=80471 loops=1) +13 Index Cond: (cuiT = '12345678901'::bpchar) +Total runtime: 2677640.000 ms + +Thanks + Sebasti�n Baioni + + --- "Jim C. Nasby" escribi�: + +> On Tue, Aug 15, 2006 at 03:43:29PM +0000, Sebasti?n Baioni wrote: +> > Hi Nark, thanks for your answer. +> > +> > It's expected to return 1,720 rows (of 80,471 that match with condition WHERE +> > T.cuiT='12345678901') +> > +> > We have indexes by : +> > uesapt000: cuiT, cuiL, PERI; +> > uesapt001: cuiL, PERI; +> > uesapt002: cuiT, PERI; +> > +> > We usually make a vacuum analyze and reindex of every table, and we are running 8.0 and 8.1 +for windows and 7.4 for Linux. +> +> That's EXPLAIN, not EXPLAIN ANALYZE, which doesn't help us much. Best +> bet would be an EXPLAIN ANALYZE from 8.1.x. It would also be useful to +> know how MSSQL is executing this query. +> +> If it would serve your purposes, copying the WHERE clause into the +> subquery would really help things. I think it might also mean you could +> combine everything into one query. +> +> > Thanks +> > Sebasti?n Baioni +> > +> > --- Mark Lewis escribi?: +> > +> > > Can you provide an EXPLAIN ANALYZE of the query in PG? Have you +> > > analyzed the PG database? How many rows is this query expected to +> > > return? Which version of PG are you running? What indexes have you +> > > defined? +> > > +> > > -- Mark +> > > +> > > On Tue, 2006-08-15 at 14:38 +0000, Sebasti?n Baioni wrote: +> > > > Hello, I'm migrating from MS SQL Server to PostgreSQL 8.1 and I have a +> > > > serious problem: +> > > > Table: APORTES - Rows: 9,000,000 (9 million) +> > > > *cuiT (char 11) +> > > > *cuiL (char 11) +> > > > *PERI (char 6) +> > > > FAMI (numeric 6) +> > > > +> > > > I need all the cuiLs whose max(PERI) are from a cuiT, and the Max +> > > > (FAMI) of those cuiLs, so the sentence is: +> > > > +> > > > SELECT DISTINCT T.cuiT, T.cuiL. U.MAXPERI, U.MAXFAMI +> > > > FROM APORTES T +> > > > INNER JOIN +> > > > (SELECT cuiL, MAX(PERI) AS MAXPERI, +> > > > MAX(FAMI) AS MAXFAMI +> > > > FROM APORTES +> > > > GROUP BY cuiL) AS U +> > > > ON T.cuiL = U.cuiL AND T.PERI=U.MAXPERI +> > > > WHERE T.cuiT='12345678901' +> > > > +> > > > In MS SQL Server it lasts 1minute, in PostgreSQL for Windows it lasts +> > > > 40minutes and in PostgreSQL for Linux (FreeBSD) it lasts 20minuts. +> > > > +> > > > Do you know if there is any way to tune the server or optimize this +> > > > sentence? +> > > > +> > > > Thanks +> > > > Sebasti�n Baioni + + + + + +__________________________________________________ +Pregunt�. Respond�. Descubr�. +Todo lo que quer�as saber, y lo que ni imaginabas, +est� en Yahoo! Respuestas (Beta). +�Probalo ya! +http://www.yahoo.com.ar/respuestas + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:03:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 59E289FB1F1 + for ; + Tue, 15 Aug 2006 16:03:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 15902-01 for + ; + Tue, 15 Aug 2006 19:03:26 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) + by postgresql.org (Postfix) with ESMTP id 34E219FB1FB + for ; + Tue, 15 Aug 2006 16:03:25 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J4100CK4ZL0WZX4@vms046.mailsrvcs.net> for + pgsql-performance@postgresql.org; Tue, 15 Aug 2006 14:03:01 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id C1F926FBD1; Tue, + 15 Aug 2006 15:02:58 -0400 (EDT) +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 KodNdaZqW9Pp; Tue, 15 Aug 2006 15:02:56 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 8C5A06FC6D; Tue, 15 Aug 2006 15:02:56 -0400 (EDT) +Date: Tue, 15 Aug 2006 15:02:56 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815183327.GC12834@mark.mielke.cc> +To: mark@mark.mielke.cc +Cc: "Jim C. Nasby" , pgsql-performance@postgresql.org +Mail-followup-to: mark@mark.mielke.cc, "Jim C. Nasby" , + pgsql-performance@postgresql.org +Message-id: <20060815190254.GW2900@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: <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/238 +X-Sequence-Number: 20423 + +On Tue, Aug 15, 2006 at 02:33:27PM -0400, mark@mark.mielke.cc wrote: +>On Tue, Aug 15, 2006 at 01:26:46PM -0400, Michael Stone wrote: +>> On Tue, Aug 15, 2006 at 11:29:26AM -0500, Jim C. Nasby wrote: +>> >Are 'we' sure that such a setup can't lose any data? +>> Yes. If you check the archives, you can even find the last time this was +>> discussed... +> +>I looked last night (coincidence actually) and didn't find proof that +>you cannot lose data. + +You aren't going to find proof, any more than you'll find proof that you +won't lose data if you do lose a journalling fs. (Because there isn't +any.) Unfortunately, many people misunderstand the what a metadata +journal does for you, and overstate its importance in this type of +application. + +>How do you deal with the file system structure being updated before the +>data blocks are (re-)written? + +*That's what the postgres log is for.* If the latest xlog entries don't +make it to disk, they won't be replayed; if they didn't make it to +disk, the transaction would not have been reported as commited. An +application that understands filesystem semantics can guarantee data +integrity without metadata journaling. + +>> The bottom line is that the only reason you need a metadata journalling +>> filesystem is to save the fsck time when you come up. On a little +>> partition like xlog, that's not an issue. +> +>fsck isn't only about time to fix. fsck is needed, because the file system +>is broken. + +fsck is needed to reconcile the metadata with the on-disk allocations. +To do that, it reads all the inodes and their corresponding directory +entries. The time to do that is proportional to the size of the +filesystem, hence the comment about time. fsck is not needed "because +the filesystem is broken", it's needed because the filesystem is marked +dirty. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:36:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 030149FB1DA + for ; + Tue, 15 Aug 2006 16:36:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 37419-01 for + ; + Tue, 15 Aug 2006 19:36:31 +0000 (UTC) +X-Greylist: delayed 00:26:33.189228 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 6B7159FB235 + for ; + Tue, 15 Aug 2006 16:36:31 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from home.wiles.org (frank.wiles.org [24.124.39.75]) + by svr4.postgresql.org (Postfix) with ESMTP id 126345AF88B + for ; + Tue, 15 Aug 2006 19:09:55 +0000 (GMT) +Received: from localhost.localdomain (frank.wiles.org [24.124.39.75]) + by home.wiles.org (8.13.6/8.13.6) with SMTP id k7FJ9rAd012551; + Tue, 15 Aug 2006 14:09:53 -0500 +Date: Tue, 15 Aug 2006 14:08:06 -0500 +From: Frank Wiles +To: "Carl Youngblood" +Cc: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding +Message-Id: <20060815140806.8c73ef5f.frank@wiles.org> +In-Reply-To: +References: + <44DAFB2B.4070307@archonet.com> + <20060815150529.GO27928@pervasive.com> + +X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.8.20; i386-redhat-linux-gnu) +Mime-Version: 1.0 +Content-Type: text/plain; charset=US-ASCII +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/242 +X-Sequence-Number: 20427 + +On Tue, 15 Aug 2006 12:47:54 -0600 +"Carl Youngblood" wrote: + +> I tried setting it to 2GB and postgres wouldn't start. Didn't +> investigate in much greater detail as to why it wouldn't start, but +> after switching it back to 1GB it started fine. +> +> On 8/15/06, Jim C. Nasby wrote: +> > See the recent thread about how old rules of thumb for +> > shared_buffers are now completely bunk. With 4G of memory, setting +> > shared_buffers to 2G could easily be reasonable. The OP really +> > needs to test several different values with their actual workload +> > and see what works best. + + Sounds like you need to increase your kernel's maximum amount + of shared memory. This is typically why an increase in + shared_buffers causes PostgreSQL not to start. + + Check out this page in the docs for more information: + + http://www.postgresql.org/docs/8.1/static/kernel-resources.html + + --------------------------------- + Frank Wiles + http://www.wiles.org + --------------------------------- + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:15:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A919B9FB1FB + for ; + Tue, 15 Aug 2006 16:15:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 10794-05 for + ; + Tue, 15 Aug 2006 19:15:09 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 5B5929FB1F1 + for ; + Tue, 15 Aug 2006 16:15:08 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 2D3455644D; Tue, 15 Aug 2006 14:15:07 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 14:15:05 -0500 +Date: Tue, 15 Aug 2006 14:15:05 -0500 +From: "Jim C. Nasby" +To: mark@mark.mielke.cc, pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815191505.GH21363@pervasive.com> +References: <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815190254.GW2900@mathom.us> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:mark@mark.mielke.cc::HvNrJs2bfPdmX7so:000000000000000000 + 00000000000000000000000094m9 +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::hUCdjPD4hj+ke8/M:00000 + 0000000000000000000000007hhc +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/239 +X-Sequence-Number: 20424 + +On Tue, Aug 15, 2006 at 03:02:56PM -0400, Michael Stone wrote: +> On Tue, Aug 15, 2006 at 02:33:27PM -0400, mark@mark.mielke.cc wrote: +> >On Tue, Aug 15, 2006 at 01:26:46PM -0400, Michael Stone wrote: +> >>On Tue, Aug 15, 2006 at 11:29:26AM -0500, Jim C. Nasby wrote: +> >>>Are 'we' sure that such a setup can't lose any data? +> >>Yes. If you check the archives, you can even find the last time this was +> >>discussed... +> > +> >I looked last night (coincidence actually) and didn't find proof that +> >you cannot lose data. +> +> You aren't going to find proof, any more than you'll find proof that you +> won't lose data if you do lose a journalling fs. (Because there isn't +> any.) Unfortunately, many people misunderstand the what a metadata +> journal does for you, and overstate its importance in this type of +> application. +> +> >How do you deal with the file system structure being updated before the +> >data blocks are (re-)written? +> +> *That's what the postgres log is for.* If the latest xlog entries don't +> make it to disk, they won't be replayed; if they didn't make it to +> disk, the transaction would not have been reported as commited. An +> application that understands filesystem semantics can guarantee data +> integrity without metadata journaling. + +So what causes files to get 'lost' and get stuck in lost+found? +AFAIK that's because the file was written before the metadata. Now, if +fsync'ing a file also ensures that all the metadata is written, then +we're probably fine... if not, then we're at risk every time we create a +new file (every WAL segment if archiving is on, and every time a +relation passes a 1GB boundary). + +FWIW, the way that FreeBSD gets around the need to fsck a dirty +filesystem before use without using a journal is to ensure that metadate +operations are always on the drive before the actual data is written. +There's still a need to fsck a dirty filesystem, but it can now be done +in the background, with the filesystem mounted and in use. + +> >>The bottom line is that the only reason you need a metadata journalling +> >>filesystem is to save the fsck time when you come up. On a little +> >>partition like xlog, that's not an issue. +> > +> >fsck isn't only about time to fix. fsck is needed, because the file system +> >is broken. +> +> fsck is needed to reconcile the metadata with the on-disk allocations. +> To do that, it reads all the inodes and their corresponding directory +> entries. The time to do that is proportional to the size of the +> filesystem, hence the comment about time. fsck is not needed "because +> the filesystem is broken", it's needed because the filesystem is marked +> dirty. +> +> Mike Stone +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 5: don't forget to increase your free space map settings +> + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:17:52 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 42D2C9FB1FB + for ; + Tue, 15 Aug 2006 16:17:51 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 75392-01 for + ; + Tue, 15 Aug 2006 16:17:41 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id D1A3D9FB1F1 + for ; + Tue, 15 Aug 2006 16:17:41 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id 576DCB80A + for ; + Tue, 15 Aug 2006 15:17:39 -0400 (EDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: +References: +Content-Type: multipart/signed; micalg=sha1; + boundary=Apple-Mail-19--878884033; + protocol="application/pkcs7-signature" +Message-Id: <5028FAF6-55B7-4347-AF6C-48133885037B@khera.org> +From: Vivek Khera +Subject: Re: Dell PowerEdge 2950 performance +Date: Tue, 15 Aug 2006 15:17:38 -0400 +To: "Pgsql-Performance ((E-mail))" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.017 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/240 +X-Sequence-Number: 20425 + + +--Apple-Mail-19--878884033 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 15, 2006, at 2:50 PM, Luke Lonergan wrote: + +> I don't know why I missed this the first time - you need to let +> bonnie++ +> pick the file size - it needs to be 2x memory or the results you +> get will +> not be accurate. + +which is an issue with freebsd and bonnie++ since it doesn't know +that freebsd can use large files natively (ie, no large file hacks +necessary). the freebsd port of bonnie takes care of this, if you +use that instead of compiling your own. + + +--Apple-Mail-19--878884033 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MTUxOTE3Mzla +MCMGCSqGSIb3DQEJBDEWBBQl/YTDWewnZa+vm4psHhrVwc1WMDCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEASz/56snaich3izpO +Ag5hk30jXffMuh+JSYCgLUKsQfKaRer7oCmvNhZC1pOuq5834xXmaVFa4LBcEQrTPS8XDn/ic1f+ +Tnf/B6sSMd48L0ad4Ef6aqHPsELQvddbCAFoBZtpa7Aa/QYxT/p0gJvoO4S/Z/+efp18laa2JbTs +ipT2LbVLNsNauFO/YhhAkW/X9dsR1+6kzNUgLsWHTYPYTHpgO6vYxv2ZVuBcn3dVCs8U6LWMZePM +aEs2QekesO2H4PvGgfwK1cvLvl8Pi6h5F6dzpel5dFuqpb54uoSxcK+3bHCU96fryDXRDaBOkEd7 +wegZdU4qxBc04QWiKwK5iwAAAAAAAA== + +--Apple-Mail-19--878884033-- + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:21:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E143A9FB1F1 + for ; + Tue, 15 Aug 2006 16:21:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 10353-06 for + ; + Tue, 15 Aug 2006 19:21:50 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id C1D6D9F9B01 + for ; + Tue, 15 Aug 2006 16:21:49 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 5C9CD56441; Tue, 15 Aug 2006 14:21:47 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 14:21:46 -0500 +Date: Tue, 15 Aug 2006 14:21:46 -0500 +From: "Jim C. Nasby" +To: Carl Youngblood +Cc: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +Message-ID: <20060815192145.GI21363@pervasive.com> +References: + <44DAFB2B.4070307@archonet.com> + <20060815150529.GO27928@pervasive.com> + +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:carl@youngbloods.org::HHwHoYpEHX8YIhta:00000000000000000 + 0000000000000000000000008asE +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::rqA3sKbOrzAXfRXh:00000 + 0000000000000000000000001Lql +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/241 +X-Sequence-Number: 20426 + +On Tue, Aug 15, 2006 at 12:47:54PM -0600, Carl Youngblood wrote: +> I tried setting it to 2GB and postgres wouldn't start. Didn't +> investigate in much greater detail as to why it wouldn't start, but +> after switching it back to 1GB it started fine. + +Most likely because you didn't set the kernel's shared memory settings +high enough. + +To answer you other question: +http://archives.postgresql.org/pgsql-performance/2006-08/msg00095.php + +> On 8/15/06, Jim C. Nasby wrote: +> >See the recent thread about how old rules of thumb for shared_buffers +> >are now completely bunk. With 4G of memory, setting shared_buffers to 2G +> >could easily be reasonable. The OP really needs to test several +> >different values with their actual workload and see what works best. +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that your +> message can get through to the mailing list cleanly +> + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:57:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ACEB99FB28C + for ; + Tue, 15 Aug 2006 17:57:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 39708-04 for + ; + Tue, 15 Aug 2006 17:57:46 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 11B059FB274 + for ; + Tue, 15 Aug 2006 17:57:47 -0300 (ADT) +Received: from [192.168.42.113] (natpool.bovine.net [67.100.216.14]) + (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by noel.decibel.org (Postfix) with ESMTP id 0999B56423; + Tue, 15 Aug 2006 15:57:44 -0500 (CDT) +In-Reply-To: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> +References: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed +Message-Id: <165A9949-55BC-4BFC-9CEF-4F54B23731BE@pervasive.com> +Cc: Performance PostgreSQL +Content-Transfer-Encoding: quoted-printable +From: Jim Nasby +Subject: Re: Inner Join of the same table +Date: Tue, 15 Aug 2006 14:27:49 -0500 +To: sebaioni-postgresql@yahoo.com.ar +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/251 +X-Sequence-Number: 20436 + +On Aug 15, 2006, at 1:53 PM, Sebasti=E1n Baioni wrote: +> 9 -> Index Scan using uesapt001 on =20 +> APORTES (cost=3D0.00..37301678.64 +> rows=3D9339331 width=3D25) (actual time=3D110.000..2520690.000 =20 +> rows=3D9335892 loops=3D1) + +It's taking 2520 seconds to scan an index with 9M rows, which sounds =20 +way, way too slow. I suspect that index got bloated badly at some =20 +point by not vacuuming frequently enough (autovacuum is your friend). =20= + +Try reindexing and see if that fixes the problem. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:40:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CBFBF9FB1F1 + for ; + Tue, 15 Aug 2006 16:40:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 72367-05 for + ; + Tue, 15 Aug 2006 16:39:53 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id 9FB839FB1DA + for ; + Tue, 15 Aug 2006 16:39:54 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id 40EB27F0E1; + Tue, 15 Aug 2006 15:39:52 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Nrh8yxGYmtGE; Tue, 15 Aug 2006 15:39:52 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id F3E337F0ED; Tue, 15 Aug 2006 15:39:51 -0400 (EDT) +Date: Tue, 15 Aug 2006 15:39:51 -0400 +From: mark@mark.mielke.cc +To: "Jim C. Nasby" , pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815193951.GA13695@mark.mielke.cc> +References: <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815190254.GW2900@mathom.us> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.204 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/243 +X-Sequence-Number: 20428 + +On Tue, Aug 15, 2006 at 03:02:56PM -0400, Michael Stone wrote: +> On Tue, Aug 15, 2006 at 02:33:27PM -0400, mark@mark.mielke.cc wrote: +> >>>Are 'we' sure that such a setup can't lose any data? +> >>Yes. If you check the archives, you can even find the last time this was +> >>discussed... +> >I looked last night (coincidence actually) and didn't find proof that +> >you cannot lose data. +> You aren't going to find proof, any more than you'll find proof that you +> won't lose data if you do lose a journalling fs. (Because there isn't +> any.) Unfortunately, many people misunderstand the what a metadata +> journal does for you, and overstate its importance in this type of +> application. + +Yes, many people do. :-) + +> >How do you deal with the file system structure being updated before the +> >data blocks are (re-)written? +> *That's what the postgres log is for.* If the latest xlog entries don't +> make it to disk, they won't be replayed; if they didn't make it to +> disk, the transaction would not have been reported as commited. An +> application that understands filesystem semantics can guarantee data +> integrity without metadata journaling. + +No. This is not true. Updating the file system structure (inodes, indirect +blocks) touches a separate part of the disk than the actual data. If +the file system structure is modified, say, to extend a file to allow +it to contain more data, but the data itself is not written, then upon +a restore, with a system such as ext2, or ext3 with writeback, or xfs, +it is possible that the end of the file, even the postgres log file, +will contain a random block of data from the disk. If this random block +of data happens to look like a valid xlog block, it may be played back, +and the database corrupted. + +If the file system is only used for xlog data, the chance that it looks +like a valid block increases, would it not? + +> >>The bottom line is that the only reason you need a metadata journalling +> >>filesystem is to save the fsck time when you come up. On a little +> >>partition like xlog, that's not an issue. +> >fsck isn't only about time to fix. fsck is needed, because the file system +> >is broken. +> fsck is needed to reconcile the metadata with the on-disk allocations. +> To do that, it reads all the inodes and their corresponding directory +> entries. The time to do that is proportional to the size of the +> filesystem, hence the comment about time. fsck is not needed "because +> the filesystem is broken", it's needed because the filesystem is marked +> dirty. + +This is also wrong. fsck is needed because the file system is broken. + +It takes time, because it doesn't have a journal to help it, therefore it +must look through the entire file system and guess what the problems are. +There are classes of problems such as I describe above, for which fsck +*cannot* guess how to solve the problem. There is not enough information +available for it to deduce that anything is wrong at all. + +The probability is low, for sure - but then, the chance of a file system +failure is already low. + +Betting on ext2 + postgresql xlog has not been confirmed to me as reliable. + +Telling me that journalling is misunderstood doesn't prove to me that you +understand it. + +I don't mean to be offensive, but I won't accept what you say, as it does +not make sense with my understanding of how file systems work. :-) + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 16:43:16 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3D36B9FB1F1 + for ; + Tue, 15 Aug 2006 16:43:16 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 38222-03 for + ; + Tue, 15 Aug 2006 19:43:01 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id AC7CE9FB1DA + for ; + Tue, 15 Aug 2006 16:43:01 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id E72DF7F0E1; + Tue, 15 Aug 2006 15:42:59 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id A2SCf01triSt; Tue, 15 Aug 2006 15:42:59 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 9B2FC7F0ED; Tue, 15 Aug 2006 15:42:59 -0400 (EDT) +Date: Tue, 15 Aug 2006 15:42:59 -0400 +From: mark@mark.mielke.cc +To: "Jim C. Nasby" +Cc: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815194259.GB13695@mark.mielke.cc> +References: <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815191505.GH21363@pervasive.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815191505.GH21363@pervasive.com> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.094 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/244 +X-Sequence-Number: 20429 + +On Tue, Aug 15, 2006 at 02:15:05PM -0500, Jim C. Nasby wrote: +> So what causes files to get 'lost' and get stuck in lost+found? +> AFAIK that's because the file was written before the metadata. Now, if +> fsync'ing a file also ensures that all the metadata is written, then +> we're probably fine... if not, then we're at risk every time we create a +> new file (every WAL segment if archiving is on, and every time a +> relation passes a 1GB boundary). + +Only if fsync ensures that the data written to disk is ordered, which as +far as I know, is not done for ext2. Dirty blocks are written in whatever +order is fastest for them to be written, or sequential order, or some +order that isn't based on examining the metadata. + +If my understanding is correct - and I've seen nothing yet to say that +it isn't - ext2 is not safe, postgresql xlog or not, fsck or not. It +is safer than no postgresql xlog - but there exists windows, however +small, where the file system can be corrupted. + +The need for fsck is due to this problem. If fsck needs to do anything +at all, other than replay a journal, the file system is broken. + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:05:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id BC56D9FB274 + for ; + Tue, 15 Aug 2006 17:05:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 16310-01 for + ; + Tue, 15 Aug 2006 17:05:21 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 053C99FB235 + for ; + Tue, 15 Aug 2006 17:05:21 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7FK5H2d019784; + Tue, 15 Aug 2006 16:05:17 -0400 (EDT) +To: mark@mark.mielke.cc +cc: "Jim C. Nasby" , Steve Poe , + pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815183147.GB12834@mark.mielke.cc> +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815183147.GB12834@mark.mielke.cc> +Comments: In-reply-to mark@mark.mielke.cc + message dated "Tue, 15 Aug 2006 14:31:48 -0400" +Date: Tue, 15 Aug 2006 16:05:17 -0400 +Message-ID: <19783.1155672317@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.186 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/245 +X-Sequence-Number: 20430 + +mark@mark.mielke.cc writes: +> I've been worrying about this myself, and my current conclusion is that +> ext2 is bad because: a) fsck, and b) data can be lost or corrupted, which +> could lead to the need to trash the xlog. + +> Even ext3 in writeback mode allows for the indirect blocks to be updated +> without the data underneath, allowing for blocks to point to random data, +> or worse, previous apparently sane data (especially if the data is from +> a drive only used for xlog - the chance is high that a block might look +> partially valid?). + +At least for xlog, this worrying is misguided, because we zero and fsync +a WAL file before we ever put any valuable data into it. Unless the +filesystem is lying through its teeth about having done an fsync, there +should be no metadata changes happening for an active WAL file (other +than mtime of course). + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:22:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E8F989FB235 + for ; + Tue, 15 Aug 2006 17:22:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 63911-01 for + ; + Tue, 15 Aug 2006 20:21:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by postgresql.org (Postfix) with ESMTP id AFA079FB1E9 + for ; + Tue, 15 Aug 2006 17:21:58 -0300 (ADT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Dell PowerEdge 2950 performance +Date: Tue, 15 Aug 2006 16:21:55 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104A01@MAIL.corp.lumeta.com> +In-Reply-To: <5028FAF6-55B7-4347-AF6C-48133885037B@khera.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: AcbAn4h2d1PVc/GzRBy+xnSYs+pzfgACNZ0Q +From: "Bucky Jordan" +To: "Vivek Khera" , + "Pgsql-Performance \(\(E-mail\)\)" , + "Luke Lonergan" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/246 +X-Sequence-Number: 20431 + +Luke, + +For some reason it looks like bonnie is picking a 300M file.=20 + +> bonnie++ -d bonnie +Version 1.03 ------Sequential Output------ --Sequential Input- +--Random- + -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 300M 179028 99 265358 41 270175 57 167989 99 +++++ +++ ++++++ +++ + ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ ++++++ +++ +,300M,179028,99,265358,41,270175,57,167989,99,+++++,+++,+++++,+++,16,+++ +++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++=20 + +So here's results when I force it to use a 16GB file, which is twice the +amount of physical ram in the system: + +> bonnie++ -d bonnie -s 16000:8k +Version 1.03 ------Sequential Output------ --Sequential Input- +--Random- + -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 16000M 158539 99 244430 50 58647 29 83252 61 144240 21 +789.8 7 + ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 7203 54 +++++ +++ +++++ +++ 24555 42 +++++ +++ ++++++ +++ +,16000M,158539,99,244430,50,58647,29,83252,61,144240,21,789.8,7,16,7203, +54,+++++,+++,+++++,+++,24555,42,+++++,+++,+++++,+++ + +... from Vivek... +which is an issue with freebsd and bonnie++ since it doesn't know =20 +that freebsd can use large files natively (ie, no large file hacks =20 +necessary). the freebsd port of bonnie takes care of this, if you =20 +use that instead of compiling your own. +... + +Unfortunately I had to download and build by hand, since only bonnie++ +1.9x is available in BSD 6.1 ports when I checked. + +One other question- would the following also be mostly a test of RAM? I +wouldn't think so since it should force it to sync to disk...=20 +time bash -c "(dd if=3D/dev/zero of=3D/data/bigfile count=3D125000 = +bs=3D8k && +sync)" + +Oh, and while I'm thinking about it, I believe Postgres uses 8k data +pages correct? On the RAID, I'm using 128k stripes. I know there's been +posts on this before, but is there any way to tell postgres to use this +in an effective way?=20 + +Thanks, + +Bucky + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Vivek Khera +Sent: Tuesday, August 15, 2006 3:18 PM +To: Pgsql-Performance ((E-mail)) +Subject: Re: [PERFORM] Dell PowerEdge 2950 performance + + +On Aug 15, 2006, at 2:50 PM, Luke Lonergan wrote: + +> I don't know why I missed this the first time - you need to let =20 +> bonnie++ +> pick the file size - it needs to be 2x memory or the results you =20 +> get will +> not be accurate. + +which is an issue with freebsd and bonnie++ since it doesn't know =20 +that freebsd can use large files natively (ie, no large file hacks =20 +necessary). the freebsd port of bonnie takes care of this, if you =20 +use that instead of compiling your own. + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:29:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 176BD9FB235 + for ; + Tue, 15 Aug 2006 17:29:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 20658-05 for + ; + Tue, 15 Aug 2006 17:29:50 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id 6CFAA9FB1E9 + for ; + Tue, 15 Aug 2006 17:29:51 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id 37ECE7F0EF; + Tue, 15 Aug 2006 16:29:49 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id mRk2WENj51Qr; Tue, 15 Aug 2006 16:29:49 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 13E587F0F0; Tue, 15 Aug 2006 16:29:48 -0400 (EDT) +Date: Tue, 15 Aug 2006 16:29:48 -0400 +From: mark@mark.mielke.cc +To: Tom Lane +Cc: "Jim C. Nasby" , Steve Poe , + pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815202948.GC13695@mark.mielke.cc> +References: <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815183147.GB12834@mark.mielke.cc> + <19783.1155672317@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <19783.1155672317@sss.pgh.pa.us> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.194 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/247 +X-Sequence-Number: 20432 + +On Tue, Aug 15, 2006 at 04:05:17PM -0400, Tom Lane wrote: +> mark@mark.mielke.cc writes: +> > I've been worrying about this myself, and my current conclusion is that +> > ext2 is bad because: a) fsck, and b) data can be lost or corrupted, which +> > could lead to the need to trash the xlog. +> > Even ext3 in writeback mode allows for the indirect blocks to be updated +> > without the data underneath, allowing for blocks to point to random data, +> > or worse, previous apparently sane data (especially if the data is from +> > a drive only used for xlog - the chance is high that a block might look +> > partially valid?). +> At least for xlog, this worrying is misguided, because we zero and fsync +> a WAL file before we ever put any valuable data into it. Unless the +> filesystem is lying through its teeth about having done an fsync, there +> should be no metadata changes happening for an active WAL file (other +> than mtime of course). + +Hmmm... I may have missed a post about this in the archive. + +WAL file is never appended - only re-written? + +If so, then I'm wrong, and ext2 is fine. The requirement is that no +file system structures change as a result of any writes that +PostgreSQL does. If no file system structures change, then I take +everything back as uninformed. + +Please confirm whichever. :-) + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:40:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 7BEFF9FB235 + for ; + Tue, 15 Aug 2006 17:40:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 61895-05 for + ; + Tue, 15 Aug 2006 20:40:14 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id D9F449FB1E9 + for ; + Tue, 15 Aug 2006 17:40:13 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7FKe9se020114; + Tue, 15 Aug 2006 16:40:09 -0400 (EDT) +To: mark@mark.mielke.cc +cc: "Jim C. Nasby" , Steve Poe , + pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815202948.GC13695@mark.mielke.cc> +References: <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815183147.GB12834@mark.mielke.cc> + <19783.1155672317@sss.pgh.pa.us> + <20060815202948.GC13695@mark.mielke.cc> +Comments: In-reply-to mark@mark.mielke.cc + message dated "Tue, 15 Aug 2006 16:29:48 -0400" +Date: Tue, 15 Aug 2006 16:40:09 -0400 +Message-ID: <20113.1155674409@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/248 +X-Sequence-Number: 20433 + +mark@mark.mielke.cc writes: +> WAL file is never appended - only re-written? + +> If so, then I'm wrong, and ext2 is fine. The requirement is that no +> file system structures change as a result of any writes that +> PostgreSQL does. If no file system structures change, then I take +> everything back as uninformed. + +That risk certainly exists in the general data directory, but AFAIK +it's not a problem for pg_xlog. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:42:03 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 7A2279FB235 + for ; + Tue, 15 Aug 2006 17:42:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 63426-05 for + ; + Tue, 15 Aug 2006 20:41:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 222569FB1E9 + for ; + Tue, 15 Aug 2006 17:41:58 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id CC250B80A + for ; + Tue, 15 Aug 2006 16:41:55 -0400 (EDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D4104A01@MAIL.corp.lumeta.com> +References: <78ED28FACE63744386D68D8A9D1CF5D4104A01@MAIL.corp.lumeta.com> +Content-Type: multipart/signed; micalg=sha1; + boundary=Apple-Mail-28--873827510; + protocol="application/pkcs7-signature" +Message-Id: +From: Vivek Khera +Subject: Re: Dell PowerEdge 2950 performance +Date: Tue, 15 Aug 2006 16:41:55 -0400 +To: "Pgsql-Performance ((((E-mail))))" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/249 +X-Sequence-Number: 20434 + + +--Apple-Mail-28--873827510 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 15, 2006, at 4:21 PM, Bucky Jordan wrote: + +> ... from Vivek... +> which is an issue with freebsd and bonnie++ since it doesn't know +> that freebsd can use large files natively (ie, no large file hacks +> necessary). the freebsd port of bonnie takes care of this, if you +> use that instead of compiling your own. +> ... +> +> Unfortunately I had to download and build by hand, since only bonnie++ +> 1.9x is available in BSD 6.1 ports when I checked. + +see the patch file in the bonnie++ port file and apply something +similar. basically you take out the check for large file support and +force it on. + + +--Apple-Mail-28--873827510 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MTUyMDQxNTVa +MCMGCSqGSIb3DQEJBDEWBBSxU/bG2uoZXg5KqfyS0FWS5CxLRjCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAbjfOTwddbhMOJ6RE +7G0qEg6HBf1Kd0GpSdl3wD4z7Equof2Pjt0JKpgf28EcCGsZX/fqaqq80EX0zNmSSpu6GTmXNCuK +VuLfxm3hddi5bN3CgRTrIGcvoPGbh84lsuaZMB5VKAa1uTVABlWCjg7Stf6F9TXTYTzmnOkkZ527 +qYyq/qnlJUHWkgTA2O7Cz7XOp4vZT1nA1fBwIDcZqQuwOL4XHylHAjY1lXKz8h8Xe/XSDtGApdLU +O7vLTY8qBEfH/3LLIQvzQa2N4k62bSxbGbot/rHWnsjZXlHMaXDNWl2EPddil7D9cF9Azk69x5D2 +GJjjqbJbkp7DBTqMWVqCagAAAAAAAA== + +--Apple-Mail-28--873827510-- + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:53:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5427E9FB28C + for ; + Tue, 15 Aug 2006 17:53:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 65192-08 for + ; + Tue, 15 Aug 2006 20:53:23 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) + by postgresql.org (Postfix) with ESMTP id 33C379FB274 + for ; + Tue, 15 Aug 2006 17:53:22 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J42001614OLKYR2@vms048.mailsrvcs.net> for + pgsql-performance@postgresql.org; Tue, 15 Aug 2006 15:53:10 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id EBA356FBD1; Tue, + 15 Aug 2006 16:53:05 -0400 (EDT) +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 HavoX9sQauBg; Tue, 15 Aug 2006 16:53:04 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 9CE596FC71; Tue, 15 Aug 2006 16:53:03 -0400 (EDT) +Date: Tue, 15 Aug 2006 16:53:03 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815191505.GH21363@pervasive.com> +To: "Jim C. Nasby" +Cc: mark@mark.mielke.cc, pgsql-performance@postgresql.org +Mail-followup-to: "Jim C. Nasby" , mark@mark.mielke.cc, + pgsql-performance@postgresql.org +Message-id: <20060815205300.GX2900@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: <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815191505.GH21363@pervasive.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/250 +X-Sequence-Number: 20435 + +On Tue, Aug 15, 2006 at 02:15:05PM -0500, Jim C. Nasby wrote: +>Now, if +>fsync'ing a file also ensures that all the metadata is written, then +>we're probably fine... + +...and it does. Unclean shutdowns cause problems in general because +filesystems operate asynchronously. postgres (and other similar +programs) go to great lengths to make sure that critical operations are +performed synchronously. If the program *doesn't* do that, metadata +journaling isn't a magic wand which will guarantee data integrity--it +won't. If the program *does* do that, all the metadata journaling adds +is the ability to skip fsck and start up faster. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Tue Aug 15 17:59:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 106879FB28C + for ; + Tue, 15 Aug 2006 17:59:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 42903-05 for + ; + Tue, 15 Aug 2006 17:59:15 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) + by postgresql.org (Postfix) with ESMTP id 85AE59FB274 + for ; + Tue, 15 Aug 2006 17:59:16 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.42]) + by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J42005OQ4YEL4X1@vms046.mailsrvcs.net> for + pgsql-performance@postgresql.org; Tue, 15 Aug 2006 15:59:02 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id C1BA56E630; Tue, + 15 Aug 2006 16:59:00 -0400 (EDT) +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 CyjHcoeDkqU6; Tue, 15 Aug 2006 16:58:59 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 428DA6FC71; Tue, 15 Aug 2006 16:58:59 -0400 (EDT) +Date: Tue, 15 Aug 2006 16:58:59 -0400 +From: Michael Stone +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815193951.GA13695@mark.mielke.cc> +To: mark@mark.mielke.cc +Cc: pgsql-performance@postgresql.org +Mail-followup-to: mark@mark.mielke.cc, pgsql-performance@postgresql.org +Message-id: <20060815205857.GY2900@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: <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815193951.GA13695@mark.mielke.cc> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.726 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/252 +X-Sequence-Number: 20437 + +On Tue, Aug 15, 2006 at 03:39:51PM -0400, mark@mark.mielke.cc wrote: +>No. This is not true. Updating the file system structure (inodes, indirect +>blocks) touches a separate part of the disk than the actual data. If +>the file system structure is modified, say, to extend a file to allow +>it to contain more data, but the data itself is not written, then upon +>a restore, with a system such as ext2, or ext3 with writeback, or xfs, +>it is possible that the end of the file, even the postgres log file, +>will contain a random block of data from the disk. If this random block +>of data happens to look like a valid xlog block, it may be played back, +>and the database corrupted. + +you're conflating a whole lot of different issues here. You're ignoring +the fact that postgres preallocates the xlog segment, you're ignoring +the fact that you can sync a directory entry, you're ignoring the fact +that syncing some metadata (such as atime) doesn't matter (only the +block allocation is important in this case, and the blocks are +pre-allocated). + +>This is also wrong. fsck is needed because the file system is broken. + +nope, the file system *may* be broken. the dirty flag simply indicates +that the filesystem needs to be checked to find out whether or not it is +broken. + +>I don't mean to be offensive, but I won't accept what you say, as it does +>not make sense with my understanding of how file systems work. :-) + + I'm not getting paid to convince you of anything. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Tue Aug 15 18:13:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6EE599FB28C + for ; + Tue, 15 Aug 2006 18:13:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 77985-08 for + ; + Tue, 15 Aug 2006 21:13:04 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 78BE89FB274 + for ; + Tue, 15 Aug 2006 18:13:04 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7FLD2XK020385; + Tue, 15 Aug 2006 17:13:02 -0400 (EDT) +To: sebaioni-postgresql@yahoo.com.ar +cc: Performance PostgreSQL +Subject: Re: Inner Join of the same table +In-reply-to: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> +References: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> +Comments: In-reply-to =?iso-8859-1?q?Sebasti=E1n=20Baioni?= + + message dated "Tue, 15 Aug 2006 18:53:35 -0000" +Date: Tue, 15 Aug 2006 17:13:02 -0400 +Message-ID: <20384.1155676382@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/253 +X-Sequence-Number: 20438 + +=?iso-8859-1?q?Sebasti=E1n=20Baioni?= writes: +> 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) (actual +> time=130.000..2629617.000 rows=254576 loops=1) +> 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 +> rows=9339331 width=25) (actual time=110.000..2520690.000 rows=9335892 loops=1) + +Given the relatively small estimated number of group rows, I'd have +expected the thing to use a seqscan and HashAggregate for this part. +Do you have enable_hashagg turned off for some reason? Or enable_seqscan? + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 15 18:38:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 492279FB274 + for ; + Tue, 15 Aug 2006 18:38:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 10877-01 for + ; + Tue, 15 Aug 2006 21:38:45 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id 91F339FB220 + for ; + Tue, 15 Aug 2006 18:38:45 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id 7BC187F0F5; + Tue, 15 Aug 2006 17:38:43 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id KomlwfU5dEVM; Tue, 15 Aug 2006 17:38:43 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 3D73C7F0F6; Tue, 15 Aug 2006 17:38:43 -0400 (EDT) +Date: Tue, 15 Aug 2006 17:38:43 -0400 +From: mark@mark.mielke.cc +To: Michael Stone +Cc: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815213842.GA15210@mark.mielke.cc> +References: <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815193951.GA13695@mark.mielke.cc> + <20060815205857.GY2900@mathom.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815205857.GY2900@mathom.us> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.094 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/254 +X-Sequence-Number: 20439 + +On Tue, Aug 15, 2006 at 04:58:59PM -0400, Michael Stone wrote: +> On Tue, Aug 15, 2006 at 03:39:51PM -0400, mark@mark.mielke.cc wrote: +> >No. This is not true. Updating the file system structure (inodes, indirect +> >blocks) touches a separate part of the disk than the actual data. If +> >the file system structure is modified, say, to extend a file to allow +> >it to contain more data, but the data itself is not written, then upon +> >a restore, with a system such as ext2, or ext3 with writeback, or xfs, +> >it is possible that the end of the file, even the postgres log file, +> >will contain a random block of data from the disk. If this random block +> >of data happens to look like a valid xlog block, it may be played back, +> >and the database corrupted. +> you're conflating a whole lot of different issues here. You're ignoring +> the fact that postgres preallocates the xlog segment, you're ignoring +> the fact that you can sync a directory entry, you're ignoring the fact +> that syncing some metadata (such as atime) doesn't matter (only the +> block allocation is important in this case, and the blocks are +> pre-allocated). + +Yes, no, no, no. :-) + +I didn't know that the xlog segment only uses pre-allocated space. I +ignore mtime/atime as they don't count as file system structure +changes to me. It's updating a field in place. No change to the structure. + +With the pre-allocation knowledge, I agree with you. Not sure how I +missed that in my reviewing of the archives... I did know it +pre-allocated once upon a time... Hmm.... + +> >This is also wrong. fsck is needed because the file system is broken. +> nope, the file system *may* be broken. the dirty flag simply indicates +> that the filesystem needs to be checked to find out whether or not it is +> broken. + +Ah, but if we knew it wasn't broken, then fsck wouldn't be needed, now +would it? So we assume that it is broken. A little bit of a game, but +it is important to me. If I assumed the file system was not broken, I +wouldn't run fsck. I run fsck, because I assume it may be broken. If +broken, it indicates potential corruption. + +The difference for me, is that if you are correct, that the xlog is +safe, than for a disk that only uses xlog, fsck is not ever necessary, +even after a system crash. If fsck is necessary, then there is potential +for a problem. + +With the pre-allocation knowledge, I'm tempted to agree with you that +fsck is not ever necessary for partitions that only hold a properly +pre-allocated xlog. + +> >I don't mean to be offensive, but I won't accept what you say, as it does +> >not make sense with my understanding of how file systems work. :-) +> I'm not getting paid to convince you of anything. + +Just getting you to back up your claim a bit... As I said, no intent +to offend. I learned from it. + +Thanks, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Tue Aug 15 19:20:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6243A9FB2CF + for ; + Tue, 15 Aug 2006 19:20:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 30098-02 for + ; + Tue, 15 Aug 2006 19:20:27 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 3B1FE9FB2C5 + for ; + Tue, 15 Aug 2006 19:20:27 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 230245644A; Tue, 15 Aug 2006 17:20:26 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Tue, 15 Aug 2006 17:20:25 -0500 +Date: Tue, 15 Aug 2006 17:20:25 -0500 +From: "Jim C. Nasby" +To: mark@mark.mielke.cc +Cc: Michael Stone , + pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815222024.GV21363@pervasive.com> +References: <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815193951.GA13695@mark.mielke.cc> + <20060815205857.GY2900@mathom.us> + <20060815213842.GA15210@mark.mielke.cc> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060815213842.GA15210@mark.mielke.cc> +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060815:mark@mark.mielke.cc::TnMPYXnOmPuqYAvc:000000000000000000 + 0000000000000000000000003I/e +X-Hashcash: + 1:20:060815:mstone+postgres@mathom.us::2J9ARA94OO19h7Ey:000000000000 + 0000000000000000000000000JBj +X-Hashcash: + 1:20:060815:pgsql-performance@postgresql.org::oLdxvnHaofY137I3:00000 + 000000000000000000000000839P +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.105 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/255 +X-Sequence-Number: 20440 + +On Tue, Aug 15, 2006 at 05:38:43PM -0400, mark@mark.mielke.cc wrote: +> I didn't know that the xlog segment only uses pre-allocated space. I +> ignore mtime/atime as they don't count as file system structure +> changes to me. It's updating a field in place. No change to the structure. +> +> With the pre-allocation knowledge, I agree with you. Not sure how I +> missed that in my reviewing of the archives... I did know it +> pre-allocated once upon a time... Hmm.... + +This is only valid if the pre-allocation is also fsync'd *and* fsync +ensures that both the metadata and file data are on disk. Anyone +actually checked that? :) + +BTW, I did see some anecdotal evidence on one of the lists a while ago. +A PostgreSQL DBA had suggested doing a 'pull the power cord' test to the +other DBAs (all of which were responsible for different RDBMSes, +including a bunch of well known names). They all thought he was off his +rocker. Not too long after that, an unplanned power outage did occur, +and PostgreSQL was the only RDBMS that recovered every single database +without intervention. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Tue Aug 15 19:23:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 9FA7B9FB311 + for ; + Tue, 15 Aug 2006 19:23:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 33692-02 for + ; + Tue, 15 Aug 2006 19:23:26 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from cassarossa.samfundet.no (cassarossa.samfundet.no + [129.241.93.19]) + by postgresql.org (Postfix) with ESMTP id E67C29FB2E6 + for ; + Tue, 15 Aug 2006 19:23:27 -0300 (ADT) +Received: from trofast.sesse.net ([129.241.93.32]) + by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1GD7Jj-00057G-Uu + for pgsql-performance@postgresql.org; Wed, 16 Aug 2006 00:23:24 +0200 +Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) + id 1GD7Jj-0004kF-00 + for ; Wed, 16 Aug 2006 00:23:23 +0200 +Date: Wed, 16 Aug 2006 00:23:23 +0200 +From: "Steinar H. Gunderson" +To: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +Message-ID: <20060815222323.GA18180@uio.no> +Mail-Followup-To: pgsql-performance@postgresql.org +References: <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815193951.GA13695@mark.mielke.cc> + <20060815205857.GY2900@mathom.us> + <20060815213842.GA15210@mark.mielke.cc> + <20060815222024.GV21363@pervasive.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +In-Reply-To: <20060815222024.GV21363@pervasive.com> +X-Operating-System: Linux 2.6.16trofastxen on a x86_64 +X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/256 +X-Sequence-Number: 20441 + +On Tue, Aug 15, 2006 at 05:20:25PM -0500, Jim C. Nasby wrote: +> This is only valid if the pre-allocation is also fsync'd *and* fsync +> ensures that both the metadata and file data are on disk. Anyone +> actually checked that? :) + +fsync() does that, yes. fdatasync() (if it exists), OTOH, doesn't sync the +metadata. + +/* Steinar */ +-- +Homepage: http://www.sesse.net/ + +From pgsql-performance-owner@postgresql.org Tue Aug 15 21:07:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4FCFC9FB314 + for ; + Tue, 15 Aug 2006 21:07:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 56198-01 for + ; + Wed, 16 Aug 2006 00:07:27 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from bifrost.lang.hm (dsl081-033-126.lax1.dsl.speakeasy.net + [64.81.33.126]) by postgresql.org (Postfix) with ESMTP id 145FF9FB273 + for ; + Tue, 15 Aug 2006 21:07:26 -0300 (ADT) +Received: from david.lang.hm (IDENT:1000@david.lang.hm [10.0.0.5]) + by bifrost.lang.hm (8.13.4/8.13.4/Debian-3) with ESMTP id + k7G07Hpp025547; Tue, 15 Aug 2006 17:07:17 -0700 +Date: Tue, 15 Aug 2006 17:07:17 -0700 (PDT) +From: David Lang +X-X-Sender: dlang@david.lang.hm +To: mark@mark.mielke.cc +cc: Michael Stone , + pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +In-Reply-To: <20060815213842.GA15210@mark.mielke.cc> +Message-ID: +References: <20060814153841.GF27928@pervasive.com> + <721b21dc0608140851v2332cdf9g59808004c983540f@mail.gmail.com> + <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815193951.GA13695@mark.mielke.cc> + <20060815205857.GY2900@mathom.us> + <20060815213842.GA15210@mark.mielke.cc> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/257 +X-Sequence-Number: 20442 + +On Tue, 15 Aug 2006 mark@mark.mielke.cc wrote: +>>> This is also wrong. fsck is needed because the file system is broken. +>> nope, the file system *may* be broken. the dirty flag simply indicates +>> that the filesystem needs to be checked to find out whether or not it is +>> broken. +> +> Ah, but if we knew it wasn't broken, then fsck wouldn't be needed, now +> would it? So we assume that it is broken. A little bit of a game, but +> it is important to me. If I assumed the file system was not broken, I +> wouldn't run fsck. I run fsck, because I assume it may be broken. If +> broken, it indicates potential corruption. + +note tha the ext3, reiserfs, jfs, and xfs developers (at least) consider +fsck nessasary even for journaling fileysstems. they just let you get away +without it being mandatory after a unclean shutdown. + +David Lang + +From pgsql-performance-owner@postgresql.org Tue Aug 15 22:10:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 2924E9FB1DE + for ; + Tue, 15 Aug 2006 22:10:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 65588-05 for + ; + Wed, 16 Aug 2006 01:09:55 +0000 (UTC) +X-Greylist: delayed 00:30:19.166796 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 2D4369FB344 + for ; + Tue, 15 Aug 2006 22:09:55 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from andromeda1.neonex.com.br (dns3.neonex.com.br [201.28.22.10]) + by svr4.postgresql.org (Postfix) with ESMTP id E258F5AF043 + for ; + Wed, 16 Aug 2006 00:39:32 +0000 (GMT) +Received: from [200.206.25.4] (helo=[127.0.0.1]) + by andromeda1.neonex.com.br with esmtpa (Exim 4.62) + (envelope-from ) id 1GD9Rf-000336-0v + for pgsql-performance@postgresql.org; Tue, 15 Aug 2006 21:39:43 -0300 +Message-ID: <44E26939.30903@planit.com.br> +Date: Tue, 15 Aug 2006 21:39:21 -0300 +From: "Luiz K. Matsumura" +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Big diference in response time (query plan question) +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 8bit +X-Antivirus: avast! (VPS 0633-1, 08/15/2006), Outbound message +X-Antivirus-Status: Clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/258 +X-Sequence-Number: 20443 + +Hi all, + +I have PostgreSQL 8.1.4 running on a P 4 2.8 GHz , 512 MB with Linux +(Fedora Core 3) + +The SQL comands below have a performance diference that I think is not +so much acceptable ( 1035.427 ms vs 7.209 ms ), since the tables isn�t +so much big ( contrato have 1907 rows and prog have 40.002 rows ) +Can I make some optimization here ? + + EXPLAIN ANALYZE + SELECT Contrato.Id + , Min( prog.dtsemeio ) AS DtSemIni + , Max( prog.dtsemeio ) AS DtSemFim + , Min( prog.dtembarque ) AS DtEmbIni + , Max( prog.dtembarque ) AS DtEmbFim + , Min( prog.dtentrega ) AS DtEntIni + , Max( prog.dtentrega ) AS DtEntFim + , COUNT(prog.*) AS QtSem + , SUM( CASE WHEN Prog.DtSemeio >= '20060814' THEN 1 ELSE 0 END ) +AS QtSemAb + FROM bvz.Contrato + LEFT OUTER JOIN bvz.Prog ON prog.Fk_Contrato = Contrato.Id + WHERE Contrato.Fk_Clifor = 243 + GROUP BY 1; + QUERY +PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ + GroupAggregate (cost=5477.34..5706.84 rows=41 width=48) (actual +time=883.721..1031.159 rows=41 loops=1) + -> Merge Left Join (cost=5477.34..5686.15 rows=860 width=48) +(actual time=868.038..1026.988 rows=1366 loops=1) + Merge Cond: ("outer".id = "inner".fk_contrato) + -> Sort (cost=50.39..50.49 rows=41 width=4) (actual +time=0.614..0.683 rows=41 loops=1) + Sort Key: contrato.id + -> Bitmap Heap Scan on contrato (cost=2.14..49.29 +rows=41 width=4) (actual time=0.163..0.508 rows=41 loops=1) + Recheck Cond: (fk_clifor = 243) + -> Bitmap Index Scan on fki_contrato_clifor +(cost=0.00..2.14 rows=41 width=0) (actual time=0.146..0.146 rows=41 loops=1) + Index Cond: (fk_clifor = 243) + -> Sort (cost=5426.95..5526.95 rows=40002 width=48) (actual +time=862.192..956.903 rows=38914 loops=1) + Sort Key: prog.fk_contrato + -> Seq Scan on prog (cost=0.00..1548.02 rows=40002 +width=48) (actual time=0.044..169.795 rows=40002 loops=1) + Total runtime: 1035.427 ms + + +EXPLAIN ANALYZE +SELECT Contrato.Id + , Min( prog.dtsemeio ) AS DtSemIni + , Max( prog.dtsemeio ) AS DtSemFim + , Min( prog.dtembarque ) AS DtEmbIni + , Max( prog.dtembarque ) AS DtEmbFim + , Min( prog.dtentrega ) AS DtEntIni + , Max( prog.dtentrega ) AS DtEntFim + , COUNT(prog.*) AS QtSem + , SUM( CASE WHEN Prog.DtSemeio >= '20060814' THEN 1 ELSE 0 END ) +AS QtSemAb +FROM bvz.Contrato + LEFT OUTER JOIN bvz.Prog ON prog.Fk_Contrato = Contrato.Id +WHERE Contrato.Fk_Clifor = 352 +GROUP BY 1; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------- + GroupAggregate (cost=2.16..4588.74 rows=28 width=48) (actual +time=2.196..7.027 rows=28 loops=1) + -> Nested Loop Left Join (cost=2.16..4574.63 rows=587 width=48) +(actual time=2.042..6.154 rows=223 loops=1) + -> Index Scan using pk_contrato on contrato +(cost=0.00..100.92 rows=28 width=4) (actual time=1.842..3.045 rows=28 +loops=1) + Filter: (fk_clifor = 352) + -> Bitmap Heap Scan on prog (cost=2.16..159.19 rows=47 +width=48) (actual time=0.040..0.080 rows=8 loops=28) + Recheck Cond: (prog.fk_contrato = "outer".id) + -> Bitmap Index Scan on fki_prog_contrato +(cost=0.00..2.16 rows=47 width=0) (actual time=0.018..0.018 rows=8 loops=28) + Index Cond: (prog.fk_contrato = "outer".id) + Total runtime: 7.209 ms + + + +I think that the problem is in "LEFT OUTER JOIN" because when I run the +queries with a inner join I have more consistent times, +although the query plan above is a champion : + + +EXPLAIN ANALYZE +SELECT Contrato.Id + , Min( prog.dtsemeio ) AS DtSemIni + , Max( prog.dtsemeio ) AS DtSemFim + , Min( prog.dtembarque ) AS DtEmbIni + , Max( prog.dtembarque ) AS DtEmbFim + , Min( prog.dtentrega ) AS DtEntIni + , Max( prog.dtentrega ) AS DtEntFim + , COUNT(prog.*) AS QtSem + , SUM( CASE WHEN Prog.DtSemeio >= '20060814' THEN 1 ELSE 0 END ) +AS QtSemAb +FROM bvz.Contrato + JOIN bvz.Prog ON prog.Fk_Contrato = Contrato.Id +WHERE Contrato.Fk_Clifor = 243 +GROUP BY 1; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ + HashAggregate (cost=1825.38..1826.71 rows=41 width=48) (actual +time=222.671..222.788 rows=41 loops=1) + -> Hash Join (cost=49.40..1806.03 rows=860 width=48) (actual +time=2.040..217.963 rows=1366 loops=1) + Hash Cond: ("outer".fk_contrato = "inner".id) + -> Seq Scan on prog (cost=0.00..1548.02 rows=40002 width=48) +(actual time=0.047..150.636 rows=40002 loops=1) + -> Hash (cost=49.29..49.29 rows=41 width=4) (actual +time=0.766..0.766 rows=41 loops=1) + -> Bitmap Heap Scan on contrato (cost=2.14..49.29 +rows=41 width=4) (actual time=0.146..0.669 rows=41 loops=1) + Recheck Cond: (fk_clifor = 243) + -> Bitmap Index Scan on fki_contrato_clifor +(cost=0.00..2.14 rows=41 width=0) (actual time=0.101..0.101 rows=41 loops=1) + Index Cond: (fk_clifor = 243) + Total runtime: 223.230 ms + + +EXPLAIN ANALYZE +SELECT Contrato.Id + , Min( prog.dtsemeio ) AS DtSemIni + , Max( prog.dtsemeio ) AS DtSemFim + , Min( prog.dtembarque ) AS DtEmbIni + , Max( prog.dtembarque ) AS DtEmbFim + , Min( prog.dtentrega ) AS DtEntIni + , Max( prog.dtentrega ) AS DtEntFim + , COUNT(prog.*) AS QtSem + , SUM( CASE WHEN Prog.DtSemeio >= '20060814' THEN 1 ELSE 0 END ) +AS QtSemAb +FROM bvz.Contrato + JOIN bvz.Prog ON prog.Fk_Contrato = Contrato.Id +WHERE Contrato.Fk_Clifor = 352 +GROUP BY 1; + QUERY +PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ + HashAggregate (cost=1811.50..1812.41 rows=28 width=48) (actual +time=215.214..215.291 rows=28 loops=1) + -> Hash Join (cost=44.39..1798.29 rows=587 width=48) (actual +time=3.853..214.178 rows=223 loops=1) + Hash Cond: ("outer".fk_contrato = "inner".id) + -> Seq Scan on prog (cost=0.00..1548.02 rows=40002 width=48) +(actual time=0.075..150.701 rows=40002 loops=1) + -> Hash (cost=44.32..44.32 rows=28 width=4) (actual +time=0.248..0.248 rows=28 loops=1) + -> Bitmap Heap Scan on contrato (cost=2.10..44.32 +rows=28 width=4) (actual time=0.111..0.187 rows=28 loops=1) + Recheck Cond: (fk_clifor = 352) + -> Bitmap Index Scan on fki_contrato_clifor +(cost=0.00..2.10 rows=28 width=0) (actual time=0.101..0.101 rows=28 loops=1) + Index Cond: (fk_clifor = 352) + Total runtime: 215.483 ms + +Well, in this case the queries with LEFT OUTER join and with inner join +returns the same result set. I don�t have the sufficient knowledge to +affirm , but I suspect that if the query plan used for fk_clifor = 352 +and with left outer join is applied for the first query (fk_clifor = 243 +with left outer join) +we will have a better total runtime. +There are some manner to make this test ? +By the way (If this is a stupid idea, ignore this), this same (or a +similar) query plan cannot be used in the queries with inner join since +the difference in times ( 215.483 ms vs 7.209 ms) still significative ? + + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 00:02:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CB23B9FB31B + for ; + Wed, 16 Aug 2006 00:02:27 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 49415-02 for + ; + Wed, 16 Aug 2006 00:02:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id A55D39FB32D + for ; + Wed, 16 Aug 2006 00:02:12 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7G30sZv028556; + Tue, 15 Aug 2006 23:00:54 -0400 (EDT) +To: "Steinar H. Gunderson" +cc: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +In-reply-to: <20060815222323.GA18180@uio.no> +References: <20060814170545.GG27928@pervasive.com> + <20060814170902.GN2900@mathom.us> + <20060815162926.GS27928@pervasive.com> + <20060815172645.GU2900@mathom.us> + <20060815183327.GC12834@mark.mielke.cc> + <20060815190254.GW2900@mathom.us> + <20060815193951.GA13695@mark.mielke.cc> + <20060815205857.GY2900@mathom.us> + <20060815213842.GA15210@mark.mielke.cc> + <20060815222024.GV21363@pervasive.com> + <20060815222323.GA18180@uio.no> +Comments: In-reply-to "Steinar H. Gunderson" + message dated "Wed, 16 Aug 2006 00:23:23 +0200" +Date: Tue, 15 Aug 2006 23:00:54 -0400 +Message-ID: <28555.1155697254@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.185 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/259 +X-Sequence-Number: 20444 + +"Steinar H. Gunderson" writes: +> On Tue, Aug 15, 2006 at 05:20:25PM -0500, Jim C. Nasby wrote: +>> This is only valid if the pre-allocation is also fsync'd *and* fsync +>> ensures that both the metadata and file data are on disk. Anyone +>> actually checked that? :) + +> fsync() does that, yes. fdatasync() (if it exists), OTOH, doesn't sync the +> metadata. + +Well, the POSIX spec says that fsync should do that ;-) + +My guess is that most/all kernel filesystem layers do indeed try to sync +everything that the spec says they should. The Achilles' heel of the +whole business is disk drives that lie about write completion. The +kernel is just as vulnerable to that as any application ... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 16 03:18:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id F31D19FB27B + for ; + Wed, 16 Aug 2006 03:17:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 11529-09 for + ; + Wed, 16 Aug 2006 03:17:53 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exprod6og52.obsmtp.com (exprod6og52.obsmtp.com [64.18.1.185]) + by postgresql.org (Postfix) with SMTP id 2083B9FB1F8 + for ; + Wed, 16 Aug 2006 03:17:52 -0300 (ADT) +Received: from source ([63.240.6.46]) by exprod6ob52.postini.com + ([64.18.5.12]) with SMTP; Tue, 15 Aug 2006 23:17:43 PDT +Received: from 172.16.1.25 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Wed, 16 Aug 2006 02:17:36 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 16 Aug + 2006 02:17:36 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Wed, 16 Aug + 2006 06:17:35 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Tue, 15 Aug 2006 23:17:32 -0700 +Subject: Re: Dell PowerEdge 2950 performance +From: "Luke Lonergan" +To: "Bucky Jordan" , "Vivek Khera" , + "Pgsql-Performance ((E-mail))" +Message-ID: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: AcbAn4h2d1PVc/GzRBy+xnSYs+pzfgACNZ0QABTSWog= +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D4104A01@MAIL.corp.lumeta.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 16 Aug 2006 06:17:36.0623 (UTC) + FILETIME=[AB14CFF0:01C6C0FB] +X-WSS-ID: 68FC670A2NG1826753-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.657 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/260 +X-Sequence-Number: 20445 + +Cool - seems like the posters caught that "auto memory pick" problem before +you posted, but you got the 16GB/8k parts right. + +Now we're looking at realistic numbers - 790 seeks/second, 244MB/s +sequential write, but only 144MB/s sequential reads, perhaps 60% of what it +should be. + +Seems like a pretty good performer in general - if it was Linux I'd play +with the max readahead in the I/O scheduler to improve the sequential reads. + +- Luke + + +On 8/15/06 1:21 PM, "Bucky Jordan" wrote: + +> Luke, +> +> For some reason it looks like bonnie is picking a 300M file. +> +>> bonnie++ -d bonnie +> Version 1.03 ------Sequential Output------ --Sequential Input- +> --Random- +> -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +> --Seeks-- +> Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +> /sec %CP +> 300M 179028 99 265358 41 270175 57 167989 99 +++++ +++ +> +++++ +++ +> ------Sequential Create------ --------Random +> Create-------- +> -Create-- --Read--- -Delete-- -Create-- --Read--- +> -Delete-- +> files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +> /sec %CP +> 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +> +++++ +++ +> ,300M,179028,99,265358,41,270175,57,167989,99,+++++,+++,+++++,+++,16,+++ +> ++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> +> So here's results when I force it to use a 16GB file, which is twice the +> amount of physical ram in the system: +> +>> bonnie++ -d bonnie -s 16000:8k +> Version 1.03 ------Sequential Output------ --Sequential Input- +> --Random- +> -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +> --Seeks-- +> Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +> /sec %CP +> 16000M 158539 99 244430 50 58647 29 83252 61 144240 21 +> 789.8 7 +> ------Sequential Create------ --------Random +> Create-------- +> -Create-- --Read--- -Delete-- -Create-- --Read--- +> -Delete-- +> files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +> /sec %CP +> 16 7203 54 +++++ +++ +++++ +++ 24555 42 +++++ +++ +> +++++ +++ +> ,16000M,158539,99,244430,50,58647,29,83252,61,144240,21,789.8,7,16,7203, +> 54,+++++,+++,+++++,+++,24555,42,+++++,+++,+++++,+++ +> +> ... from Vivek... +> which is an issue with freebsd and bonnie++ since it doesn't know +> that freebsd can use large files natively (ie, no large file hacks +> necessary). the freebsd port of bonnie takes care of this, if you +> use that instead of compiling your own. +> ... +> +> Unfortunately I had to download and build by hand, since only bonnie++ +> 1.9x is available in BSD 6.1 ports when I checked. +> +> One other question- would the following also be mostly a test of RAM? I +> wouldn't think so since it should force it to sync to disk... +> time bash -c "(dd if=/dev/zero of=/data/bigfile count=125000 bs=8k && +> sync)" +> +> Oh, and while I'm thinking about it, I believe Postgres uses 8k data +> pages correct? On the RAID, I'm using 128k stripes. I know there's been +> posts on this before, but is there any way to tell postgres to use this +> in an effective way? +> +> Thanks, +> +> Bucky +> +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Vivek Khera +> Sent: Tuesday, August 15, 2006 3:18 PM +> To: Pgsql-Performance ((E-mail)) +> Subject: Re: [PERFORM] Dell PowerEdge 2950 performance +> +> +> On Aug 15, 2006, at 2:50 PM, Luke Lonergan wrote: +> +>> I don't know why I missed this the first time - you need to let +>> bonnie++ +>> pick the file size - it needs to be 2x memory or the results you +>> get will +>> not be accurate. +> +> which is an issue with freebsd and bonnie++ since it doesn't know +> that freebsd can use large files natively (ie, no large file hacks +> necessary). the freebsd port of bonnie takes care of this, if you +> use that instead of compiling your own. +> +> + + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 05:33:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B67A39FB30A + for ; + Wed, 16 Aug 2006 05:33:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 21816-01 for + ; + Wed, 16 Aug 2006 05:33:23 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 0CC609FB2B5 + for ; + Wed, 16 Aug 2006 05:33:23 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D2216.dip0.t-ipconnect.de + [84.157.34.22]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 5BB1765942 + for ; + Wed, 16 Aug 2006 10:35:24 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id DCC4E1853ECD0 + for ; + Wed, 16 Aug 2006 10:33:39 +0200 (CEST) +Message-ID: <44E2D863.3060707@logix-tt.com> +Date: Wed, 16 Aug 2006 10:33:39 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +References: <3E37B936B592014B978C4415F90D662D03FFEF6E@MI8NYCMAIL06.Mi8.com> + <721b21dc0608082245u6ee62e7dg522ff18e4d72683@mail.gmail.com> + <20060809210539.GR40481@pervasive.com> + <1155180553.13315.0.camel@amd64-gentoo-laptop> + <20060810110935.GF2900@mathom.us> + <20060814153841.GF27928@pervasive.com> + <20060814170338.GM2900@mathom.us> + <20060815162524.GR27928@pervasive.com> +In-Reply-To: <20060815162524.GR27928@pervasive.com> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.173 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/261 +X-Sequence-Number: 20446 + +Hi, Jim, + +Jim C. Nasby wrote: + +> Well, if the controller is caching with a BBU, I'm not sure that order +> matters anymore, because the controller should be able to re-order at +> will. Theoretically. :) But this is why having some actual data posted +> somewhere would be great. + +Well, actually, the controller should not reorder over write barriers. + + +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Wed Aug 16 06:13:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C95739FB2B5 + for ; + Wed, 16 Aug 2006 06:13:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 03862-04 for + ; + Wed, 16 Aug 2006 09:13:10 +0000 (UTC) +X-Greylist: delayed 00:20:25.555633 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 39D2A9FB1C8 + for ; + Wed, 16 Aug 2006 06:13:09 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) + by svr4.postgresql.org (Postfix) with ESMTP id 3D5CE5AF881 + for ; + Wed, 16 Aug 2006 08:52:42 +0000 (GMT) +Received: from localhost (localhost [127.0.0.1]) + by mail.mnc.ch (Postfix) with ESMTP id 88B7BA82ED; + Wed, 16 Aug 2006 10:57:21 +0200 (CEST) +Received: from mail.mnc.ch ([127.0.0.1]) + by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, + port 10025) with ESMTP + id 31383-05; Wed, 16 Aug 2006 10:57:19 +0200 (CEST) +Received: from meuh.mnc.lan (62-2-77-204.static.cablecom.ch [62.2.77.204]) + by mail.mnc.ch (Postfix) with ESMTP id 29066A82F3; + Wed, 16 Aug 2006 10:57:19 +0200 (CEST) +Received: by meuh.mnc.lan (Postfix, from userid 1000) + id 14D98183663; Wed, 16 Aug 2006 10:52:25 +0200 (CEST) +To: "Luke Lonergan" +Cc: pgsql-performance@postgresql.org +Subject: Re: Postgresql Performance on an HP DL385 and +References: +X-Hashcash: + 1:20:060816:llonergan@greenplum.com::+eQJ7Tb2zl7sxo02:000000000000000000000000000000000000001VbI +X-Hashcash: + 1:20:060816:pgsql-performance@postgresql.org::t8x6h0YAzwM22Baa:000000000000000000000000000004kEI +From: Guillaume Cottenceau +Date: 16 Aug 2006 10:52:25 +0200 +In-Reply-To: +Message-ID: <87psf1rrjq.fsf@meuh.mnc.lan> +Lines: 18 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: amavisd-new at mnc.ch +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/262 +X-Sequence-Number: 20447 + +Hi, + +> Can you run bonnie++ version 1.03a on the machine and report the results +> here? + +Do you know if the figures from bonnie++ are able to measure the +performance related to the overhead of the 'fsync' option? I had +very strange performance differences between two Dell 1850 +machines months ago, and raw performance (hdparm, not bonnie++) +was similar, the only figure I could find with a significant +difference able to explain the issue was the "await" compound +reported by "iostat" - but I was still very much in the dark :/ + +http://archives.postgresql.org/pgsql-performance/2006-03/msg00407.php + +-- +Guillaume Cottenceau +Create your personal SMS or WAP Service - visit http://mobilefriends.ch/ + +From pgsql-performance-owner@postgresql.org Wed Aug 16 11:35:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 784239FA7BA + for ; + Wed, 16 Aug 2006 11:35:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 45002-07 for + ; + Wed, 16 Aug 2006 11:35:02 -0300 (ADT) +X-Greylist: delayed 00:59:58.605956 by SQLgrey- +Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) + by postgresql.org (Postfix) with ESMTP id 3587A9FA65C + for ; + Wed, 16 Aug 2006 11:35:01 -0300 (ADT) +X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway +X-GR-Acctd: YES +Received: from [67.90.96.2] (HELO DaveEMachine) + by globalrelay.com (CommuniGate Pro SMTP 4.2.3) + with ESMTP id 100735860; Wed, 16 Aug 2006 06:34:59 -0700 +From: "Dave Dutcher" +To: "'Luiz K. Matsumura'" , + +Subject: Re: Big diference in response time (query plan question) +Date: Wed, 16 Aug 2006 08:34:59 -0500 +Message-ID: <00a501c6c138$c55725b0$8300a8c0@tridecap.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 +Importance: Normal +In-Reply-To: <44E26939.30903@planit.com.br> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/264 +X-Sequence-Number: 20449 + + +> From: pgsql-performance-owner@postgresql.org=20 +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of=20 +> Luiz K. Matsumura + +> Well, in this case the queries with LEFT OUTER join and with=20 +> inner join=20 +> returns the same result set. I don=B4t have the sufficient knowledge = +to +> affirm , but I suspect that if the query plan used for=20 +> fk_clifor =3D 352=20 +> and with left outer join is applied for the first query=20 +> (fk_clifor =3D 243=20 +> with left outer join) +> we will have a better total runtime. +> There are some manner to make this test ? + +It looks like Postgres used a nested loop join for the fast query and a +merge join for the slow query. I don't think the left join is causing = +any +problems. On the slower query the cost estimate of the nested loop must +have been higher than the cost estimate of the merge join because of = +more +rows. You could try disabling merge joins with the command "set +enable_mergejoin=3Dfalse". Then run the explain analyze again to see if = +it is +faster. =20 + +If it is faster without merge join, then you could try to change your +settings to make the planner prefer the nested loop. I'm not sure what = +the +best way to do that is. Maybe you could try reducing the = +random_page_cost, +which should make index scans cheaper. + +Dave + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 11:24:48 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id B56009FA65C + for ; + Wed, 16 Aug 2006 11:24:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 88085-05 for + ; + Wed, 16 Aug 2006 14:24:40 +0000 (UTC) +X-Greylist: delayed 13:45:06.610486 by SQLgrey- +Received: from andromeda1.neonex.com.br (dns3.neonex.com.br [201.28.22.10]) + by postgresql.org (Postfix) with ESMTP id EA8DF9FB30E + for ; + Wed, 16 Aug 2006 11:24:39 -0300 (ADT) +Received: from 200-168-31-181.dsl.telesp.net.br ([200.168.31.181] + helo=[127.0.0.1]) by andromeda1.neonex.com.br with esmtpa (Exim 4.62) + (envelope-from ) + id 1GDMK2-0004Si-8Z; Wed, 16 Aug 2006 11:24:43 -0300 +Message-ID: <44E32AA5.5090901@planit.com.br> +Date: Wed, 16 Aug 2006 11:24:37 -0300 +From: "Luiz K. Matsumura" +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Dave Dutcher +CC: pgsql-performance@postgresql.org +Subject: Re: Big diference in response time (query plan question) +References: <00a501c6c138$c55725b0$8300a8c0@tridecap.com> +In-Reply-To: <00a501c6c138$c55725b0$8300a8c0@tridecap.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 8bit +X-Antivirus: avast! (VPS 0633-2, 08/16/2006), Outbound message +X-Antivirus-Status: Clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/263 +X-Sequence-Number: 20448 + +Hi Dave, +Thanks to reply. +I run it now in a Postgres 8.1.4 my notebook (win XP) and the +performance is really much better: + +EXPLAIN ANALYZE +SELECT Contrato.Id + , Min( prog.dtsemeio ) AS DtSemIni + , Max( prog.dtsemeio ) AS DtSemFim + , Min( prog.dtembarque ) AS DtEmbIni + , Max( prog.dtembarque ) AS DtEmbFim + , Min( prog.dtentrega ) AS DtEntIni + , Max( prog.dtentrega ) AS DtEntFim + , COUNT(prog.*) AS QtSem + , SUM( CASE WHEN Prog.DtSemeio >= '20060814' THEN 1 ELSE 0 END ) +AS QtSemAb +FROM bvz.Contrato + LEFT OUTER JOIN bvz.Prog ON prog.Fk_Contrato = Contrato.Id +WHERE Contrato.Fk_Clifor = 243 +GROUP BY 1; + +GroupAggregate (cost=2.18..7312.45 rows=42 width=48) (actual +time=0.446..13.195 rows=42 loops=1) + -> Nested Loop Left Join (cost=2.18..7291.22 rows=883 width=48) +(actual time=0.103..10.518 rows=1536 loops=1) + -> Index Scan using pk_contrato on contrato (cost=0.00..100.29 +rows=42 width=4) (actual time=0.048..3.163 rows=42 loops=1) + Filter: (fk_clifor = 243) + -> Bitmap Heap Scan on prog (cost=2.18..170.59 rows=50 +width=48) (actual time=0.027..0.132 rows=37 loops=42) + Recheck Cond: (prog.fk_contrato = "outer".id) + -> Bitmap Index Scan on fki_prog_contrato +(cost=0.00..2.18 rows=50 width=0) (actual time=0.018..0.018 rows=37 +loops=42) + Index Cond: (prog.fk_contrato = "outer".id) +Total runtime: 13.399 ms + +Where I can see the current random_page_cost value ? There are some hint +about what value I must set ? +Thanks in advance. +Luiz + +Dave Dutcher wrote: +>> Well, in this case the queries with LEFT OUTER join and with +>> inner join +>> returns the same result set. I don�t have the sufficient knowledge to +>> affirm , but I suspect that if the query plan used for +>> fk_clifor = 352 +>> and with left outer join is applied for the first query +>> (fk_clifor = 243 +>> with left outer join) +>> we will have a better total runtime. +>> There are some manner to make this test ? +>> +> +> It looks like Postgres used a nested loop join for the fast query and a +> merge join for the slow query. I don't think the left join is causing any +> problems. On the slower query the cost estimate of the nested loop must +> have been higher than the cost estimate of the merge join because of more +> rows. You could try disabling merge joins with the command "set +> enable_mergejoin=false". Then run the explain analyze again to see if it is +> faster. +> +> If it is faster without merge join, then you could try to change your +> settings to make the planner prefer the nested loop. I'm not sure what the +> best way to do that is. Maybe you could try reducing the random_page_cost, +> which should make index scans cheaper. +> +> Dave +> + +From pgsql-performance-owner@postgresql.org Wed Aug 16 11:45:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4DA2A9FA65C + for ; + Wed, 16 Aug 2006 11:45:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 97691-03 for + ; + Wed, 16 Aug 2006 14:45:18 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by postgresql.org (Postfix) with ESMTP id 704DC9FB271 + for ; + Wed, 16 Aug 2006 11:45:18 -0300 (ADT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Dell PowerEdge 2950 performance +Date: Wed, 16 Aug 2006 10:45:13 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104A1F@MAIL.corp.lumeta.com> +In-Reply-To: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Dell PowerEdge 2950 performance +Thread-Index: AcbAn4h2d1PVc/GzRBy+xnSYs+pzfgACNZ0QABTSWogADxTzcA== +From: "Bucky Jordan" +To: "Luke Lonergan" , + "Pgsql-Performance \(\(E-mail\)\)" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/265 +X-Sequence-Number: 20450 + +Luke, + +Thanks for the tips. I'm running FreeBSD 6.1 amd64, but, I can also +enable readahead on the raid controller, and also adaptive readahead. +Here's tests: + +Readahead & writeback enabled: +bash-2.05b$ bonnie++ -d bonnie -s 16000:8k +Version 1.03 ------Sequential Output------ --Sequential Input- +--Random- + -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 16000M 156512 98 247520 47 59560 27 83138 60 143588 21 +792.8 7 + ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 +++++ +++ +++++ +++ 27789 99 +++++ +++ +++++ +++ ++++++ +++ +,16000M,156512,98,247520,47,59560,27,83138,60,143588,21,792.8,7,16,+++++ +,+++,+++++,+++,27789,99,+++++,+++,+++++,+++,+++++,+++ + + +Writeback and Adaptive Readahead: +bash-2.05b$ bonnie++ -d bonnie -s 16000:8k +Version 1.03 ------Sequential Output------ --Sequential Input- +--Random- + -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP +16000M 155542 97 246910 47 60356 26 82798 60 143321 21 787.3 6 + ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 6329 49 +++++ +++ +++++ +++ +++++ +++ +++++ +++ ++++++ +++ +,16000M,155542,97,246910,47,60356,26,82798,60,143321,21,787.3,6,16,6329, +49,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ + + +(As a side note- according to the controller docs, Adaptive read ahead +reads ahead sequentially if there are two reads from sequential sectors, +otherwise it doesn't). + +So, I'm thinking that the RAID controller doesn't really help with this +too much- I'd think the OS could do a better job deciding when to read +ahead. So, I've set it back to no readahead and the next step is to look +at OS level file system tuning. Also, if I have time, I'll try doing +RAID 1 on the controller, and RAID 0 on the OS (or vice versa). Since I +have 6 disks, I could do a stripe of 3 mirrored pairs (raid 10) or a +mirror of two striped sets of 3 (0+1). I suppose theoretically speaking, +they should have the same performance characteristics, however I doubt +they will in practice.=20 + +Thanks, + +Bucky + +-----Original Message----- +From: Luke Lonergan [mailto:llonergan@greenplum.com]=20 +Sent: Wednesday, August 16, 2006 2:18 AM +To: Bucky Jordan; Vivek Khera; Pgsql-Performance ((E-mail)) +Subject: Re: [PERFORM] Dell PowerEdge 2950 performance + +Cool - seems like the posters caught that "auto memory pick" problem +before +you posted, but you got the 16GB/8k parts right. + +Now we're looking at realistic numbers - 790 seeks/second, 244MB/s +sequential write, but only 144MB/s sequential reads, perhaps 60% of what +it +should be. + +Seems like a pretty good performer in general - if it was Linux I'd play +with the max readahead in the I/O scheduler to improve the sequential +reads. + +- Luke + + +On 8/15/06 1:21 PM, "Bucky Jordan" wrote: + +> Luke, +>=20 +> For some reason it looks like bonnie is picking a 300M file. +>=20 +>> bonnie++ -d bonnie +> Version 1.03 ------Sequential Output------ --Sequential Input- +> --Random- +> -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +> --Seeks-- +> Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +> /sec %CP +> 300M 179028 99 265358 41 270175 57 167989 99 +++++ +++ +> +++++ +++ +> ------Sequential Create------ --------Random +> Create-------- +> -Create-- --Read--- -Delete-- -Create-- --Read--- +> -Delete-- +> files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +> /sec %CP +> 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +> +++++ +++ +> +,300M,179028,99,265358,41,270175,57,167989,99,+++++,+++,+++++,+++,16,+++ +> ++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +>=20 +> So here's results when I force it to use a 16GB file, which is twice +the +> amount of physical ram in the system: +>=20 +>> bonnie++ -d bonnie -s 16000:8k +> Version 1.03 ------Sequential Output------ --Sequential Input- +> --Random- +> -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +> --Seeks-- +> Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +> /sec %CP +> 16000M 158539 99 244430 50 58647 29 83252 61 144240 21 +> 789.8 7 +> ------Sequential Create------ --------Random +> Create-------- +> -Create-- --Read--- -Delete-- -Create-- --Read--- +> -Delete-- +> files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +> /sec %CP +> 16 7203 54 +++++ +++ +++++ +++ 24555 42 +++++ +++ +> +++++ +++ +> +,16000M,158539,99,244430,50,58647,29,83252,61,144240,21,789.8,7,16,7203, +> 54,+++++,+++,+++++,+++,24555,42,+++++,+++,+++++,+++ +>=20 +> ... from Vivek... +> which is an issue with freebsd and bonnie++ since it doesn't know +> that freebsd can use large files natively (ie, no large file hacks +> necessary). the freebsd port of bonnie takes care of this, if you +> use that instead of compiling your own. +> ... +>=20 +> Unfortunately I had to download and build by hand, since only bonnie++ +> 1.9x is available in BSD 6.1 ports when I checked. +>=20 +> One other question- would the following also be mostly a test of RAM? +I +> wouldn't think so since it should force it to sync to disk... +> time bash -c "(dd if=3D/dev/zero of=3D/data/bigfile count=3D125000 = +bs=3D8k && +> sync)" +>=20 +> Oh, and while I'm thinking about it, I believe Postgres uses 8k data +> pages correct? On the RAID, I'm using 128k stripes. I know there's +been +> posts on this before, but is there any way to tell postgres to use +this +> in an effective way? +>=20 +> Thanks, +>=20 +> Bucky +>=20 +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Vivek +Khera +> Sent: Tuesday, August 15, 2006 3:18 PM +> To: Pgsql-Performance ((E-mail)) +> Subject: Re: [PERFORM] Dell PowerEdge 2950 performance +>=20 +>=20 +> On Aug 15, 2006, at 2:50 PM, Luke Lonergan wrote: +>=20 +>> I don't know why I missed this the first time - you need to let +>> bonnie++ +>> pick the file size - it needs to be 2x memory or the results you +>> get will +>> not be accurate. +>=20 +> which is an issue with freebsd and bonnie++ since it doesn't know +> that freebsd can use large files natively (ie, no large file hacks +> necessary). the freebsd port of bonnie takes care of this, if you +> use that instead of compiling your own. +>=20 +>=20 + + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 11:51:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5F07C9FA65C + for ; + Wed, 16 Aug 2006 11:51:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 46638-03 for + ; + Wed, 16 Aug 2006 11:51:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) + by postgresql.org (Postfix) with ESMTP id 9191D9FA7BA + for ; + Wed, 16 Aug 2006 11:51:12 -0300 (ADT) +X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway +X-GR-Acctd: YES +Received: from [67.90.96.2] (HELO DaveEMachine) + by globalrelay.com (CommuniGate Pro SMTP 4.2.3) + with ESMTP id 100745039; Wed, 16 Aug 2006 07:51:10 -0700 +From: "Dave Dutcher" +To: "'Luiz K. Matsumura'" +Cc: +Subject: Re: Big diference in response time (query plan question) +Date: Wed, 16 Aug 2006 09:51:09 -0500 +Message-ID: <00ab01c6c143$69499f40$8300a8c0@tridecap.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 +Importance: Normal +In-Reply-To: <44E32AA5.5090901@planit.com.br> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/266 +X-Sequence-Number: 20451 + + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org=20 +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of=20 +> Luiz K. Matsumura +>=20 +>=20 +> Where I can see the current random_page_cost value ? There=20 +> are some hint=20 +> about what value I must set ? +> Thanks in advance. +> Luiz + +On Linux the random_page_cost is set in the postgresql.conf file. You = +can +see what it is set to by typing "show random_page_cost". This page has = +some +guidelines on random_page_cost and other server settings: + +http://www.powerpostgresql.com/PerfList/ + +As it says on the page, make sure you test a variety of queries. + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 14:14:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D36219FB2C2 + for ; + Wed, 16 Aug 2006 14:14:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 54388-06 for + ; + Wed, 16 Aug 2006 17:14:45 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.184]) + by postgresql.org (Postfix) with ESMTP id 66EDD9FB2A1 + for ; + Wed, 16 Aug 2006 14:14:43 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id p77so828439nfc + for ; + Wed, 16 Aug 2006 10:14:41 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; + b=NWOK20wmauts2PmK6D7HWunUEjTbTlV7n5SSaWC2PXmYEJEWk7Cc8oBcansSkpvLwkKR5cw3p7nu+WFrvOfvGB1+17tm5NXWBP7k/z3HBcFGKijAS1dWBFJn9gqexCb3PX8KxqNMtKJyKipsj3JBhviocTUdcxKH2XIHwli9an0= +Received: by 10.49.29.3 with SMTP id g3mr864519nfj; + Wed, 16 Aug 2006 08:34:24 -0700 (PDT) +Received: by 10.78.158.10 with HTTP; Wed, 16 Aug 2006 08:34:24 -0700 (PDT) +Message-ID: +Date: Wed, 16 Aug 2006 09:34:24 -0600 +From: "Carl Youngblood" +To: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +In-Reply-To: <20060815192145.GI21363@pervasive.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: + <44DAFB2B.4070307@archonet.com> <20060815150529.GO27928@pervasive.com> + + <20060815192145.GI21363@pervasive.com> +X-Google-Sender-Auth: 20e444ec5012ccc0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/267 +X-Sequence-Number: 20452 + +The relevant portion of my sysctl.conf file looks like this: + +kernel.shmall = 2097152 +kernel.shmmax = 2147483648 +kernel.shmmni = 4096 +kernel.sem = 250 32000 100 128 +fs.file-max = 65536 + +I understood it was a good idea to set shmmax to half of available +memory (2GB in this case). I assume that I need to set shared_buffers +slightly lower than 2GB for postgresql to start successfully. + +Carl + +On 8/15/06, Jim C. Nasby wrote: +> On Tue, Aug 15, 2006 at 12:47:54PM -0600, Carl Youngblood wrote: +> > I tried setting it to 2GB and postgres wouldn't start. Didn't +> > investigate in much greater detail as to why it wouldn't start, but +> > after switching it back to 1GB it started fine. +> +> Most likely because you didn't set the kernel's shared memory settings +> high enough. + +From pgsql-performance-owner@postgresql.org Wed Aug 16 14:50:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 60DBD9FB343 + for ; + Wed, 16 Aug 2006 14:50:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 65896-02-4 + for ; + Wed, 16 Aug 2006 14:50:29 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 727989FB3A8 + for ; + Wed, 16 Aug 2006 14:49:53 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by svr4.postgresql.org (Postfix) with ESMTP id 419285AFA9D + for ; + Wed, 16 Aug 2006 16:50:25 +0000 (GMT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) id 1GDOaz-0005Uz-Mz + for pgsql-performance@postgresql.org; Wed, 16 Aug 2006 17:50:21 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7GGoK5o005937 + for ; Wed, 16 Aug 2006 17:50:21 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.10.10/419]); + Wed, 16 Aug 2006 17:48:13 +0100 +From: "Peter Hardman" +To: pgsql-performance@postgresql.org +Date: Wed, 16 Aug 2006 17:48:13 +0100 +MIME-Version: 1.0 +Subject: PostgreSQL runs a query much slower than BDE and MySQL +Message-ID: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/268 +X-Sequence-Number: 20453 + +I'm in the process of migrating a Paradox 7/BDE 5.01 database from single-user +Paradox to a web based interface to either MySQL or PostgreSQL. +The database is a pedigree sheep breed society database recording sheep and +flocks (amongst other things). + +My current problem is with one table and an associated query which takes 10 +times longer to execute on PostgreSQL than BDE, which in turn takes 10 times +longer than MySQL. The table links sheep to flocks and is created as follows: + +CREATE TABLE SHEEP_FLOCK +( + regn_no varchar(7) NOT NULL, + flock_no varchar(6) NOT NULL, + transfer_date date NOT NULL, + last_changed date NOT NULL, + CONSTRAINT SHEEP_FLOCK_pkey PRIMARY KEY (regn_no, flock_no, +transfer_date) +) +WITHOUT OIDS; +ALTER TABLE SHEEP_FLOCK OWNER TO postgres; + +I then populate the table with + +COPY SHEEP_FLOCK +FROM 'e:/ssbg/devt/devt/export_data/sheep_flock.txt' +WITH CSV HEADER + +The table then has about 82000 records + +The query I run is: + +/* Select all sheep who's most recent transfer was into the subject flock */ +SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +FROM SHEEP_FLOCK f1 JOIN + /* The last transfer date for each sheep */ + (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date + FROM SHEEP_FLOCK f + GROUP BY f.regn_no) f2 +ON f1.regn_no = f2.regn_no +WHERE f1.flock_no = '1359' +AND f1.transfer_date = f2.last_xfer_date + +The sub-select on it's own returns about 32000 rows. + +Using identically structured tables and the same primary key, if I run this on +Paradox/BDE it takes about 120ms, on MySQL (5.0.24, local server) about 3ms, +and on PostgresSQL (8.1.3, local server) about 1290ms). All on the same +Windows XP Pro machine with 512MB ram of which nearly half is free. + +The query plan shows most of the time is spent sorting the 30000+ rows from the subquery, so I added a further +subquery as follows: + +/* Select all sheep who's most recent transfer was into the subject flock */ +SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +FROM SHEEP_FLOCK f1 JOIN + /* The last transfer date for each sheep */ + (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date + FROM SHEEP_FLOCK f + WHERE f.regn_no IN + /* Limit the rows extracted by the outer sub-query to those relevant to the +subject flock */ + /* This typically reduces the time from 1297ms to 47ms - from 35000 rows +to 127 rows */ + (SELECT s.regn_no FROM SHEEP_FLOCK s where s.flock_no = '1359') + GROUP BY f.regn_no) f2 +ON f1.regn_no = f2.regn_no +WHERE f1.flock_no = '1359' +AND f1.transfer_date = f2.last_xfer_date + +then as the comment suggests I get a considerable improvement, but it's still an +order of magnitude slower than MySQL. + +Can anyone suggest why PostgreSQL performs the original query so much slower than even BDE? + -- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 15:02:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DCD129FB345 + for ; + Wed, 16 Aug 2006 15:02:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 66806-04 for + ; + Wed, 16 Aug 2006 15:02:26 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from olive.qinip.net (olive.qinip.net [62.100.30.40]) + by postgresql.org (Postfix) with ESMTP id A6DC39FB30D + for ; + Wed, 16 Aug 2006 15:02:26 -0300 (ADT) +Received: from [127.0.0.1] (h8441139206.dsl.speedlinq.nl [84.41.139.206]) + by olive.qinip.net (Postfix) with ESMTP id 8E793181F6; + Wed, 16 Aug 2006 20:02:21 +0200 (MEST) +Message-ID: <44E35DB0.8050109@tweakers.net> +Date: Wed, 16 Aug 2006 20:02:24 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Peter Hardman +CC: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +In-Reply-To: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Antivirus: avast! (VPS 0633-2, 16-08-2006), Outbound message +X-Antivirus-Status: Clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.184 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/269 +X-Sequence-Number: 20454 + +On 16-8-2006 18:48, Peter Hardman wrote: +> Using identically structured tables and the same primary key, if I run this on +> Paradox/BDE it takes about 120ms, on MySQL (5.0.24, local server) about 3ms, +> and on PostgresSQL (8.1.3, local server) about 1290ms). All on the same +> Windows XP Pro machine with 512MB ram of which nearly half is free. + +Is that with or without query caching? I.e. can you test it with SELECT +SQL_NO_CACHE ... ? +In a read-only environment it will still beat PostgreSQL, but as soon as +you'd get a read-write environment, MySQL's query cache is of less use. +So you should compare both the cached and non-cached version, if applicable. + +Besides that, most advices on this list are impossible without the +result of 'explain analyze', so you should probably get that as well. + +I'm not sure whether this is the same query, but you might want to try: +SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +FROM SHEEP_FLOCK f1 +WHERE +f1.flock_no = '1359' +AND f1.transfer_date = (SELECT MAX(f.transfer_date) FROM SHEEP_FLOCK f +WHERE regn_no = f1.regn_no) + +And you might need an index on (regn_no, transfer_date) and/or one +combined with that flock_no. + +Best regards, + +Arjen + +From pgsql-performance-owner@postgresql.org Wed Aug 16 15:02:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 7055C9FB30D + for ; + Wed, 16 Aug 2006 15:02:40 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 64398-07 for + ; + Wed, 16 Aug 2006 15:02:33 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wr-out-0506.google.com (wr-out-0506.google.com + [64.233.184.228]) + by postgresql.org (Postfix) with ESMTP id 4266F9FB340 + for ; + Wed, 16 Aug 2006 15:02:33 -0300 (ADT) +Received: by wr-out-0506.google.com with SMTP id 57so57990wri + for ; + Wed, 16 Aug 2006 11:02:32 -0700 (PDT) +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=YhS1eSKPlSloAdIty+Fz4c3a2GzxMU1O6xRJQHJ2RsBxsPL+TeC5zP417VlT5w5pFxGRe/TZjafQKpF2SceuQtDnBzArRUMjnZoYS1AphlW2yI/HGAFzVa7F5dJAwuXfuEPSHMCz7tvIgxWXeGyTjwIRQcBXYuF8a0xRGdUJk2E= +Received: by 10.67.100.12 with SMTP id c12mr498499ugm; + Wed, 16 Aug 2006 11:02:31 -0700 (PDT) +Received: by 10.66.234.16 with HTTP; Wed, 16 Aug 2006 11:02:31 -0700 (PDT) +Message-ID: +Date: Wed, 16 Aug 2006 12:02:31 -0600 +From: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +In-Reply-To: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/270 +X-Sequence-Number: 20455 + +On 8/16/06, Peter Hardman wrote: +> I'm in the process of migrating a Paradox 7/BDE 5.01 database from single-user +> Paradox to a web based interface to either MySQL or PostgreSQL. +> The database is a pedigree sheep breed society database recording sheep and +> flocks (amongst other things). +> +> My current problem is with one table and an associated query which takes 10 +> times longer to execute on PostgreSQL than BDE, which in turn takes 10 times +> longer than MySQL. The table links sheep to flocks and is created as follows: +> +> CREATE TABLE SHEEP_FLOCK +> ( +> regn_no varchar(7) NOT NULL, +> flock_no varchar(6) NOT NULL, +> transfer_date date NOT NULL, +> last_changed date NOT NULL, +> CONSTRAINT SHEEP_FLOCK_pkey PRIMARY KEY (regn_no, flock_no, +> transfer_date) +> ) +> WITHOUT OIDS; +> ALTER TABLE SHEEP_FLOCK OWNER TO postgres; +> +> I then populate the table with +> +> COPY SHEEP_FLOCK +> FROM 'e:/ssbg/devt/devt/export_data/sheep_flock.txt' +> WITH CSV HEADER +> +> The table then has about 82000 records +> +> The query I run is: +> +> /* Select all sheep who's most recent transfer was into the subject flock */ +> SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +> FROM SHEEP_FLOCK f1 JOIN +> /* The last transfer date for each sheep */ +> (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date +> FROM SHEEP_FLOCK f +> GROUP BY f.regn_no) f2 +> ON f1.regn_no = f2.regn_no +> WHERE f1.flock_no = '1359' +> AND f1.transfer_date = f2.last_xfer_date +> +> The sub-select on it's own returns about 32000 rows. +> +> Using identically structured tables and the same primary key, if I run this on +> Paradox/BDE it takes about 120ms, on MySQL (5.0.24, local server) about 3ms, +> and on PostgresSQL (8.1.3, local server) about 1290ms). All on the same +> Windows XP Pro machine with 512MB ram of which nearly half is free. +> +> The query plan shows most of the time is spent sorting the 30000+ rows from the subquery, so I added a further +> subquery as follows: +> +> /* Select all sheep who's most recent transfer was into the subject flock */ +> SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +> FROM SHEEP_FLOCK f1 JOIN +> /* The last transfer date for each sheep */ +> (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date +> FROM SHEEP_FLOCK f +> WHERE f.regn_no IN +> /* Limit the rows extracted by the outer sub-query to those relevant to the +> subject flock */ +> /* This typically reduces the time from 1297ms to 47ms - from 35000 rows +> to 127 rows */ +> (SELECT s.regn_no FROM SHEEP_FLOCK s where s.flock_no = '1359') +> GROUP BY f.regn_no) f2 +> ON f1.regn_no = f2.regn_no +> WHERE f1.flock_no = '1359' +> AND f1.transfer_date = f2.last_xfer_date +> +> then as the comment suggests I get a considerable improvement, but it's still an +> order of magnitude slower than MySQL. +> +> Can anyone suggest why PostgreSQL performs the original query so much slower than even BDE? + +ANALYZE? + +Regards, + +Rodrigo + +From pgsql-performance-owner@postgresql.org Wed Aug 16 15:27:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A32569FB345 + for ; + Wed, 16 Aug 2006 15:27:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 82988-02 for + ; + Wed, 16 Aug 2006 18:27:07 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from web36104.mail.mud.yahoo.com (web36104.mail.mud.yahoo.com + [66.163.179.218]) + by postgresql.org (Postfix) with SMTP id 0988F9FA5CD + for ; + Wed, 16 Aug 2006 15:27:06 -0300 (ADT) +Received: (qmail 96347 invoked by uid 60001); 16 Aug 2006 18:27:06 -0000 +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.ar; + h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; + b=zAobWsLpxakoE1i83ujKYTLFu6dTnVvkJwAZPU3Tqxpr9tHg34M+DcN9yVBZKO1lZiSqahmoCuQISItpy8SmGD0qmRo8pcbS/7B3t3J4UTp9qKt8Tr52S4hf5we95L2+OoaJJThVAMRMx8sopnTNr5liRe5F4dXoEjXYmam47d0= + ; +Message-ID: <20060816182705.96338.qmail@web36104.mail.mud.yahoo.com> +Received: from [200.49.144.50] by web36104.mail.mud.yahoo.com via HTTP; + Wed, 16 Aug 2006 18:27:05 GMT +Date: Wed, 16 Aug 2006 18:27:05 +0000 (GMT) +From: =?iso-8859-1?q?Sebasti=E1n=20Baioni?= +Reply-To: sebaioni-postgresql@yahoo.com.ar +Subject: Re: Inner Join of the same table +To: Performance PostgreSQL +In-Reply-To: <20384.1155676382@sss.pgh.pa.us> +MIME-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/271 +X-Sequence-Number: 20456 + +I had enable_seqscan turned OFF; With enable_seqscan turned ON it takes only 6 minutes to complete +the query and not 44minuts like it did with enable_seqscan turned OFF. THANKS A LOT! +It's still much more slower than MS SQL server but now it has acceptable times. + + Sebasti�n Baioni + + --- Tom Lane escribi�: +> Given the relatively small estimated number of group rows, I'd have +> expected the thing to use a seqscan and HashAggregate for this part. +> Do you have enable_hashagg turned off for some reason? Or enable_seqscan? +> +> regards, tom lane +> > Hello Jim, we can't use the Where cuiT='12345678901' in the subquery because we need max(cuiL) +independently of that cuiT: +> > cuiT cuiL PERI FAMI +> > 1 a 200608 0 +> > 1 a 200601 2 +> > 1 b 200607 3 +> > 1 c 200605 4 +> > 2 a 200605 9 +> > 2 c 200604 4 +> > 2 b 200608 1 +> > We need: +> > where cuiT = '1' +> > cuiT cuiL PERI FAMI +> > 1 a 200608 9 +> > 1 c 200605 4 +> > If we place the Where cuiT = '1' in the subquery we couldn't get the max(FAMI) of cuiL a = 9 +and we couldn't know if that PERI is the max(PERI) of that cuiL independently of that cuiT. +> > +> > Here is the explain analyze with PG 8.0 for Windows: +> > Explain Analyze +> > SELECT DISTINCT T.cuiT,T.cuiL, U.MAXPERI AS ULT_APORTE_O_DDJJ +> > FROM APORTES AS T +> > INNER JOIN +> > ( +> > SELECT cuiL, MAX(PERI) AS MAXPERI +> > FROM APORTES +> > GROUP BY cuiL +> > ) AS U ON T.cuiL=U.cuiL AND T.PERI=U.MAXPERI +> > WHERE T.cuiT='12345678901' +> > order by T.cuiT, T.cuiL, U.MAXPERI; +> > +> > QUERY PLAN +> > 1 Unique (cost=37478647.41..37478650.53 rows=312 width=62) (actual +time=2677209.000..2677520.000 +> > rows=1720 loops=1) +> > 2 -> Sort (cost=37478647.41..37478648.19 rows=312 width=62) (actual +time=2677209.000..2677260.000 rows=3394 loops=1) +> > 3 Sort Key: t.cuiT, t.cuiL, u.maxperi +> > 4 -> Merge Join (cost=128944.78..37478634.48 rows=312 width=62) (actual +time=74978.000..2677009.000 rows=3394 loops=1) +> > 5 Merge Cond: ("outer".cuiL = "inner".cuiL) +> > 6 Join Filter: (("inner".peri)::text = "outer".maxperi) +> > 7 -> Subquery Scan u (cost=0.00..37348434.56 rows=3951 width=47) (actual +time=130.000..2634923.000 rows=254576 loops=1) +> > 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) (actual +time=130.000..2629617.000 rows=254576 loops=1) +> > 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 +rows=9339331 width=25) (actual time=110.000..2520690.000 rows=9335892 loops=1) +> > 10 -> Sort (cost=128944.78..129100.44 rows=62263 width=40) (actual +time=30684.000..36838.000 rows=80471 loops=1) +> > 11 Sort Key: t.cuiL +> > 12 -> Index Scan using uesapt002 on APORTES t (cost=0.00..122643.90 +rows=62263 width=40) (actual time=170.000..25566.000 rows=80471 loops=1) +> > 13 Index Cond: (cuiT = '12345678901'::bpchar) +> > Total runtime: 2677640.000 ms +> > +> > Thanks +> > Sebasti�n Baioni + + + + + +__________________________________________________ +Pregunt�. Respond�. Descubr�. +Todo lo que quer�as saber, y lo que ni imaginabas, +est� en Yahoo! Respuestas (Beta). +�Probalo ya! +http://www.yahoo.com.ar/respuestas + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 16:44:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2E92E9FB2FB + for ; + Wed, 16 Aug 2006 16:44:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 75870-03 for + ; + Wed, 16 Aug 2006 16:43:48 -0300 (ADT) +X-Greylist: delayed 10:16:30.837634 by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id EAFB19FB2F2 + for ; + Wed, 16 Aug 2006 16:43:47 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) + id 1GDRIp-0005HR-8e; Wed, 16 Aug 2006 20:43:47 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7GJhk5H025839; + Wed, 16 Aug 2006 20:43:46 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.0/420]); + Wed, 16 Aug 2006 20:42:49 +0100 +From: "Peter Hardman" +To: pgsql-performance@postgresql.org +Date: Wed, 16 Aug 2006 20:42:49 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +CC: acmmailing@tweakers.net +Message-ID: <44E38349.22540.D5CD66@peter.ssbg.zetnet.co.uk> +In-reply-to: <44E35DB0.8050109@tweakers.net> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/272 +X-Sequence-Number: 20457 + +On 16 Aug 2006 at 20:02, Arjen van der Meijden wrote: + +> On 16-8-2006 18:48, Peter Hardman wrote: +> > Using identically structured tables and the same primary key, if I run this on +> > Paradox/BDE it takes about 120ms, on MySQL (5.0.24, local server) about 3ms, +> > and on PostgresSQL (8.1.3, local server) about 1290ms). All on the same +> > Windows XP Pro machine with 512MB ram of which nearly half is free. +> +> Is that with or without query caching? I.e. can you test it with SELECT +> SQL_NO_CACHE ... ? +> In a read-only environment it will still beat PostgreSQL, but as soon as +> you'd get a read-write environment, MySQL's query cache is of less use. +> So you should compare both the cached and non-cached version, if applicable. +It seems to make no difference - not surprising really as I'm just running the query +from the command line interface. +> +> Besides that, most advices on this list are impossible without the +> result of 'explain analyze', so you should probably get that as well. +Here is the output of EXPLAIN ANALYZE for the slow query: + +Unique (cost=7201.65..8487.81 rows=1 width=13) (actual +time=1649.733..1811.684 rows=32 loops=1) + -> Merge Join (cost=7201.65..8487.80 rows=1 width=13) (actual +time=1649.726..1811.528 rows=32 loops=1) + Merge Cond: ((("outer".regn_no)::text = "inner"."?column3?") AND +("outer".transfer_date = "inner".last_xfer_date)) + -> Index Scan using sheep_flock_pkey on sheep_flock f1 +(cost=0.00..1033.19 rows=77 width=13) (actual time=15.357..64.237 rows=127 +loops=1) + Index Cond: ((flock_no)::text = '1359'::text) + -> Sort (cost=7201.65..7285.84 rows=33676 width=15) (actual +time=1580.198..1653.502 rows=38277 loops=1) + Sort Key: (f2.regn_no)::text, f2.last_xfer_date + -> Subquery Scan f2 (cost=0.00..4261.67 rows=33676 width=15) (actual +time=0.331..598.246 rows=38815 loops=1) + -> GroupAggregate (cost=0.00..3924.91 rows=33676 width=13) +(actual time=0.324..473.131 rows=38815 loops=1) + -> Index Scan using sheep_flock_pkey on sheep_flock f +(cost=0.00..3094.95 rows=81802 width=13) (actual time=0.295..232.156 +rows=81802 loops=1) +Total runtime: 1812.737 ms + + +> +> I'm not sure whether this is the same query, but you might want to try: +> SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +> FROM SHEEP_FLOCK f1 +> WHERE +> f1.flock_no = '1359' +> AND f1.transfer_date = (SELECT MAX(f.transfer_date) FROM SHEEP_FLOCK f +> WHERE regn_no = f1.regn_no) +> +That's neat - I didn't know you could make a reference from a subselect to the +outer select. Your query has the same performance as my very complex one on +both MySQL and PostgreSQL. However I'm not entirely sure about the times for +MySQL - every interface gives a different answer so I'll have to try them from a +script so I know whats going on. +Interestingly BDE takes 7 seconds to run your query. Just as well I didn't start +from there... +> And you might need an index on (regn_no, transfer_date) and/or one +> combined with that flock_no. +Explain says it only uses the primary key, so it seems there' no need for a +separate index + +Thanks for the help +-- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Wed Aug 16 19:52:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2FF069FB20A + for ; + Wed, 16 Aug 2006 19:52:06 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 17594-07 for + ; + Wed, 16 Aug 2006 19:51:58 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id A77069FB1EE + for ; + Wed, 16 Aug 2006 19:51:58 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7GMpvA1029247; + Wed, 16 Aug 2006 18:51:57 -0400 (EDT) +To: "Peter Hardman" +cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +In-reply-to: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +Comments: In-reply-to "Peter Hardman" + message dated "Wed, 16 Aug 2006 17:48:13 +0100" +Date: Wed, 16 Aug 2006 18:51:57 -0400 +Message-ID: <29246.1155768717@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.183 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/273 +X-Sequence-Number: 20458 + +"Peter Hardman" writes: +> I'm in the process of migrating a Paradox 7/BDE 5.01 database from single-user +> Paradox to a web based interface to either MySQL or PostgreSQL. +> The query I run is: + +> /* Select all sheep who's most recent transfer was into the subject flock */ +> SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +> FROM SHEEP_FLOCK f1 JOIN +> /* The last transfer date for each sheep */ +> (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date +> FROM SHEEP_FLOCK f +> GROUP BY f.regn_no) f2 +> ON f1.regn_no = f2.regn_no +> WHERE f1.flock_no = '1359' +> AND f1.transfer_date = f2.last_xfer_date + +This seems pretty closely related to this recent thread: +http://archives.postgresql.org/pgsql-performance/2006-08/msg00220.php +in which the OP is doing a very similar kind of query in almost exactly +the same way. + +I can't help thinking that there's probably a better way to phrase this +type of query in SQL, though it's not jumping out at me what that is. + +What I find interesting though is that it sounds like both MSSQL and +Paradox know something we don't about how to optimize it. PG doesn't +have any idea how to do the above query without forming the full output +of the sub-select, but I suspect that the commercial DBs know a +shortcut; perhaps they are able to automatically derive a restriction +in the subquery similar to what you did by hand. Does Paradox have +anything comparable to EXPLAIN that would give a hint about the query +plan they are using? + +Also, just as in the other thread, I'm thinking that a seqscan+hash +aggregate would be a better idea than this bit: + +> -> GroupAggregate (cost=0.00..3924.91 rows=33676 width=13) (actual time=0.324..473.131 rows=38815 loops=1) +> -> Index Scan using sheep_flock_pkey on sheep_flock f (cost=0.00..3094.95 rows=81802 width=13) (actual time=0.295..232.156) + +Possibly you need to raise work_mem to get it to consider the hash +aggregation method. + +BTW, are you *sure* you are testing PG 8.1? The "Subquery Scan f2" plan +node looks unnecessary to me, and I'd have expected 8.1 to drop it out. +8.0 and before would have left it in the plan though. This doesn't make +all that much difference performance-wise in itself, but it does make me +wonder what you are testing. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 16 23:10:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2F5409FB2F1 + for ; + Wed, 16 Aug 2006 23:10:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 41785-06 for + ; + Wed, 16 Aug 2006 23:10:37 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.206]) + by postgresql.org (Postfix) with ESMTP id 073959FA154 + for ; + Wed, 16 Aug 2006 23:10:37 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id z31so207225nzd + for ; + Wed, 16 Aug 2006 19:10:36 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:subject:from:reply-to:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=FZzmCuTW3Ra3ekWc0/HTW3FwnmlJML7aCaBj37i2geitYYUmJbcF9IKN7gqzChCOTqfqFIpz+u/5S7NqeGkJFZounFjtPBHpuPa3eSalVhY71lTOlCLgjBaLSrjsWDfaXxpZJWoOAvqciZG5MZsTJ6qGzWLy7Opw/nYeMLSlszI= +Received: by 10.64.241.3 with SMTP id o3mr1611651qbh; + Wed, 16 Aug 2006 19:10:36 -0700 (PDT) +Received: from amd64-gentoo-laptop ( [66.167.78.161]) + by mx.gmail.com with ESMTP id e13sm743179qbe.2006.08.16.19.10.35; + Wed, 16 Aug 2006 19:10:36 -0700 (PDT) +Subject: Re: Postgresql Performance on an HP DL385 and +From: Steve Poe +Reply-To: steve.poe@gmail.com +To: Scott Marlowe +Cc: Luke Lonergan , + Michael Stone , pgsql-performance@postgresql.org +In-Reply-To: <1155224109.20252.144.camel@state.g2switchworks.com> +References: + <1155224109.20252.144.camel@state.g2switchworks.com> +Content-Type: text/plain +Date: Wed, 16 Aug 2006 19:10:33 -0700 +Message-Id: <1155780633.11188.5.camel@amd64-gentoo-laptop> +Mime-Version: 1.0 +X-Mailer: Evolution 2.4.2.1 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/274 +X-Sequence-Number: 20459 + +Everyone, + +I wanted to follow-up on bonnie results for the internal RAID1 which is +connected to the SmartArray 6i. I believe this is the problem, but I am +not good at interepting the results. Here's an sample of three runs: + +scsi disc +array ,16G,47983,67,65492,20,37214,6,73785,87,89787,6,578.2,0,16,+++++, ++++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +scsi disc +array ,16G,54634,75,67793,21,36835,6,74190,88,89314,6,579.9,0,16,+++++, ++++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +scsi disc +array ,16G,55056,76,66108,20,36859,6,74108,87,89559,6,585.0,0,16,+++++, ++++,+++++,+++,+++++,+++,+++++,+++,+ + +This was run on the internal RAID1 on the outer portion of the discs +formatted at ext2. + +Thanks. + +Steve + +On Thu, 2006-08-10 at 10:35 -0500, Scott Marlowe wrote: +> On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote: +> > Mike, +> > +> > On 8/10/06 4:09 AM, "Michael Stone" wrote: +> > +> > > On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +> > >> I tried as you suggested and my performance dropped by 50%. I went from +> > >> a 32 TPS to 16. Oh well. +> > > +> > > If you put data & xlog on the same array, put them on seperate +> > > partitions, probably formatted differently (ext2 on xlog). +> > +> > If he's doing the same thing on both systems (Sun and HP) and the HP +> > performance is dramatically worse despite using more disks and having faster +> > CPUs and more RAM, ISTM the problem isn't the configuration. +> > +> > Add to this the fact that the Sun machine is CPU bound while the HP is I/O +> > wait bound and I think the problem is the disk hardware or the driver +> > therein. +> +> I agree. The problem here looks to be the RAID controller. +> +> Steve, got access to a different RAID controller to test with? +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that your +> message can get through to the mailing list cleanly + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 01:57:52 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 65ACA9FB351 + for ; + Thu, 17 Aug 2006 01:57:51 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 80882-03 for + ; + Thu, 17 Aug 2006 01:57:40 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 2A34E9FB2F2 + for ; + Thu, 17 Aug 2006 01:57:40 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 3378256427; Wed, 16 Aug 2006 23:57:24 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Wed, 16 Aug 2006 23:57:23 -0500 +Date: Wed, 16 Aug 2006 23:57:23 -0500 +From: "Jim C. Nasby" +To: Carl Youngblood +Cc: pgsql-performance@postgresql.org +Subject: Re: Beginner optimization questions, esp. regarding Tsearch2 +Message-ID: <20060817045723.GY21363@pervasive.com> +References: + <44DAFB2B.4070307@archonet.com> + <20060815150529.GO27928@pervasive.com> + + <20060815192145.GI21363@pervasive.com> + +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: + 1:20:060817:carl@youngbloods.org::1FZ7YWPS10gYwzXT:00000000000000000 + 0000000000000000000000002Ka1 +X-Hashcash: + 1:20:060817:pgsql-performance@postgresql.org::PzakyVG+oMV41gI4:00000 + 0000000000000000000000001Jjx +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/275 +X-Sequence-Number: 20460 + +On Wed, Aug 16, 2006 at 09:34:24AM -0600, Carl Youngblood wrote: +> The relevant portion of my sysctl.conf file looks like this: +> +> kernel.shmall = 2097152 +> kernel.shmmax = 2147483648 +> kernel.shmmni = 4096 +> kernel.sem = 250 32000 100 128 +> fs.file-max = 65536 +> +> I understood it was a good idea to set shmmax to half of available +> memory (2GB in this case). I assume that I need to set shared_buffers + +I don't see any reason to do that, so long as you have control over +what's being run on the system. Just set it to 3000000000 or so. + +> slightly lower than 2GB for postgresql to start successfully. +> +> Carl +> +> On 8/15/06, Jim C. Nasby wrote: +> >On Tue, Aug 15, 2006 at 12:47:54PM -0600, Carl Youngblood wrote: +> >> I tried setting it to 2GB and postgres wouldn't start. Didn't +> >> investigate in much greater detail as to why it wouldn't start, but +> >> after switching it back to 1GB it started fine. +> > +> >Most likely because you didn't set the kernel's shared memory settings +> >high enough. +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-admin-owner@postgresql.org Thu Aug 17 02:14:36 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 9FF269FB35F + for ; + Thu, 17 Aug 2006 02:14:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 25867-01 for ; + Thu, 17 Aug 2006 05:14:32 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from bsil.com (ganga.bsil.com [203.199.84.175]) + by postgresql.org (Postfix) with ESMTP id 129FF9FB359 + for ; Thu, 17 Aug 2006 02:14:30 -0300 (ADT) +Received: from bsil.com (localhost [127.0.0.1]) + by bsil.com (8.11.6/8.11.6) with ESMTP id k7H5EQo30221 + for ; Thu, 17 Aug 2006 10:44:26 +0530 +Received: from hngmail.bsil.com (hngmail.bsil.com [192.168.11.253])by bsil.c + om (8.11.6/8.11.6) with ESMTP id k7H5EQf30217for + ; Thu, 17 Aug 2006 10:44:26 +0530 +Received: from mdt488 (localhost.localdomain [127.0.0.1])by hngmail.bsil.com + (8.11.6/8.11.6) with SMTP id k7H5GeL24070for + ; Thu, 17 Aug 2006 10:46:40 +0530 +Message-ID: <00dd01c6c1bc$4208c040$290ba8c0@bsil.com> +From: "Mohan R" +To: +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> <674d1f8a06 + 08090224l37c4a892rd8df80f76c98341e@mail.gmail.com> +Subject: Re: unsubscribe +Date: Thu, 17 Aug 2006 10:46:13 +0530 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_00DA_01C6C1EA.5BA18D60" +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 6.00.2900.2180 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 +X-imss-version: 2.41 +X-imss-result: Passed +X-imss-scores: Clean:90.11863 C:2 M:3 S:5 R:5 +X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_HELO_PASS, SPF_PASS, UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/192 +X-Sequence-Number: 22735 + +This is a multi-part message in MIME format. + +------=_NextPart_000_00DA_01C6C1EA.5BA18D60 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +-- + +Regards +R Mohan +Blue Star Infotech Limited +T : +91-22-66956969 +------=_NextPart_000_00DA_01C6C1EA.5BA18D60 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
--
+
 
+
Regards
R Mohan
Blue Star = +Infotech=20 +Limited
T : +91-22-66956969
+ +------=_NextPart_000_00DA_01C6C1EA.5BA18D60-- + + +From pgsql-admin-owner@postgresql.org Thu Aug 17 03:40:34 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B37A39FB38E + for ; + Thu, 17 Aug 2006 03:40:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 96012-02 for ; + Thu, 17 Aug 2006 03:40:20 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id B253C9FB364 + for ; Thu, 17 Aug 2006 03:40:21 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mailin.kwsoft.de (mailin.kwsoft.de [213.164.67.82]) + by svr4.postgresql.org (Postfix) with ESMTP id 0535D5AF886 + for ; Thu, 17 Aug 2006 06:40:19 +0000 (GMT) +Received: from localhost (localhost [127.0.0.1]) + by mailin.kwsoft.de (Postfix) with ESMTP id 3315052417 + for ; Thu, 17 Aug 2006 08:40:17 +0200 (CEST) +Received: from hoedlepc.hq.kwsoft.de (hoedlepc.hq.kwsoft.de [10.1.53.102]) + by webmail.kwsoft.de (Horde MIME library) with HTTP; Thu, 17 Aug 2006 + 08:40:17 +0200 +Message-ID: <20060817084017.we0r606x49moo804@webmail.kwsoft.de> +Date: Thu, 17 Aug 2006 08:40:17 +0200 +From: lst_hoe01@kwsoft.de +To: pgsql-admin@postgresql.org +Subject: Re: unsubscribe +References: <20060809052335Z4029230-18814+396@kps3.test.onet.pl> + <674d1f8a06 08090224l37c4a892rd8df80f76c98341e@mail.gmail.com> + <00dd01c6c1bc$4208c040$290ba8c0@bsil.com> +In-Reply-To: <00dd01c6c1bc$4208c040$290ba8c0@bsil.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset=ISO-8859-1; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit +User-Agent: Internet Messaging Program (IMP) H3 (4.0.4) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.252 tagged_above=0 required=5 + tests=FROM_HAS_ULINE_NUMS, NO_REAL_NAME +X-Spam-Level: * +X-Archive-Number: 200608/195 +X-Sequence-Number: 22738 + +Zitat von Mohan R : + +> -- +> +> Regards +> R Mohan +> Blue Star Infotech Limited +> T : +91-22-66956969 + + +http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&func=lists-long-full&extra=pgsql-admin + + + + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 06:08:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 65F319FB3BC + for ; + Thu, 17 Aug 2006 06:08:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 03090-10 for + ; + Thu, 17 Aug 2006 06:08:06 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id 0BF2F9FB3BA + for ; + Thu, 17 Aug 2006 06:08:06 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) + id 1GDdrA-00089R-5m; Thu, 17 Aug 2006 10:08:04 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7H982iw011739; + Thu, 17 Aug 2006 10:08:03 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.1/421]); + Thu, 17 Aug 2006 10:07:54 +0100 +From: "Peter Hardman" +To: pgsql-performance@postgresql.org +Date: Thu, 17 Aug 2006 10:07:54 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +CC: Mario Weilguni +Message-ID: <44E43FFA.23823.5E0BDD@peter.ssbg.zetnet.co.uk> +In-reply-to: <200608171000.12922.mweilguni@sime.com> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/276 +X-Sequence-Number: 20461 + + +On 17 Aug 2006 at 10:00, Mario Weilguni wrote: + +> not really sure if this is right without any testdata, but isn't that what you +> want? +> +> CREATE index foo on sheep_flock (flock_no); +> +> SELECT DISTINCT on (f1.transfer_date) f1.regn_no, f1.transfer_date as date_in +> FROM SHEEP_FLOCK f1 +> WHERE f1.flock_no = '1359' +> order by f1.transfer_date desc; +> +> best regards, +> mario weilguni +> +> +Mario, Thanks for the suggestion, but this query produces the wrong answer - but +then I provided no data, nor properly explained what the data would be. +Each sheep will have multiple records, starting with one for when it's first +registered, then one for each flock it's in (eg sold into) then one for when it dies +and goes to the 'big flock in the sky'. + + So first I need to find the most recent record for each sheep and then select the +sheep who's most recent record matches the flock in question. + +Your query finds all the sheep that have been in the flock in question, then selects +the first one from each set of records with the same date. So it collects data on +dead sheep, and only selects one sheep if several were bought or registered on +the same day. + +Forgive me for being verbose - I want to make sure I understand it propely myself! + +regards, + -- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 06:21:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 12B559FB3BC + for ; + Thu, 17 Aug 2006 06:21:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 04754-06 for + ; + Thu, 17 Aug 2006 06:21:08 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id 536179FB3BA + for ; + Thu, 17 Aug 2006 06:21:09 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) + id 1GDe3n-0000fG-Lo; Thu, 17 Aug 2006 10:21:07 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7H9L6S2026464; + Thu, 17 Aug 2006 10:21:06 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.1/421]); + Thu, 17 Aug 2006 10:21:01 +0100 +From: "Peter Hardman" +To: pgsql-performance@postgresql.org +Date: Thu, 17 Aug 2006 10:21:01 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +CC: tgl@sss.pgh.pa.us +Message-ID: <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> +In-reply-to: <29246.1155768717@sss.pgh.pa.us> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/277 +X-Sequence-Number: 20462 + +On 16 Aug 2006 at 18:51, Tom Lane wrote: + +> "Peter Hardman" writes: +> > I'm in the process of migrating a Paradox 7/BDE 5.01 database from single-user + + +Arjen van der Meijden has proposed a very elegant query in another post. + +> What I find interesting though is that it sounds like both MSSQL and +> Paradox know something we don't about how to optimize it. PG doesn't +> have any idea how to do the above query without forming the full output +> of the sub-select, but I suspect that the commercial DBs know a +> shortcut; perhaps they are able to automatically derive a restriction +> in the subquery similar to what you did by hand. Does Paradox have +> anything comparable to EXPLAIN that would give a hint about the query +> plan they are using? + +Sadly, no. In fact the ability to use SQL from Paradox at all is not well known and +not very visible in the the documentation. + +I wonder whether Paradox and MySQL are just not doing the sort (this seems to +be what eats up the time), since the output of the subquery is in fact already in the +proper order. + +> +> Also, just as in the other thread, I'm thinking that a seqscan+hash +> aggregate would be a better idea than this bit: +> +> > -> GroupAggregate (cost=0.00..3924.91 rows=33676 width=13) (actual time=0.324..473.131 rows=38815 loops=1) +> > -> Index Scan using sheep_flock_pkey on sheep_flock f (cost=0.00..3094.95 rows=81802 width=13) (actual time=0.295..232.156) +> +> Possibly you need to raise work_mem to get it to consider the hash +> aggregation method. +> +> BTW, are you *sure* you are testing PG 8.1? The "Subquery Scan f2" plan +> node looks unnecessary to me, and I'd have expected 8.1 to drop it out. +> 8.0 and before would have left it in the plan though. This doesn't make +> all that much difference performance-wise in itself, but it does make me +> wonder what you are testing. + +Yes, the executables all say version 8.1.3.6044 +> +Regards,-- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 07:11:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 506839FB3D0 + for ; + Thu, 17 Aug 2006 07:11:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 09677-08 for + ; + Thu, 17 Aug 2006 07:11:32 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 253889FA268 + for ; + Thu, 17 Aug 2006 07:11:32 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1EFC.dip0.t-ipconnect.de + [84.157.30.252]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id EFFB565943 + for ; + Thu, 17 Aug 2006 12:13:32 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 767401854BDCA + for ; + Thu, 17 Aug 2006 12:11:49 +0200 (CEST) +Message-ID: <44E440E5.4060304@logix-tt.com> +Date: Thu, 17 Aug 2006 12:11:49 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> +In-Reply-To: <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.175 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/278 +X-Sequence-Number: 20463 + +Hi, Peter, + +Peter Hardman wrote: + +>> BTW, are you *sure* you are testing PG 8.1? The "Subquery Scan f2" plan +>> node looks unnecessary to me, and I'd have expected 8.1 to drop it out. +>> 8.0 and before would have left it in the plan though. This doesn't make +>> all that much difference performance-wise in itself, but it does make me +>> wonder what you are testing. +> +> Yes, the executables all say version 8.1.3.6044 + +Would you mind to look at the output of "select version();", too? + +I ask this because I stumbled over it myself, that I had installed the +correct postgresql and psql versions, but accidentally connected to a +different database installation due to strange environment and script +settings... + + +Thanks, +Markus + + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Thu Aug 17 07:28:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8D9739FB249 + for ; + Thu, 17 Aug 2006 07:28:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 95293-05 for + ; + Thu, 17 Aug 2006 10:28:25 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id 46CDA9F9EF3 + for ; + Thu, 17 Aug 2006 07:28:25 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) + id 1GDf6t-0006Ot-Du; Thu, 17 Aug 2006 11:28:23 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7HASMIU008105; + Thu, 17 Aug 2006 11:28:22 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.1/421]); + Thu, 17 Aug 2006 11:25:18 +0100 +From: "Peter Hardman" +To: Markus Schaber , pgsql-performance@postgresql.org +Date: Thu, 17 Aug 2006 11:25:18 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Message-ID: <44E4521E.12188.A4E64B@peter.ssbg.zetnet.co.uk> +In-reply-to: <44E440E5.4060304@logix-tt.com> +References: <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/279 +X-Sequence-Number: 20464 + +On 17 Aug 2006 at 12:11, Markus Schaber wrote: + +> Hi, Peter, +> +> Peter Hardman wrote: +> +> >> BTW, are you *sure* you are testing PG 8.1? The "Subquery Scan f2" plan +> >> node looks unnecessary to me, and I'd have expected 8.1 to drop it out. +> >> 8.0 and before would have left it in the plan though. This doesn't make +> >> all that much difference performance-wise in itself, but it does make me +> >> wonder what you are testing. +> > +> > Yes, the executables all say version 8.1.3.6044 +> +> Would you mind to look at the output of "select version();", too? +> +> I ask this because I stumbled over it myself, that I had installed the +> correct postgresql and psql versions, but accidentally connected to a +> different database installation due to strange environment and script +> settings... +select version() returns + +PostgreSQL 8.1.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 +(mingw-special) + +Cheers,-- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 08:01:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B8CCD9FB292 + for ; + Thu, 17 Aug 2006 08:01:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 13227-05 for + ; + Thu, 17 Aug 2006 08:01:16 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 626E19FB276 + for ; + Thu, 17 Aug 2006 08:01:17 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1EFC.dip0.t-ipconnect.de + [84.157.30.252]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 303B865943 + for ; + Thu, 17 Aug 2006 13:03:18 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id BF6271854BDCA + for ; + Thu, 17 Aug 2006 13:01:34 +0200 (CEST) +Message-ID: <44E44C8E.4080204@logix-tt.com> +Date: Thu, 17 Aug 2006 13:01:34 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +References: <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> + <44E4521E.12188.A4E64B@peter.ssbg.zetnet.co.uk> +In-Reply-To: <44E4521E.12188.A4E64B@peter.ssbg.zetnet.co.uk> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.172 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/280 +X-Sequence-Number: 20465 + +Hi, Peter, + +Peter Hardman wrote: + +> select version() returns +> +> PostgreSQL 8.1.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 +> (mingw-special) + +That looks correct. + +I also presume that your environment is not as fragile wr/t connecting +do wrong databases, compared to debian with their multi-cluster +multi-version script wrapper magic. + +Don't mind. +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Thu Aug 17 10:11:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 9E1D89F9998 + for ; + Thu, 17 Aug 2006 10:11:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 20532-10 for + ; + Thu, 17 Aug 2006 10:11:51 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id D7BA19FA2E9 + for ; + Thu, 17 Aug 2006 10:11:52 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7HDBobB005322; + Thu, 17 Aug 2006 09:11:50 -0400 (EDT) +To: "Peter Hardman" +cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +In-reply-to: <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> +Comments: In-reply-to "Peter Hardman" + message dated "Thu, 17 Aug 2006 10:21:01 +0100" +Date: Thu, 17 Aug 2006 09:11:50 -0400 +Message-ID: <5321.1155820310@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.181 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/281 +X-Sequence-Number: 20466 + +"Peter Hardman" writes: +> I wonder whether Paradox and MySQL are just not doing the sort (this +> seems to be what eats up the time), since the output of the subquery +> is in fact already in the proper order. + +MSSQL (from the other thread). I feel fairly safe in assuming that +MySQL's query optimizer is not nearly in the league to do this query +effectively. (I like the theory Arjen mentioned that what you are +measuring there is the effects of their query cache rather than a +smart fundamental implementation.) I wonder whether MSSQL has an +EXPLAIN equivalent ... + +Anywy, your point about the sort being redundant is a good one, and +offhand I'd have expected PG to catch that; I'll have to look into +why it didn't. But that's not going to explain a 10x speed +difference, because the sort isn't 90% of the runtime. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 17 10:54:16 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3A68A9FB31C + for ; + Thu, 17 Aug 2006 10:54:16 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 23368-10 for + ; + Thu, 17 Aug 2006 10:54:03 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) + by postgresql.org (Postfix) with ESMTP id 77DFF9FB274 + for ; + Thu, 17 Aug 2006 10:54:04 -0300 (ADT) +Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP + with MS-WebStorage 6.0.6249 +Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; + 17 Aug 2006 06:54:00 -0700 +Subject: Re: PostgreSQL runs a query much slower than BDE and +From: Mark Lewis +To: Tom Lane +Cc: Peter Hardman , pgsql-performance@postgresql.org +In-Reply-To: <5321.1155820310@sss.pgh.pa.us> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> + <5321.1155820310@sss.pgh.pa.us> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Organization: MIR3, Inc. +Date: Thu, 17 Aug 2006 06:54:00 -0700 +Message-Id: <1155822840.16967.238.camel@archimedes> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.2 (2.0.2-27) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.379 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/282 +X-Sequence-Number: 20467 + +MSSQL can give either a graphical query plan or a text-based one similar +to PG. There's no way that I've found to get the equivalent of an +EXPLAIN ANALYZE, but I'm by no means an MSSQL guru. + +To get a neat-looking but not very useful graphical query plan from the +Query Analyzer tool, hit . + +To get the text-based one, execute "SET SHOWPLAN_ALL ON" which toggles +diagnostic mode on, and each query that you run will return the explain +plan instead of actually running until you execute "SET SHOWPLAN_ALL +OFF". + +-- Mark Lewis + +On Thu, 2006-08-17 at 09:11 -0400, Tom Lane wrote: +> "Peter Hardman" writes: +> > I wonder whether Paradox and MySQL are just not doing the sort (this +> > seems to be what eats up the time), since the output of the subquery +> > is in fact already in the proper order. +> +> MSSQL (from the other thread). I feel fairly safe in assuming that +> MySQL's query optimizer is not nearly in the league to do this query +> effectively. (I like the theory Arjen mentioned that what you are +> measuring there is the effects of their query cache rather than a +> smart fundamental implementation.) I wonder whether MSSQL has an +> EXPLAIN equivalent ... +> +> Anywy, your point about the sort being redundant is a good one, and +> offhand I'd have expected PG to catch that; I'll have to look into +> why it didn't. But that's not going to explain a 10x speed +> difference, because the sort isn't 90% of the runtime. +> +> regards, tom lane +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org + +From pgsql-performance-owner@postgresql.org Thu Aug 17 13:31:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 690C09FB3AF + for ; + Thu, 17 Aug 2006 13:31:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 41551-04-2 + for ; + Thu, 17 Aug 2006 13:31:26 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx-2.sollentuna.net (mx-2.sollentuna.net [195.84.163.199]) + by postgresql.org (Postfix) with ESMTP id 79C2B9FA2F3 + for ; + Thu, 17 Aug 2006 13:31:26 -0300 (ADT) +Received: from ALGOL.sollentuna.se (janus.sollentuna.se [62.65.68.67]) + by mx-2.sollentuna.net (Postfix) with ESMTP + id AFC66F40FD; Thu, 17 Aug 2006 18:31:25 +0200 (CEST) +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Subject: Re: PostgreSQL runs a query much slower than BDE and +Date: Thu, 17 Aug 2006 18:31:39 +0200 +Message-ID: <6BCB9D8A16AC4241919521715F4D8BCEA0FB3A@algol.sollentuna.se> +In-Reply-To: <1155822840.16967.238.camel@archimedes> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] PostgreSQL runs a query much slower than BDE and +Thread-Index: AcbCBLb+4Ko5CpAdQeSOKtkNLZex8wAFcgMw +From: "Magnus Hagander" +To: "Mark Lewis" , + "Tom Lane" +Cc: "Peter Hardman" , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.184 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS, UPPERCASE_25_50 +X-Spam-Level: +X-Archive-Number: 200608/283 +X-Sequence-Number: 20468 + +> MSSQL can give either a graphical query plan or a text-based=20 +> one similar to PG. There's no way that I've found to get the=20 +> equivalent of an EXPLAIN ANALYZE, but I'm by no means an MSSQL guru. + +SET STATISTICS IO ON +SET STATISTICS PROFILE ON +SET STATISTICS TIME ON + + +//Magnus + +From pgsql-performance-owner@postgresql.org Thu Aug 17 15:33:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 121119FB263 + for ; + Thu, 17 Aug 2006 15:33:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 42288-05-2 + for ; + Thu, 17 Aug 2006 18:33:28 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 3CAF79FB25D + for ; + Thu, 17 Aug 2006 15:33:28 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7HIXR1H018262; + Thu, 17 Aug 2006 14:33:27 -0400 (EDT) +To: "Peter Hardman" +cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +In-reply-to: <5321.1155820310@sss.pgh.pa.us> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> + <5321.1155820310@sss.pgh.pa.us> +Comments: In-reply-to Tom Lane + message dated "Thu, 17 Aug 2006 09:11:50 -0400" +Date: Thu, 17 Aug 2006 14:33:27 -0400 +Message-ID: <18261.1155839607@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/284 +X-Sequence-Number: 20469 + +I wrote: +> Anywy, your point about the sort being redundant is a good one, and +> offhand I'd have expected PG to catch that; I'll have to look into +> why it didn't. But that's not going to explain a 10x speed +> difference, because the sort isn't 90% of the runtime. + +I dug into this using some made-up test data, and was able to reproduce +the plan you got after changing the order of the pkey index columns +to (regn_no, transfer_date, flock_no) ... are you sure you quoted that +accurately before? + +I found a couple of minor planner problems, which I've repaired in CVS +HEAD. You might consider using TEXT columns instead of VARCHAR(n), +because the only bug that actually seemed to change the chosen plan +involved the planner getting confused by the difference between +varchar_var and varchar_var::text (which is what gets generated for +sorting purposes because varchar doesn't have a separate sort operator). + +There's a more interesting issue, which I'm afraid we do not have time +to fix for PG 8.2. The crux of the matter is that given + +SELECT ... +FROM SHEEP_FLOCK f1 JOIN + (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date + FROM SHEEP_FLOCK f + GROUP BY f.regn_no) f2 +ON f1.regn_no = f2.regn_no +AND f1.transfer_date = f2.last_xfer_date + +if there is an index on (regn_no, transfer_date) then the planner could +in principle do a double-column merge join between an indexscan on this +index and the output of a GroupAggregate implementation of the subquery. +The GroupAggregate plan would in fact only be sorting on regn_no, so +it's not immediately obvious why this is OK. The reason is that there +is only one MAX() value for any particular regn_no, and so the sort +condition that the last_xfer_date values be in order for any one value +of regn_no is vacuous. We could consider the subquery's output to be +sorted by *any* list of the form "regn_no, other-stuff". + +The planner's notion of matching pathkey lists to determine sortedness +is not at all capable of dealing with this. After a little bit of +thought I'm tempted to propose that we add a concept that a particular +pathkey list is "unique", meaning that it is known to include a unique +key for the data. Such a key would match, for sortedness purposes, +any requested sort ordering consisting of its columns followed by +others. In the above example, we would know that a GROUP BY implemented +by GroupAggregate yields an output for which the grouping columns +are a unique sort key. + +I imagine this concept is already known in the database research +literature; anyone recognize it and know a standard name for it? + +What'd be really interesting is to know if MSSQL and Paradox are using +this concept to optimize their plans for Peter's query. Can someone with +a copy of MSSQL try this test case and see what it reports as the plan? + +BTW, I used this to generate some COPY data I could load into Peter's +example table: + +perl -e 'for ($s = 1; $s < 32000; $s++) { +$f=int($s/100); +print "$s\t$f\t1\t0\n"; +print "$s\t$f\t2\t0\n"; +}' >sheep.data + +I changed the date columns to integers rather than bother to make up +valid dates. I think only the regn_no and flock_no statistics matter +to the planner for this particular query --- as you can see, I arranged +for 2 entries per sheep and 100 sheep per flock, which is in the general +ballpark of what Peter mentioned as his stats. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 17 16:32:00 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 48E3D9FB24F + for ; + Thu, 17 Aug 2006 16:32:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 73908-04 for + ; + Thu, 17 Aug 2006 16:31:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from calvin.slamb.org (calvin.slamb.org [216.136.66.56]) + by postgresql.org (Postfix) with ESMTP id 63F479FB233 + for ; + Thu, 17 Aug 2006 16:31:47 -0300 (ADT) +Received: by calvin.slamb.org (Postfix, from userid 103) + id 12EFA6FE90; Thu, 17 Aug 2006 14:09:48 -0500 (CDT) +Received: from [IPv6:::1] (localhost.slamb.org [127.0.0.1]) + by calvin.slamb.org (Postfix) with ESMTP + id 8BE7E6FE58; Thu, 17 Aug 2006 14:09:46 -0500 (CDT) +In-Reply-To: <29246.1155768717@sss.pgh.pa.us> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <29246.1155768717@sss.pgh.pa.us> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Cc: "Peter Hardman" , + pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Scott Lamb +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Date: Thu, 17 Aug 2006 12:09:45 -0700 +To: Tom Lane +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/286 +X-Sequence-Number: 20471 + +On Aug 16, 2006, at 3:51 PM, Tom Lane wrote: +>> /* Select all sheep who's most recent transfer was into the +>> subject flock */ +>> SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +>> FROM SHEEP_FLOCK f1 JOIN +>> /* The last transfer date for each sheep */ +>> (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date +>> FROM SHEEP_FLOCK f +>> GROUP BY f.regn_no) f2 +>> ON f1.regn_no = f2.regn_no +>> WHERE f1.flock_no = '1359' +>> AND f1.transfer_date = f2.last_xfer_date +> +> This seems pretty closely related to this recent thread: +> http://archives.postgresql.org/pgsql-performance/2006-08/msg00220.php +> in which the OP is doing a very similar kind of query in almost +> exactly +> the same way. +> +> I can't help thinking that there's probably a better way to phrase +> this +> type of query in SQL, though it's not jumping out at me what that is. + +I don't know about better, but I tend to phrase these in a quite +different way that's (hopefully) equivalent: + +select latest.regn_no, + latest.transfer_date as date_in +from sheep_flock latest +where not exists ( + select 'x' + from sheep_flock even_later + where latest.regn_no = even_later.regn_no + and latest.transfer_date < even_later.transfer_date) + and latest.flock_no = '1359' + +There's no MAX() or DISTINCT here, so maybe this is easier to optimize? + +-- +Scott Lamb + + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 16:21:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2F5DA9FB251 + for ; + Thu, 17 Aug 2006 16:21:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 67471-06 for + ; + Thu, 17 Aug 2006 16:20:57 -0300 (ADT) +X-Greylist: delayed 00:11:08.241969 by SQLgrey- +Received: from calvin.slamb.org (calvin.slamb.org [216.136.66.56]) + by postgresql.org (Postfix) with ESMTP id B48FB9FB233 + for ; + Thu, 17 Aug 2006 16:20:57 -0300 (ADT) +Received: by calvin.slamb.org (Postfix, from userid 103) + id 82DBF6FF31; Thu, 17 Aug 2006 14:20:51 -0500 (CDT) +Received: from [IPv6:::1] (localhost.slamb.org [127.0.0.1]) + by calvin.slamb.org (Postfix) with ESMTP + id 1F1336FE65; Thu, 17 Aug 2006 14:20:32 -0500 (CDT) +In-Reply-To: <18261.1155839607@sss.pgh.pa.us> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <44E4430D.15373.6A0C60@peter.ssbg.zetnet.co.uk> + <5321.1155820310@sss.pgh.pa.us> <18261.1155839607@sss.pgh.pa.us> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <451A4BAB-97D2-4292-9CF9-CB6DB5B3BCD4@slamb.org> +Cc: "Peter Hardman" , + pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Scott Lamb +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Date: Thu, 17 Aug 2006 12:20:11 -0700 +To: Tom Lane +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/285 +X-Sequence-Number: 20470 + +I have no idea if there's a standard name or what it may be, but for +what it's worth, this sounds similar to the optimizations I wanted +for a different query: + +http://archives.postgresql.org/pgsql-performance/2005-11/msg00037.php + +1. Recognize that a term constant across the whole sort is +irrelevant. (In my earlier case, a constant number, but here MAX +(xxx), which seems harder.) +2. Put together two sequences already in the appropriate order, +without resorting. (In my case, a union; here a join.) + +though I no longer need them for that problem. I'm quite happy with +the client-side solution we came up with. + +-- +Scott Lamb + + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 17:00:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 338499FB255 + for ; + Thu, 17 Aug 2006 17:00:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 75133-08 for + ; + Thu, 17 Aug 2006 17:00:19 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id AF3349FB254 + for ; + Thu, 17 Aug 2006 17:00:19 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) id 1GDo2M-00053Y-Ms + for pgsql-performance@postgresql.org; Thu, 17 Aug 2006 21:00:18 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7HK0Hr5008035 + for ; Thu, 17 Aug 2006 21:00:17 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.2/422]); + Thu, 17 Aug 2006 20:58:20 +0100 +From: "Peter Hardman" +To: pgsql-performance@postgresql.org +Date: Thu, 17 Aug 2006 20:58:20 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Message-ID: <44E4D86C.21053.F3E7E1@peter.ssbg.zetnet.co.uk> +In-reply-to: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.014 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/287 +X-Sequence-Number: 20472 + + + +On 16 Aug 2006 at 17:48, Peter Hardman wrote: + +> I'm in the process of migrating a Paradox 7/BDE 5.01 database from single-user +> Paradox to a web based interface to either MySQL or PostgreSQL. + + +I've uploaded my data to www.shetland-sheep.org.uk/pgdata/sheep-flock.zip + +The flock SSBXXX is the 'big flock in the sky' and thus there should never be any +date for a sheep greater than this. + +Yes, the primary key is regn_no + flock_no + transfer_date. + +Thanks again for all the help and advice. + +Regards,-- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 17:13:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 610329FB25A + for ; + Thu, 17 Aug 2006 17:13:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 77707-07 for + ; + Thu, 17 Aug 2006 17:13:22 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id 248C19FA682 + for ; + Thu, 17 Aug 2006 17:13:22 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) + id 1GDoEz-0005jk-G7; Thu, 17 Aug 2006 21:13:21 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7HKDKR4016124; + Thu, 17 Aug 2006 21:13:20 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.2/422]); + Thu, 17 Aug 2006 21:13:11 +0100 +From: "Peter Hardman" +To: Tom Lane , pgsql-performance@postgresql.org +Date: Thu, 17 Aug 2006 21:13:11 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Message-ID: <44E4DBE7.22131.10181D0@peter.ssbg.zetnet.co.uk> +In-reply-to: <18261.1155839607@sss.pgh.pa.us> +References: <5321.1155820310@sss.pgh.pa.us> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/288 +X-Sequence-Number: 20473 + +On 17 Aug 2006 at 14:33, Tom Lane wrote: + +> I wrote: +> > Anywy, your point about the sort being redundant is a good one, and +> > offhand I'd have expected PG to catch that; I'll have to look into +> > why it didn't. But that's not going to explain a 10x speed +> > difference, because the sort isn't 90% of the runtime. +> +> I dug into this using some made-up test data, and was able to reproduce +> the plan you got after changing the order of the pkey index columns +> to (regn_no, transfer_date, flock_no) ... are you sure you quoted that +> accurately before? + +Yes. Maybe the data I've uploaded to www.shetland- +sheep.org.uk/pgdata/sheep_flock.zip will help reproduce the plan. + + +> I found a couple of minor planner problems, which I've repaired in CVS +> HEAD. You might consider using TEXT columns instead of VARCHAR(n), +> because the only bug that actually seemed to change the chosen plan +> involved the planner getting confused by the difference between +> varchar_var and varchar_var::text (which is what gets generated for +> sorting purposes because varchar doesn't have a separate sort operator). + +As someone else suggested, these fields ought really to be CHAR no VARCHAR. +I chose VARCHAR because the data mostly is shorter than the maximum lengths +(although probably not enough to matter). I'd not really got into the subtleties of +different behaviour of CHAR and VARCHAR. +> + + +Regards,-- +Peter Hardman +Acre Cottage, Horsebridge +King's Somborne +Stockbridge +SO20 6PT + +== Breeder of Shetland Cattle and Shetland Sheep == + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 17:25:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C4B6B9FB259 + for ; + Thu, 17 Aug 2006 17:25:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 82916-05 for + ; + Thu, 17 Aug 2006 20:25:28 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) + by postgresql.org (Postfix) with ESMTP id 3D2DF9FB254 + for ; + Thu, 17 Aug 2006 17:25:28 -0300 (ADT) +Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) + by mailout.zetnet.co.uk with esmtp (Exim 4.50) id 1GDoQh-0006R7-JE + for pgsql-performance@postgresql.org; Thu, 17 Aug 2006 21:25:27 +0100 +Received: from [192.168.0.2] (55-038.adsl.zetnet.co.uk [194.247.55.38]) + by zetnet.co.uk (8.13.6/8.13.6/Debian-1) with ESMTP id k7HKPQrT023717 + for ; Thu, 17 Aug 2006 21:25:26 +0100 +Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.11.2/422]); + Thu, 17 Aug 2006 21:25:21 +0100 +From: "Peter Hardman" +To: pgsql-performance@postgresql.org +Date: Thu, 17 Aug 2006 21:25:21 +0100 +MIME-Version: 1.0 +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Message-ID: <44E4DEC1.20511.10CA34D@peter.ssbg.zetnet.co.uk> +In-reply-to: <44E4D86C.21053.F3E7E1@peter.ssbg.zetnet.co.uk> +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/html; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.216 tagged_above=0 required=5 tests=HTML_MESSAGE, + HTML_TITLE_EMPTY, MIME_HTML_ONLY +X-Spam-Level: +X-Archive-Number: 200608/289 +X-Sequence-Number: 20474 + + + + + + + + +
On 17 Aug 2006 at 20:58, Peter Hardman wrote:
+

+
+
>
+
>
+
> On 16 Aug 2006 at 17:48, Peter Hardman wrote:
+
>
+
> > I'm in the process of migrating a Paradox 7/BDE 5.01 database from single-user
+
> > Paradox to a web based interface to either MySQL or PostgreSQL.
+
> <snip>
+
>
+
> I've uploaded my data to www.shetland-sheep.org.uk/pgdata/sheep-flock.zip
+

+
+
Sorry - that should be www.shetland-sheep.org.uk/pgdata/sheep_flock.zip
+
>
+
> The flock SSBXXX is the 'big flock in the sky' and thus there should never be any
+
> date for a sheep greater than this.
+
>
+
> Yes, the primary key is regn_no + flock_no + transfer_date.
+
>
+
> Thanks again for all the help and advice.
+
>
+
> Regards,--
+
> Peter Hardman
+
> Acre Cottage, Horsebridge
+
> King's Somborne
+
> Stockbridge
+
> SO20 6PT
+
>
+
> == Breeder of Shetland Cattle and Shetland Sheep ==
+
>
+
>
+
> ---------------------------(end of broadcast)---------------------------
+
> TIP 2: Don't 'kill -9' the postmaster
+
>
+

+
+
--
+
Peter Hardman
+
Acre Cottage, Horsebridge
+
King's Somborne
+
Stockbridge
+
SO20 6PT
+

+
+
== Breeder of Shetland Cattle and Shetland Sheep ==
+
+ + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 19:01:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 43CCF9FB3A9 + for ; + Thu, 17 Aug 2006 19:01:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 00726-09 for + ; + Thu, 17 Aug 2006 22:00:57 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from calvin.slamb.org (calvin.slamb.org [216.136.66.56]) + by postgresql.org (Postfix) with ESMTP id DD30B9FB350 + for ; + Thu, 17 Aug 2006 19:00:56 -0300 (ADT) +Received: by calvin.slamb.org (Postfix, from userid 103) + id 26C016FE9F; Thu, 17 Aug 2006 17:00:55 -0500 (CDT) +Received: from [IPv6:::1] (localhost.slamb.org [127.0.0.1]) + by calvin.slamb.org (Postfix) with ESMTP + id 6B5596FD5D; Thu, 17 Aug 2006 17:00:53 -0500 (CDT) +In-Reply-To: +References: <44E35A5D.19933.35F376@peter.ssbg.zetnet.co.uk> + <29246.1155768717@sss.pgh.pa.us> + +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Cc: Tom Lane , "Peter Hardman" , + pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Scott Lamb +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +Date: Thu, 17 Aug 2006 15:00:52 -0700 +To: Scott Lamb +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/290 +X-Sequence-Number: 20475 + +Peter, I compared these using the data you supplied on my PostgreSQL +8.1.4 system: + +On Aug 17, 2006, at 12:09 PM, Scott Lamb wrote: + +> On Aug 16, 2006, at 3:51 PM, Tom Lane wrote: +>>> /* Select all sheep who's most recent transfer was into the +>>> subject flock */ +>>> SELECT DISTINCT f1.regn_no, f1.transfer_date as date_in +>>> FROM SHEEP_FLOCK f1 JOIN +>>> /* The last transfer date for each sheep */ +>>> (SELECT f.regn_no, MAX(f.transfer_date) as last_xfer_date +>>> FROM SHEEP_FLOCK f +>>> GROUP BY f.regn_no) f2 +>>> ON f1.regn_no = f2.regn_no +>>> WHERE f1.flock_no = '1359' +>>> AND f1.transfer_date = f2.last_xfer_date + + + QUERY PLAN +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------ +Unique (cost=2575.07..2575.08 rows=1 width=36) (actual +time=1083.579..1083.696 rows=32 loops=1) + -> Sort (cost=2575.07..2575.07 rows=1 width=36) (actual +time=1083.576..1083.613 rows=32 loops=1) + Sort Key: f1.regn_no, f1.transfer_date + -> Nested Loop (cost=1364.00..2575.06 rows=1 width=36) +(actual time=287.895..1083.297 rows=32 loops=1) + -> HashAggregate (cost=1364.00..1366.50 rows=200 +width=36) (actual time=262.345..337.940 rows=38815 loops=1) + -> Seq Scan on sheep_flock f +(cost=0.00..1116.00 rows=49600 width=36) (actual time=0.005..119.282 +rows=81802 loops=1) + -> Index Scan using sheep_flock_pkey on sheep_flock +f1 (cost=0.00..6.02 rows=1 width=36) (actual time=0.016..0.016 +rows=0 loops=38815) + Index Cond: (((f1.regn_no)::text = +("outer".regn_no)::text) AND ((f1.flock_no)::text = '1359'::text) AND +(f1.transfer_date = "outer"."?column2?")) +Total runtime: 1085.115 ms +(9 rows) + +>> +>> This seems pretty closely related to this recent thread: +>> http://archives.postgresql.org/pgsql-performance/2006-08/msg00220.php +>> in which the OP is doing a very similar kind of query in almost +>> exactly +>> the same way. +>> +>> I can't help thinking that there's probably a better way to phrase +>> this +>> type of query in SQL, though it's not jumping out at me what that is. +> +> I don't know about better, but I tend to phrase these in a quite +> different way that's (hopefully) equivalent: +> +> select latest.regn_no, +> latest.transfer_date as date_in +> from sheep_flock latest +> where not exists ( +> select 'x' +> from sheep_flock even_later +> where latest.regn_no = even_later.regn_no +> and latest.transfer_date < even_later.transfer_date) +> and latest.flock_no = '1359' +> +> There's no MAX() or DISTINCT here, so maybe this is easier to +> optimize? + + Q +UERY PLAN +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------ +Bitmap Heap Scan on sheep_flock latest (cost=764.60..2185.05 +rows=124 width=36) (actual time=11.915..13.800 rows=32 loops=1) + Recheck Cond: ((flock_no)::text = '1359'::text) + Filter: (NOT (subplan)) + -> Bitmap Index Scan on sheep_flock_pkey (cost=0.00..764.60 +rows=248 width=0) (actual time=10.950..10.950 rows=127 loops=1) + Index Cond: ((flock_no)::text = '1359'::text) + SubPlan + -> Index Scan using sheep_flock_pkey on sheep_flock +even_later (cost=0.00..317.49 rows=83 width=0) (actual +time=0.016..0.016 rows=1 loops=127) + Index Cond: ((($0)::text = (regn_no)::text) AND ($1 < +transfer_date)) +Total runtime: 13.902 ms +(9 rows) + +seems to return the same data in two orders of magnitude less time. + +-- +Scott Lamb + + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 21:31:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 937ED9FB233 + for ; + Thu, 17 Aug 2006 21:31:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 58039-06 for + ; + Fri, 18 Aug 2006 00:31:53 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 551689FA6B2 + for ; + Thu, 17 Aug 2006 21:31:53 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7I0VqVU000966; + Thu, 17 Aug 2006 20:31:52 -0400 (EDT) +To: "Peter Hardman" +cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL runs a query much slower than BDE and MySQL +In-reply-to: <44E4DBE7.22131.10181D0@peter.ssbg.zetnet.co.uk> +References: <5321.1155820310@sss.pgh.pa.us> + <44E4DBE7.22131.10181D0@peter.ssbg.zetnet.co.uk> +Comments: In-reply-to "Peter Hardman" + message dated "Thu, 17 Aug 2006 21:13:11 +0100" +Date: Thu, 17 Aug 2006 20:31:51 -0400 +Message-ID: <965.1155861111@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/291 +X-Sequence-Number: 20476 + +"Peter Hardman" writes: +> On 17 Aug 2006 at 14:33, Tom Lane wrote: +>> I found a couple of minor planner problems, which I've repaired in CVS +>> HEAD. You might consider using TEXT columns instead of VARCHAR(n), + +> As someone else suggested, these fields ought really to be CHAR no VARCHAR. + +That should be fine too. VARCHAR is sort of a poor stepchild in +Postgres, because it piggybacks on TEXT's operators --- but CHAR +has different comparison rules, hence its own operators, hence +doesn't trip over that bug. + +There's still some things that don't add up to me, like the question +of the pkey column order. Will look some more. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 17 21:33:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B09019FB233 + for ; + Thu, 17 Aug 2006 21:33:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 95529-07 for + ; + Thu, 17 Aug 2006 21:33:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id 4D3939FA6B2 + for ; + Thu, 17 Aug 2006 21:33:30 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id 5CEB9540BC + for ; + Thu, 17 Aug 2006 20:33:28 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id uXQ94-hCbrZb for ; + Thu, 17 Aug 2006 20:33:28 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 2573A540BF; Thu, 17 Aug 2006 20:33:28 -0400 (EDT) +Date: Thu, 17 Aug 2006 20:33:27 -0400 +From: mark@mark.mielke.cc +To: pgsql-performance@postgresql.org +Subject: Q: Performance of join vs embedded query for simple queries? +Message-ID: <20060818003326.GA11682@mark.mielke.cc> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.185 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/292 +X-Sequence-Number: 20477 + +I have two simple queries that do what I believe to be the exact same +thing. I was surprised to see a reliable, and what I consider to be +significant (although not problematic for my application) difference +in execution time. It hints to me that PostgreSQL may be missing an +optimization opportunity? This is on PostgreSQL 8.1.4. + +For a quick summary of the relationships: + +I have a 79 row "system" table that describes each ClearCase system. +ClearCase uses uuid to uniquely identify database objects across the +life of the object. For this table, I store uid as a varchar(80), and +have a unique index on it: + +eudb=> \d sm_system + Table "public.sm_system" + Column | Type | Modifiers +-------------+------------------------+----------------------------------------------------------------- + system_dbid | integer | not null default nextval('sm_system_system_dbid_seq'::regclass) + type | character varying(10) | not null + uid | character varying(200) | not null + name | character varying(200) | not null + owner | character varying(80) | not null +Indexes: + "sm_system_pkey" PRIMARY KEY, btree (system_dbid) CLUSTER + "sm_system_type_key" UNIQUE, btree ("type", uid) +Check constraints: + "sm_system_type_check" CHECK ("type"::text = 'NEU'::text OR "type"::text = 'PLS'::text) + +I have a 339,586 row "change" table that describes each ClearCase +activity. Each activity has a name that should be unique, but may not +be unique across time. Uniqueness is relative to the system that +contains it. + + Table "public.sm_change" + Column | Type | Modifiers +----------------+--------------------------------+----------------------------------------------------------------- + change_dbid | integer | not null default nextval('sm_change_change_dbid_seq'::regclass) + system_dbid | integer | not null + stream_dbid | integer | not null + uid | character varying(200) | not null + name | character varying(200) | not null + status | character varying(20) | not null + owner | character varying(80) | not null + target | integer | + creationtime | timestamp(0) without time zone | not null + submissiontime | timestamp(0) without time zone | not null + comments | text | + elements | text | +Indexes: + "sm_change_pkey" PRIMARY KEY, btree (change_dbid) CLUSTER + "sm_change_system_dbid_key" UNIQUE, btree (system_dbid, uid) + "sm_change_name_key" btree (lower(name::text)) + "sm_change_stream_dbid_key" btree (stream_dbid) + "sm_change_target_key" btree (target) +Foreign-key constraints: + "sm_change_stream_dbid_fkey" FOREIGN KEY (stream_dbid) REFERENCES sm_stream(stream_dbid) + "sm_change_system_dbid_fkey" FOREIGN KEY (system_dbid) REFERENCES sm_system(system_dbid) + "sm_change_target_fkey" FOREIGN KEY (target) REFERENCES sm_change(change_dbid) + + +One of the made up queries that I played with was a lookup on the system uuid, and the +activity name. This is the one that I noticed the timing difference: + +neudb=> select uid, name from sm_change where system_dbid = (select system_dbid from sm_system where uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da') and lower(name) = lower('markm-Q00855572'); + uid | name +------------------------------------------+----------------- + ff733174.6c7411d8.900c.00:06:5b:b3:db:28 | markm-Q00855572 +(1 row) + +Time: 1.242 ms + + +The 1.242 ms is pretty stable. 1.226 ms -> 1.248 ms over 5 runs. + +Then we have: + +neudb=> select sm_change.uid, sm_change.name from sm_change join sm_system using (system_dbid) where sm_system.uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da' and lower(sm_change.name) = lower('markm-Q00855572'); + uid | name +------------------------------------------+----------------- + ff733174.6c7411d8.900c.00:06:5b:b3:db:28 | markm-Q00855572 +(1 row) + +Time: 1.500 ms + + +This time is less stable - it runs from 1.394 ms -> 1.561 ms over 5 runs. + +As I mentioned - for my application, I don't really care. If it took +10 ms or more, I wouldn't care. But the difference in time bothered me. +So, here are the query plans that PostgreSQL selected for me: + + +neudb=> explain analyze select uid, name from sm_change where system_dbid = (select system_dbid from sm_system where uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da') and lower(name) = lower('markm-Q00855572'); + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------- + Index Scan using sm_change_name_key on sm_change (cost=2.99..7.82 rows=1 width=80) (actual time=0.322..0.328 rows=1 loops=1) + Index Cond: (lower((name)::text) = 'markm-q00855572'::text) + Filter: (system_dbid = $0) + InitPlan + -> Seq Scan on sm_system (cost=0.00..2.99 rows=1 width=4) (actual time=0.052..0.106 rows=1 loops=1) + Filter: ((uid)::text = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da'::text) + Total runtime: 0.419 ms +(7 rows) + +Time: 16.494 ms + + +neudb=> explain analyze select sm_change.uid, sm_change.name from sm_change join sm_system using (system_dbid) where sm_system.uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da' and lower(sm_change.name) = lower('markm-Q00855572'); + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------- + Nested Loop (cost=0.00..7.83 rows=1 width=80) (actual time=0.099..0.159 rows=1 loops=1) + Join Filter: ("outer".system_dbid = "inner".system_dbid) + -> Index Scan using sm_change_name_key on sm_change (cost=0.00..4.83 rows=1 width=84) (actual time=0.053..0.059 rows=1 loops=1) + Index Cond: (lower((name)::text) = 'markm-q00855572'::text) + -> Seq Scan on sm_system (cost=0.00..2.99 rows=1 width=4) (actual time=0.030..0.077 rows=1 loops=1) + Filter: ((uid)::text = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da'::text) + Total runtime: 0.250 ms +(7 rows) + +Time: 1.898 ms + + +I'm still learning how PostgreSQL works internally. My understanding +is that the above are essentially the same. The first finds the system +row using a sequential scan, then looks for the change row using the +index, filtering by the system value. The second finds the change rows +using the same index, expecting to find one row, and finding only one +row, and matches it up against the system row using a sequential scan. + +So why does one reliably run faster than the other? + +neudb=> prepare plan1 (varchar(80), varchar(80)) as select uid, name from sm_change where system_dbid = (select system_dbid from sm_system where uid = $1) and lower(name) = lower($2); + +neudb=> prepare plan2 (varchar(80), varchar(80)) as select sm_change.uid, sm_change.name from sm_change join sm_system using (system_dbid) where sm_system.uid = $1 and lower(sm_change.name) = lower($2); + +Now: + +neudb=> execute plan1 ('2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da', 'markm-q00855572'); + uid | name +------------------------------------------+----------------- + ff733174.6c7411d8.900c.00:06:5b:b3:db:28 | markm-Q00855572 +(1 row) + +Time: 0.794 ms + + +neudb=> execute plan2 ('2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da', 'markm-q00855572'); + uid | name +------------------------------------------+----------------- + ff733174.6c7411d8.900c.00:06:5b:b3:db:28 | markm-Q00855572 +(1 row) + +Time: 0.715 ms + + +The numbers above don't mean anything. I ran both a few dozen times, and my conclusion +is that after the plan is prepared (I did explain analyze to ensure that the prepared +plans were the same as the dynamically generated plans), the times are the same. Both +ranged from 0.690 ms -> 0.850 ms. Timings at these resolutions are not so reliable. :-) + +I think this means that the planner takes longer to figure out what to do about the +join, and that my writing the select out as an embedded select reduces the effort +required by the planner. This makes sense to me, except that I thought PostgreSQL +would convert back and forth between the two forms automatically. They are the same +query, are they not? Why wouldn't they both take longer, or both take shorter? What +if I invented a scenario where the difference in plans made a major difference, +such as making the system table much larger, still without an index? Should they +not both come up with the same plan - the better estimated plan? + +Am I expecting too much? :-) + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 22:21:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3EC7E9FB346 + for ; + Thu, 17 Aug 2006 22:21:42 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 01193-01 for + ; + Thu, 17 Aug 2006 22:21:35 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id E52A49FB326 + for ; + Thu, 17 Aug 2006 22:21:35 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7I1LXTb001485; + Thu, 17 Aug 2006 21:21:33 -0400 (EDT) +To: mark@mark.mielke.cc +cc: pgsql-performance@postgresql.org +Subject: Re: Q: Performance of join vs embedded query for simple queries? +In-reply-to: <20060818003326.GA11682@mark.mielke.cc> +References: <20060818003326.GA11682@mark.mielke.cc> +Comments: In-reply-to mark@mark.mielke.cc + message dated "Thu, 17 Aug 2006 20:33:27 -0400" +Date: Thu, 17 Aug 2006 21:21:33 -0400 +Message-ID: <1484.1155864093@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.176 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/293 +X-Sequence-Number: 20478 + +mark@mark.mielke.cc writes: +> I have two simple queries that do what I believe to be the exact same +> thing. + +These are actually not equivalent per spec. + +> neudb=> select uid, name from sm_change where system_dbid = (select system_dbid from sm_system where uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da') and lower(name) = lower('markm-Q00855572'); + +> neudb=> select sm_change.uid, sm_change.name from sm_change join sm_system using (system_dbid) where sm_system.uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da' and lower(sm_change.name) = lower('markm-Q00855572'); + +The subselect form constrains the sub-select to return at most one row +--- you'd have gotten an error if there were more than one sm_system row +with that uid. The join form does not make this constraint. + +Another related form is + +neudb=> select uid, name from sm_change where system_dbid IN (select system_dbid from sm_system where uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da') and lower(name) = lower('markm-Q00855572'); + +This still isn't equivalent to the join: it'll return at most one copy +of any sm_change row, whereas you can get multiple copies of the same +sm_change row from the join, if there were multiple matching sm_system +rows. (Hm, given the unique index on (system_dbid, uid), I guess that +couldn't actually happen --- but you have to reason about it knowing +that that index is there, it's not obvious from the form of the query.) + +Anyway: given the way that the planner works, the IN form and the join +form will probably take comparable amounts of time to plan. The "= +subselect" form is much more constrained in terms of the number of +alternative implementations we have, so it doesn't surprise me that it +takes less time to plan. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 17 23:21:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ECF779FB326 + for ; + Thu, 17 Aug 2006 23:21:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 04518-03 for + ; + Thu, 17 Aug 2006 23:21:33 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id C1C2A9FB231 + for ; + Thu, 17 Aug 2006 23:21:33 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id CD98B540BC; + Thu, 17 Aug 2006 22:21:31 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 1r2qq65LLU9m; Thu, 17 Aug 2006 22:21:31 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 95D39540BF; Thu, 17 Aug 2006 22:21:31 -0400 (EDT) +Date: Thu, 17 Aug 2006 22:21:31 -0400 +From: mark@mark.mielke.cc +To: Tom Lane +Cc: pgsql-performance@postgresql.org +Subject: Re: Q: Performance of join vs embedded query for simple queries? +Message-ID: <20060818022131.GA15599@mark.mielke.cc> +References: <20060818003326.GA11682@mark.mielke.cc> + <1484.1155864093@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1484.1155864093@sss.pgh.pa.us> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.18 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/294 +X-Sequence-Number: 20479 + +On Thu, Aug 17, 2006 at 09:21:33PM -0400, Tom Lane wrote: +> mark@mark.mielke.cc writes: +> > I have two simple queries that do what I believe to be the exact same +> > thing. +> These are actually not equivalent per spec. +> ... +> This still isn't equivalent to the join: it'll return at most one copy +> of any sm_change row, whereas you can get multiple copies of the same +> sm_change row from the join, if there were multiple matching sm_system +> rows. (Hm, given the unique index on (system_dbid, uid), I guess that +> couldn't actually happen --- but you have to reason about it knowing +> that that index is there, it's not obvious from the form of the query.) + +> Anyway: given the way that the planner works, the IN form and the join +> form will probably take comparable amounts of time to plan. The "= +> subselect" form is much more constrained in terms of the number of +> alternative implementations we have, so it doesn't surprise me that it +> takes less time to plan. + +That makes sense. Would it be reasonable for the planner to eliminate +plan considerations based on the existence of unique indexes, or is +this a fundamentally difficult thing to get right in the general case? + +I did the elimination in my head, which is why I considered the plans to +be the same. Can the planner do it? + +Sub-millisecond planning/execution for simple queries on moderate +hardware seems sexy... :-) + +Thanks, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 23:30:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id AB4699FB326 + for ; + Thu, 17 Aug 2006 23:30:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 80883-06 for + ; + Fri, 18 Aug 2006 02:30:34 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) + by postgresql.org (Postfix) with ESMTP id 4AF9E9F95CB + for ; + Thu, 17 Aug 2006 23:30:34 -0300 (ADT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by mail.envysolutions.com (Postfix) with ESMTP id E3EAB540BC; + Thu, 17 Aug 2006 22:30:32 -0400 (EDT) +X-Virus-Scanned: amavisd-new at mail.envysolutions.com +Received: from mail.envysolutions.com ([127.0.0.1]) + by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 6D1NKZM0vslX; Thu, 17 Aug 2006 22:30:32 -0400 (EDT) +Received: by mail.envysolutions.com (Postfix, from userid 500) + id 9D7A0540BF; Thu, 17 Aug 2006 22:30:32 -0400 (EDT) +Date: Thu, 17 Aug 2006 22:30:32 -0400 +From: mark@mark.mielke.cc +To: Tom Lane +Cc: pgsql-performance@postgresql.org +Subject: Re: Q: Performance of join vs embedded query for simple queries? +Message-ID: <20060818023032.GB15599@mark.mielke.cc> +References: <20060818003326.GA11682@mark.mielke.cc> + <1484.1155864093@sss.pgh.pa.us> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1484.1155864093@sss.pgh.pa.us> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.094 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, NO_REAL_NAME, SPF_HELO_PASS, SPF_PASS +X-Spam-Level: * +X-Archive-Number: 200608/295 +X-Sequence-Number: 20480 + +On Thu, Aug 17, 2006 at 09:21:33PM -0400, Tom Lane wrote: +> Another related form is +> +> neudb=> select uid, name from sm_change where system_dbid IN (select system_dbid from sm_system where uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da') and lower(name) = lower('markm-Q00855572'); +> ... +> Anyway: given the way that the planner works, the IN form and the join +> form will probably take comparable amounts of time to plan. The "= +> subselect" form is much more constrained in terms of the number of +> alternative implementations we have, so it doesn't surprise me that it +> takes less time to plan. + +FYI: You are correct. The IN takes about as long as the join to plan, +and does generate the same plan as the join. This restores confidence +for me that PostgreSQL is able to understand the two as equivalent. + +With regard to that unique constraint planning - I gave you the wrong +query from my log. I had already thought that through, and realized +that my original query missed the type. The timings and plans are the +functionally the same for all the three queries, with or without the +type qualifier. This is the table: + + Table "public.sm_system" + Column | Type | Modifiers +-------------+------------------------+----------------------------------------------------------------- + system_dbid | integer | not null default nextval('sm_system_system_dbid_seq'::regclass) + type | character varying(10) | not null + uid | character varying(200) | not null + name | character varying(200) | not null + owner | character varying(80) | not null +Indexes: + "sm_system_pkey" PRIMARY KEY, btree (system_dbid) CLUSTER + "sm_system_type_key" UNIQUE, btree ("type", uid) +Check constraints: + "sm_system_type_check" CHECK ("type"::text = 'NEU'::text OR "type"::text = 'PLS'::text) + +And this is what the query should have been: + +neudb=> explain analyze select uid, name from sm_change where system_dbid IN (select system_dbid from sm_system where type = 'NEU' and uid = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da') and lower(name) = lower('markm-Q00855572'); + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------- + Nested Loop IN Join (cost=0.00..7.86 rows=1 width=80) (actual time=19.438..19.453 rows=1 loops=1) + -> Index Scan using sm_change_name_key on sm_change (cost=0.00..4.83 rows=1 width=84) (actual time=0.064..0.073 rows=1 loops=1) + Index Cond: (lower((name)::text) = 'markm-q00855572'::text) + -> Index Scan using sm_system_pkey on sm_system (cost=0.00..3.02 rows=1 width=4) (actual time=19.358..19.358 rows=1 loops=1) + Index Cond: ("outer".system_dbid = sm_system.system_dbid) + Filter: ((("type")::text = 'NEU'::text) AND ((uid)::text = '2ff5942c.dd2911d5.ad56.08:00:09:fd:1b:da'::text)) + Total runtime: 19.568 ms +(7 rows) + +Time: 21.449 ms + + +I guess the case isn't as simple as I thought. It would need to recognize +that the specification of both the 'type' and the 'uid' are static, and +unique, therefore the argument to the IN, or the table that it is joining +with will be either 0 rows or 1 row. Too complicated to be worth it, eh? :-) + +Cheers, +mark + +-- +mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ +. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder +|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | +| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada + + One ring to rule them all, one ring to find them, one ring to bring them all + and in the darkness bind them... + + http://mark.mielke.cc/ + + +From pgsql-performance-owner@postgresql.org Thu Aug 17 23:37:24 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5D2659FB20C + for ; + Thu, 17 Aug 2006 23:37:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 05167-05 for + ; + Thu, 17 Aug 2006 23:37:18 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id CE6C49FB206 + for ; + Thu, 17 Aug 2006 23:37:18 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7I2bGKX002306; + Thu, 17 Aug 2006 22:37:16 -0400 (EDT) +To: mark@mark.mielke.cc +cc: pgsql-performance@postgresql.org +Subject: Re: Q: Performance of join vs embedded query for simple queries? +In-reply-to: <20060818022131.GA15599@mark.mielke.cc> +References: <20060818003326.GA11682@mark.mielke.cc> + <1484.1155864093@sss.pgh.pa.us> + <20060818022131.GA15599@mark.mielke.cc> +Comments: In-reply-to mark@mark.mielke.cc + message dated "Thu, 17 Aug 2006 22:21:31 -0400" +Date: Thu, 17 Aug 2006 22:37:16 -0400 +Message-ID: <2305.1155868636@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.176 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/296 +X-Sequence-Number: 20481 + +mark@mark.mielke.cc writes: +> That makes sense. Would it be reasonable for the planner to eliminate +> plan considerations based on the existence of unique indexes, or is +> this a fundamentally difficult thing to get right in the general case? + +The big obstacle to that at the moment is that we don't have any plan +cache invalidation mechanism; so a plan that depended for correctness on +the existence of a unique index might silently give wrong results after +someone drops the index and inserts non-unique values into the table. +(If the plan actually *uses* the index, then you'd at least get an +access failure ... but if the index was merely used to make an +assumption at plan time, you wouldn't.) + +The present "constraint_exclusion" mechanism will actually fail in +exactly this kind of scenario, which is why I insisted it be off by +default :-( + +This has been on the radar screen for awhile. I'd hoped we'd get a +plan invalidation mechanism in place for 8.2, but seems that's not +happening. Eventually it'll be there, though, and then we can get +more aggressive about making deductions based on constraints. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Aug 18 03:46:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 25BE09FB3C7 + for ; + Fri, 18 Aug 2006 03:46:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 21873-09 for + ; + Fri, 18 Aug 2006 03:46:30 -0300 (ADT) +X-Greylist: delayed 00:23:13.788508 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 311669FB3CD + for ; + Fri, 18 Aug 2006 03:46:30 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from gamma.datatechlabs.com (gamma.datatechlabs.com [80.81.37.226]) + by svr4.postgresql.org (Postfix) with ESMTP id 2C25E5AF03F + for ; + Fri, 18 Aug 2006 06:23:15 +0000 (GMT) +Received: from [10.1.1.205] (gamma.datatechlabs.com [80.81.37.227]) + by gamma.datatechlabs.com (Postfix) with ESMTP id 903541CC8E; + Fri, 18 Aug 2006 06:16:34 +0000 (UTC) +Message-ID: <44E58699.1070806@datatechlabs.com> +Date: Fri, 18 Aug 2006 09:21:29 +0000 +From: alvis +User-Agent: Thunderbird 1.5.0.4 (X11/20060718) +MIME-Version: 1.0 +To: Bucky Jordan +Cc: pgsql-performance@postgresql.org +Subject: Re: Dell PowerEdge 2950 performance +References: <78ED28FACE63744386D68D8A9D1CF5D41049CB@MAIL.corp.lumeta.com> +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D41049CB@MAIL.corp.lumeta.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.142 tagged_above=0 required=5 tests=SPF_FAIL +X-Spam-Level: * +X-Archive-Number: 200608/297 +X-Sequence-Number: 20482 + +Bucky Jordan wrote: +> Here's some simplistic performance numbers: +> time bash -c "(dd if=/dev/zero of=bigfile count=125000 bs=8k && sync)" +> +> Raid0 x 2 (2 spindles) ~138 MB/s on BSD +> +PE2950 FreeBSD6.1 i386 raid0 (2spindles): + +time csh -c "(dd if=/dev/zero of=/data/bigfile count=125000 bs=8k && sync)" +125000+0 records in +125000+0 records out +1024000000 bytes transferred in 7.070130 secs (144834680 bytes/sec) +0.070u 2.677s 0:07.11 38.5% 23+224k 31+7862io 0pf+0w + +mfi0: . +I recompiled kernel to get latest mfi driver. +Also "bce" NIC driver is buggy for 6.1 kernel you got in CD distro. Make +sure you have latest drivers for bsd 6.1. +bonnie++ +Version 1.93c ------Sequential Output------ --Sequential Input- +--Random- +Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP +raid0 16000M 262 99 116527 38 26451 12 495 99 135301 46 +323.5 15 +Latency 32978us 323ms 242ms 23842us 171ms +1370ms +Version 1.93c ------Sequential Create------ --------Random +Create-------- +raid0 -Create-- --Read--- -Delete-- -Create-- --Read--- +-Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 5837 19 +++++ +++ +++++ +++ 3463 11 +++++ +++ ++++++ +++ +Latency 555ms 422us 43us 1023ms 52us +60us +1.93c,1.93c,raid0,1,1155819725,16000M,,262,99,116527,38,26451,12,495,99,135301,46,323.5,15,16,,,,,5837,19,+++++,+++,+++++,+++,3463,11,+++++,+++,+++++,+++,32978us,323ms,242ms,23842us,171ms,1370ms,555ms,422us,43us,1023ms,52us,60us + + +-- +Best Regards, +alvis + + + +From pgsql-performance-owner@postgresql.org Fri Aug 18 07:49:52 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 802819FB1BE + for ; + Fri, 18 Aug 2006 07:49:51 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 19315-02 for + ; + Fri, 18 Aug 2006 10:49:42 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx-2.sollentuna.net (mx-2.sollentuna.net [195.84.163.199]) + by postgresql.org (Postfix) with ESMTP id 47E289FA7BA + for ; + Fri, 18 Aug 2006 07:49:42 -0300 (ADT) +Received: from ALGOL.sollentuna.se (janus.sollentuna.se [62.65.68.67]) + by mx-2.sollentuna.net (Postfix) with ESMTP + id DCFF3F4102; Fri, 18 Aug 2006 12:49:40 +0200 (CEST) +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Subject: Re: Hardware upgraded but performance still ain't good +Date: Fri, 18 Aug 2006 12:49:40 +0200 +Message-ID: <6BCB9D8A16AC4241919521715F4D8BCEA35537@algol.sollentuna.se> +In-Reply-To: <44D9D96E.7030706@commandprompt.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Hardware upgraded but performance still ain't good +Thread-Index: Aca7sh8OVN7Sl+coS92WuLEPQqJqCAHAYrQQ +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <44D9D96E.7030706@commandprompt.com> +From: "Magnus Hagander" +To: "Joshua D. Drake" , "Alex Turner" +Cc: "Alvaro Nunes Melo" , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/298 +X-Sequence-Number: 20483 + +> > First off - very few third party tools support debian. Debian is +> a +> > sure fire way to have an unsupported system. Use RedHat or SuSe +> > (flame me all you want, it doesn't make it less true). +>=20 +> *cough* BS *cough* +>=20 +> Linux is Linux. It doesn't matter what trademark you put on top of +> it. +> As long as they are running a current version of Linux (e.g; kernel +> 2.6) they should be fine. + +Unfortunatly, that' not my experience either. +Both RedHat and SuSE heavily modify the kernel. So anything that needs +anything near kernel space (two examples: the HP management/monitoring +tools and the EMC/Legato Networker backup software) simply does not work +on Linux (linux being the kernel from kernel.org). They only work on +RedHat/SuSE. To the point of not compiling/starting/working, not just +the support part. + +(One could argue that they shouldn't claim linux support then, but +specifically RH/SuSE, but I don't expect them to do that..) + +BTW, it used to work much better with 2.4, but since there is no real +"stable series" kernel in 2.6, it's just a lost cause there it seems. + +//Magnus + + +From pgsql-performance-owner@postgresql.org Fri Aug 18 07:50:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 40F8E9FA7BA + for ; + Fri, 18 Aug 2006 07:50:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 18715-04 for + ; + Fri, 18 Aug 2006 10:50:45 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx-2.sollentuna.net (mx-2.sollentuna.net [195.84.163.199]) + by postgresql.org (Postfix) with ESMTP id 6A0589FB1BE + for ; + Fri, 18 Aug 2006 07:50:45 -0300 (ADT) +Received: from ALGOL.sollentuna.se (janus.sollentuna.se [62.65.68.67]) + by mx-2.sollentuna.net (Postfix) with ESMTP + id 258CCF4109; Fri, 18 Aug 2006 12:50:44 +0200 (CEST) +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Fri, 18 Aug 2006 12:50:43 +0200 +Message-ID: <6BCB9D8A16AC4241919521715F4D8BCEA35538@algol.sollentuna.se> +In-Reply-To: <721b21dc0608071928ve091390p1cf8226c62efd4@mail.gmail.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: Aca6knv8wiJBjMdJSeei3JZHFv8MzQIIZV8A +References: + <44D7F49C.9000601@commandprompt.com> + <721b21dc0608071928ve091390p1cf8226c62efd4@mail.gmail.com> +From: "Magnus Hagander" +To: "Steve Poe" , + "Joshua D. Drake" +Cc: "Luke Lonergan" , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/299 +X-Sequence-Number: 20484 + +> There is 64MB on the 6i and 192MB on the 642 controller. I wish the +> controllers had a "wrieback" enable option like the LSI MegaRAID +> adapters have. I have tried splitting the cache accelerator 25/75 +> 75/25 0/100 100/0 but the results really did not improve. + +They have a writeback option, but you can't enable it unless you buy the +battery-pack for the controller. I believe it's enabled by default once +you get the BBWC. + +//Magnus + + +From pgsql-performance-owner@postgresql.org Fri Aug 18 10:14:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id B25EE9FB1EC + for ; + Fri, 18 Aug 2006 10:14:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 47193-09 for + ; + Fri, 18 Aug 2006 13:14:12 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.201]) + by postgresql.org (Postfix) with ESMTP id 029AE9FB34F + for ; + Fri, 18 Aug 2006 10:14:11 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id l8so495035nzf + for ; + Fri, 18 Aug 2006 06:14:08 -0700 (PDT) +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=Fl2mgQGPBpJQMEhlkjcaVi1Fj1knIAwqV2EHlj2mZAEWrBpJDb+jwWeice3gBPu0CVKN1rrsfhH/L9AbWMocK1qUpgOmISiX5sbqQ4qs4a6c/NQ6UFruJRvwDfxRAcGW9G46OXSATd7sfiHXjxg8CAxrNgYzVtSfaI0uQMEKtFM= +Received: by 10.65.237.1 with SMTP id o1mr3637637qbr; + Fri, 18 Aug 2006 06:14:08 -0700 (PDT) +Received: by 10.65.139.10 with HTTP; Fri, 18 Aug 2006 06:14:08 -0700 (PDT) +Message-ID: +Date: Fri, 18 Aug 2006 09:14:08 -0400 +From: "Merlin Moncure" +To: "Magnus Hagander" +Subject: Re: Hardware upgraded but performance still ain't good +Cc: "Joshua D. Drake" , + "Alex Turner" , + "Alvaro Nunes Melo" , + pgsql-performance@postgresql.org +In-Reply-To: <6BCB9D8A16AC4241919521715F4D8BCEA35537@algol.sollentuna.se> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44D7B958.6030004@atua.com.br> + <33c6269f0608072333o67ab6adei29095091718901dc@mail.gmail.com> + <44D9D96E.7030706@commandprompt.com> + <6BCB9D8A16AC4241919521715F4D8BCEA35537@algol.sollentuna.se> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/300 +X-Sequence-Number: 20485 + +On 8/18/06, Magnus Hagander wrote: +> > > First off - very few third party tools support debian. Debian is +> > a +> > > sure fire way to have an unsupported system. Use RedHat or SuSe +> > > (flame me all you want, it doesn't make it less true). +> > +> > *cough* BS *cough* +> > +> > Linux is Linux. It doesn't matter what trademark you put on top of +> > it. +> > As long as they are running a current version of Linux (e.g; kernel +> > 2.6) they should be fine. +> +> Unfortunatly, that' not my experience either. +> Both RedHat and SuSE heavily modify the kernel. So anything that needs +> anything near kernel space (two examples: the HP management/monitoring +> tools and the EMC/Legato Networker backup software) simply does not work +> on Linux (linux being the kernel from kernel.org). They only work on +> RedHat/SuSE. To the point of not compiling/starting/working, not just +> the support part. +> +> (One could argue that they shouldn't claim linux support then, but +> specifically RH/SuSE, but I don't expect them to do that..) +> +> BTW, it used to work much better with 2.4, but since there is no real +> "stable series" kernel in 2.6, it's just a lost cause there it seems. + +From pgsql-performance-owner@postgresql.org Fri Aug 18 11:38:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 98CF29FB221 + for ; + Fri, 18 Aug 2006 11:38:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 58059-08 for + ; + Fri, 18 Aug 2006 11:38:22 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exprod6og54.obsmtp.com (exprod6og54.obsmtp.com [64.18.1.189]) + by postgresql.org (Postfix) with SMTP id D74E49FA621 + for ; + Fri, 18 Aug 2006 11:38:21 -0300 (ADT) +Received: from source ([63.240.6.44]) by exprod6ob54.postini.com + ([64.18.5.12]) with SMTP; Fri, 18 Aug 2006 07:38:14 PDT +Received: from 172.16.1.112 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D4)); Fri, 18 Aug 2006 10:38:02 -0400 +X-Server-Uuid: C8FB4D43-1108-484A-A898-3CBCC7906230 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 18 Aug + 2006 10:37:35 -0400 +Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.106]) with Microsoft Exchange Server HTTP-DAV ; Fri, 18 Aug + 2006 14:37:34 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Fri, 18 Aug 2006 07:37:32 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: steve.poe@gmail.com, + "Scott Marlowe" +cc: "Michael Stone" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: AcbC09aLFVkJGS7HEduD2wAWy4o9DA== +In-Reply-To: <1155780633.11188.5.camel@amd64-gentoo-laptop> +MIME-Version: 1.0 +X-OriginalArrivalTime: 18 Aug 2006 14:37:35.0213 (UTC) + FILETIME=[D875E1D0:01C6C2D3] +X-WSS-ID: 68FB0F433FW3141066-07-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.659 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/301 +X-Sequence-Number: 20486 + +Steve, + +If this is an internal RAID1 on two disks, it looks great. + +Based on the random seeks though (578 seeks/sec), it looks like maybe it's 6 +disks in a RAID10? + +- Luke + + +On 8/16/06 7:10 PM, "Steve Poe" wrote: + +> Everyone, +> +> I wanted to follow-up on bonnie results for the internal RAID1 which is +> connected to the SmartArray 6i. I believe this is the problem, but I am +> not good at interepting the results. Here's an sample of three runs: +> +> scsi disc +> array ,16G,47983,67,65492,20,37214,6,73785,87,89787,6,578.2,0,16,+++++, +> +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> scsi disc +> array ,16G,54634,75,67793,21,36835,6,74190,88,89314,6,579.9,0,16,+++++, +> +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> scsi disc +> array ,16G,55056,76,66108,20,36859,6,74108,87,89559,6,585.0,0,16,+++++, +> +++,+++++,+++,+++++,+++,+++++,+++,+ +> +> This was run on the internal RAID1 on the outer portion of the discs +> formatted at ext2. +> +> Thanks. +> +> Steve +> +> On Thu, 2006-08-10 at 10:35 -0500, Scott Marlowe wrote: +>> On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote: +>>> Mike, +>>> +>>> On 8/10/06 4:09 AM, "Michael Stone" wrote: +>>> +>>>> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +>>>>> I tried as you suggested and my performance dropped by 50%. I went from +>>>>> a 32 TPS to 16. Oh well. +>>>> +>>>> If you put data & xlog on the same array, put them on seperate +>>>> partitions, probably formatted differently (ext2 on xlog). +>>> +>>> If he's doing the same thing on both systems (Sun and HP) and the HP +>>> performance is dramatically worse despite using more disks and having faster +>>> CPUs and more RAM, ISTM the problem isn't the configuration. +>>> +>>> Add to this the fact that the Sun machine is CPU bound while the HP is I/O +>>> wait bound and I think the problem is the disk hardware or the driver +>>> therein. +>> +>> I agree. The problem here looks to be the RAID controller. +>> +>> Steve, got access to a different RAID controller to test with? +>> +>> ---------------------------(end of broadcast)--------------------------- +>> TIP 1: if posting/reading through Usenet, please send an appropriate +>> subscribe-nomail command to majordomo@postgresql.org so that your +>> message can get through to the mailing list cleanly +> +> + + + +From pgsql-performance-owner@postgresql.org Fri Aug 18 12:26:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D92199FA621 + for ; + Fri, 18 Aug 2006 12:26:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 90880-03 for + ; + Fri, 18 Aug 2006 15:26:04 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by postgresql.org (Postfix) with ESMTP id 32D3A9FA4F0 + for ; + Fri, 18 Aug 2006 12:26:03 -0300 (ADT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Postgresql Performance on an HP DL385 and +Date: Fri, 18 Aug 2006 11:26:02 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104A84@MAIL.corp.lumeta.com> +In-Reply-To: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: AcbC09aLFVkJGS7HEduD2wAWy4o9DAABXXkg +From: "Bucky Jordan" +To: "Luke Lonergan" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.6 tagged_above=0 required=5 tests=SARE_BAYES_5x7 +X-Spam-Level: +X-Archive-Number: 200608/302 +X-Sequence-Number: 20487 + +That's about what I was getting for a 2 disk RAID 0 setup on a PE 2950. +Here's bonnie++ numbers for the RAID10x4 and RAID0x2, unfortunately I +only have the 1.93 numbers since this was before I got the advice to run +with the earlier version of bonnie and larger file sizes, so I don't +know how meaningful they are. + +RAID 10x4 +bash-2.05b$ bonnie++ -d bonnie -s 1000:8k +Version 1.93c ------Sequential Output------ --Sequential Input- +--Random- +Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 1000M 585 99 21705 4 28560 9 1004 99 812997 98 5436 +454 +Latency 14181us 81364us 50256us 57720us 1671us +1059ms +Version 1.93c ------Sequential Create------ --------Random +Create-------- +c -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 4712 10 +++++ +++ +++++ +++ 4674 10 +++++ +++ ++++++ +++ +Latency 807ms 21us 36us 804ms 110us +36us +1.93c,1.93c, +,1,1155207445,1000M,,585,99,21705,4,28560,9,1004,99,812997,98,5436,454,1 +6,,,,,4712,10,+++++,+++,+++++,+++,4674,10,+++++,+++,+++++,+++,14181us,81 +364us,50256us,57720us,1671us,1059ms,807ms,21us,36us,804ms,110us,36us +bash-2.05b$ + +RAID 0x2 +bash-2.05b$ bonnie++ -d bonnie -s 1000:8k +Version 1.93c ------Sequential Output------ --Sequential Input- +--Random- +Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 1000M 575 99 131621 25 104178 26 1004 99 816928 99 6233 +521 +Latency 14436us 26663us 47478us 54796us 1487us +38924us +Version 1.93c ------Sequential Create------ --------Random +Create-------- +-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 4935 10 +++++ +++ +++++ +++ 5198 11 +++++ +++ ++++++ +++ +Latency 738ms 32us 43us 777ms 24us +30us +1.93c,1.93c,beast.corp.lumeta.com,1,1155210203,1000M,,575,99,131621,25,1 +04178,26,1004,99,816928,99,6233,521,16,,,,,4935,10,+++++,+++,+++++,+++,5 +198,11,+++++,+++,+++++,+++,14436us,26663us,47478us,54796us,1487us,38924u +s,738ms,32us,43us,777ms,24us,30us + +A RAID 5 configuration seems to outperform this on the PE 2950 though +(at least in terms of raw read/write perf) + +If anyone's interested in some more detailed tests of the 2950, I might +be able to reconfigure the raid for some tests next week before I start +setting up the box for long term use, so I'm open to suggestions. See +earlier posts in this thread for details about the hardware. + +Thanks, + +Bucky + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Luke +Lonergan +Sent: Friday, August 18, 2006 10:38 AM +To: steve.poe@gmail.com; Scott Marlowe +Cc: Michael Stone; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Postgresql Performance on an HP DL385 and + +Steve, + +If this is an internal RAID1 on two disks, it looks great. + +Based on the random seeks though (578 seeks/sec), it looks like maybe +it's 6 +disks in a RAID10? + +- Luke + + +On 8/16/06 7:10 PM, "Steve Poe" wrote: + +> Everyone, +>=20 +> I wanted to follow-up on bonnie results for the internal RAID1 which +is +> connected to the SmartArray 6i. I believe this is the problem, but I +am +> not good at interepting the results. Here's an sample of three runs: +>=20 +> scsi disc +> array +,16G,47983,67,65492,20,37214,6,73785,87,89787,6,578.2,0,16,+++++, +> +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> scsi disc +> array +,16G,54634,75,67793,21,36835,6,74190,88,89314,6,579.9,0,16,+++++, +> +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> scsi disc +> array +,16G,55056,76,66108,20,36859,6,74108,87,89559,6,585.0,0,16,+++++, +> +++,+++++,+++,+++++,+++,+++++,+++,+ +>=20 +> This was run on the internal RAID1 on the outer portion of the discs +> formatted at ext2. +>=20 +> Thanks. +>=20 +> Steve +>=20 +> On Thu, 2006-08-10 at 10:35 -0500, Scott Marlowe wrote: +>> On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote: +>>> Mike, +>>>=20 +>>> On 8/10/06 4:09 AM, "Michael Stone" +wrote: +>>>=20 +>>>> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +>>>>> I tried as you suggested and my performance dropped by 50%. I went +from +>>>>> a 32 TPS to 16. Oh well. +>>>>=20 +>>>> If you put data & xlog on the same array, put them on seperate +>>>> partitions, probably formatted differently (ext2 on xlog). +>>>=20 +>>> If he's doing the same thing on both systems (Sun and HP) and the HP +>>> performance is dramatically worse despite using more disks and +having faster +>>> CPUs and more RAM, ISTM the problem isn't the configuration. +>>>=20 +>>> Add to this the fact that the Sun machine is CPU bound while the HP +is I/O +>>> wait bound and I think the problem is the disk hardware or the +driver +>>> therein. +>>=20 +>> I agree. The problem here looks to be the RAID controller. +>>=20 +>> Steve, got access to a different RAID controller to test with? +>>=20 +>> ---------------------------(end of +broadcast)--------------------------- +>> TIP 1: if posting/reading through Usenet, please send an appropriate +>> subscribe-nomail command to majordomo@postgresql.org so that +your +>> message can get through to the mailing list cleanly +>=20 +>=20 + + + +---------------------------(end of broadcast)--------------------------- +TIP 6: explain analyze is your friend + +From pgsql-performance-owner@postgresql.org Fri Aug 18 14:42:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5CA209FB24C + for ; + Fri, 18 Aug 2006 14:42:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 78737-03-5 + for ; + Fri, 18 Aug 2006 17:40:44 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.205]) + by postgresql.org (Postfix) with ESMTP id 0AE489FB3F5 + for ; + Fri, 18 Aug 2006 14:39:59 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id l1so582437nzf + for ; + Fri, 18 Aug 2006 10:39:54 -0700 (PDT) +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:references; + b=i4yfghqHF7nwABtOrC7kW1qhBCV4f0s1rNgOJl+Sdo1EKTaAyXiG9WlcszHWtLtuCgbY8DoFv1NwNrhg2Fs4KdXNO63Nupz3V41xAbyctU/d4zpT+NKwTwv5nJ8CfnFMaOvf6P+MWQgNVkdLYUzJO1VyZ+nnJjro+/w0osnBqMo= +Received: by 10.64.193.8 with SMTP id q8mr2546130qbf; + Fri, 18 Aug 2006 10:39:53 -0700 (PDT) +Received: by 10.65.163.12 with HTTP; Fri, 18 Aug 2006 10:39:53 -0700 (PDT) +Message-ID: <721b21dc0608181039x28012fednbeba47c5c4511661@mail.gmail.com> +Date: Fri, 18 Aug 2006 10:39:53 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Scott Marlowe" , + "Michael Stone" , + pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_5264_32969301.1155922793577" +References: <1155780633.11188.5.camel@amd64-gentoo-laptop> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/303 +X-Sequence-Number: 20488 + +------=_Part_5264_32969301.1155922793577 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +Nope. it is only a RAID1 for the 2 internal discs connected to the +SmartArray 6i. This is where I *had* the pg_xlog located when the +performance was very poor. Also, I just found out the default stripe size is +128k. Would this be a problem for pg_xlog? + +The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter. + +Steve + +On 8/18/06, Luke Lonergan wrote: +> +> Steve, +> +> If this is an internal RAID1 on two disks, it looks great. +> +> Based on the random seeks though (578 seeks/sec), it looks like maybe it's +> 6 +> disks in a RAID10? +> +> - Luke +> +> +> On 8/16/06 7:10 PM, "Steve Poe" wrote: +> +> > Everyone, +> > +> > I wanted to follow-up on bonnie results for the internal RAID1 which is +> > connected to the SmartArray 6i. I believe this is the problem, but I am +> > not good at interepting the results. Here's an sample of three runs: +> > +> > scsi disc +> > array ,16G,47983,67,65492,20,37214,6,73785,87,89787,6,578.2,0,16,+++++, +> > +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> > scsi disc +> > array ,16G,54634,75,67793,21,36835,6,74190,88,89314,6,579.9,0,16,+++++, +> > +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++ +> > scsi disc +> > array ,16G,55056,76,66108,20,36859,6,74108,87,89559,6,585.0,0,16,+++++, +> > +++,+++++,+++,+++++,+++,+++++,+++,+ +> > +> > This was run on the internal RAID1 on the outer portion of the discs +> > formatted at ext2. +> > +> > Thanks. +> > +> > Steve +> > +> > On Thu, 2006-08-10 at 10:35 -0500, Scott Marlowe wrote: +> >> On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote: +> >>> Mike, +> >>> +> >>> On 8/10/06 4:09 AM, "Michael Stone" wrote: +> >>> +> >>>> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote: +> >>>>> I tried as you suggested and my performance dropped by 50%. I went +> from +> >>>>> a 32 TPS to 16. Oh well. +> >>>> +> >>>> If you put data & xlog on the same array, put them on seperate +> >>>> partitions, probably formatted differently (ext2 on xlog). +> >>> +> >>> If he's doing the same thing on both systems (Sun and HP) and the HP +> >>> performance is dramatically worse despite using more disks and having +> faster +> >>> CPUs and more RAM, ISTM the problem isn't the configuration. +> >>> +> >>> Add to this the fact that the Sun machine is CPU bound while the HP is +> I/O +> >>> wait bound and I think the problem is the disk hardware or the driver +> >>> therein. +> >> +> >> I agree. The problem here looks to be the RAID controller. +> >> +> >> Steve, got access to a different RAID controller to test with? +> >> +> >> ---------------------------(end of +> broadcast)--------------------------- +> >> TIP 1: if posting/reading through Usenet, please send an appropriate +> >> subscribe-nomail command to majordomo@postgresql.org so that +> your +> >> message can get through to the mailing list cleanly +> > +> > +> +> +> + +------=_Part_5264_32969301.1155922793577 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

Nope. it is only a RAID1 for the 2 internal discs connected to the SmartArray 6i. This is where I *had* the pg_xlog located when the performance was very poor. Also, I just found out the default stripe size is 128k. Would this be a problem for pg_xlog? +

The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter.

Steve

On 8/18/06, Luke Lonergan < +llonergan@greenplum.com> wrote:
Steve,

If this is an internal RAID1 on two disks, it looks great. +

Based on the random seeks though (578 seeks/sec), it looks like maybe it's 6
disks in a RAID10?

- Luke


On 8/16/06 7:10 PM, "Steve Poe" <steve.poe@gmail.com +> wrote:

> Everyone,
>
> I wanted to follow-up on bonnie results for the internal RAID1 which is
> connected to the SmartArray 6i. I believe this is the problem, but I am
> not good at interepting the results. Here's an sample of three runs: +
>
> scsi disc
> array ,16G,47983,67,65492,20,37214,6,73785,87,89787,6,578.2,0,16,+++++,
> +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
> scsi disc
> array ,16G,54634,75,67793,21,36835,6,74190,88,89314,6, +579.9,0,16,+++++,
> +++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
> scsi disc
> array ,16G,55056,76,66108,20,36859,6,74108,87,89559,6,585.0,0,16,+++++,
> +++,+++++,+++,+++++,+++,+++++,+++,+ +
>
> This was run on the internal RAID1 on the outer portion of the discs
> formatted at ext2.
>
> Thanks.
>
> Steve
>
> On Thu, 2006-08-10 at 10:35 -0500, Scott Marlowe wrote: +
>> On Thu, 2006-08-10 at 10:15, Luke Lonergan wrote:
>>> Mike,
>>>
>>> On 8/10/06 4:09 AM, "Michael Stone" <mstone+postgres@mathom.us +> wrote:
>>>
>>>> On Wed, Aug 09, 2006 at 08:29:13PM -0700, Steve Poe wrote:
>>>>> I tried as you suggested and my performance dropped by 50%. I went from
>>>>> a 32 TPS to 16. Oh well. +
>>>>
>>>> If you put data & xlog on the same array, put them on seperate
>>>> partitions, probably formatted differently (ext2 on xlog).
>>>
>>> If he's doing the same thing on both systems (Sun and HP) and the HP +
>>> performance is dramatically worse despite using more disks and having faster
>>> CPUs and more RAM, ISTM the problem isn't the configuration.
>>>
>>> Add to this the fact that the Sun machine is CPU bound while the HP is I/O +
>>> wait bound and I think the problem is the disk hardware or the driver
>>> therein.
>>
>> I agree.  The problem here looks to be the RAID controller.
>>
>> Steve, got access to a different RAID controller to test with? +
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 1: if posting/reading through Usenet, please send an appropriate
>>        subscribe-nomail command to +majordomo@postgresql.org so that your
>>        message can get through to the mailing list cleanly
>
>



+ +------=_Part_5264_32969301.1155922793577-- + +From pgsql-performance-owner@postgresql.org Fri Aug 18 15:03:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2BC719FB3EE + for ; + Fri, 18 Aug 2006 15:03:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 41598-02 for + ; + Fri, 18 Aug 2006 14:59:35 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colo-dns-ext2.juniper.net (colo-dns-ext2.juniper.net + [207.17.137.64]) + by postgresql.org (Postfix) with ESMTP id 4531F9FB3E4 + for ; + Fri, 18 Aug 2006 14:59:34 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext2.juniper.net (8.12.3/8.12.3) with ESMTP id + k7IHxW1Z084820; Fri, 18 Aug 2006 10:59:32 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k7IHxVg93147; + Fri, 18 Aug 2006 10:59:32 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k7IHxMj9016690; + Fri, 18 Aug 2006 10:59:22 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k7IHxAtC016683; + Fri, 18 Aug 2006 10:59:10 -0700 +Date: Fri, 18 Aug 2006 10:59:10 -0700 +From: Kenji Morishige +To: Roman Neuhauser +Cc: "Joshua D. Drake" , + pgsql-performance@postgresql.org, + kenjim@juniper.net +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060818175909.GA16222@juniper.net> +References: <20060808204354.GN29379@juniper.net> + <44D906E1.7010405@commandprompt.com> + <20060812162019.GA1340@dagan.sigpipe.cz> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20060812162019.GA1340@dagan.sigpipe.cz> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/304 +X-Sequence-Number: 20489 + +Regarding the DL585 etc boxes from HP, they seem to require external JBOD or +SCSI/SAS enclosures. Does anyone have any particular preference on how these +units should be configured or speced? I'm guessing I'll use the onboard SCSI +RAID 1 with the onboard drives for the OS, but will need 2 external channels +for the data and xlog. Any recommendations there? + +Sincerely, +Kenji + +On Sat, Aug 12, 2006 at 04:20:19PM +0000, Roman Neuhauser wrote: +> # jd@commandprompt.com / 2006-08-08 14:49:21 -0700: +> > >I am considering a setup such as this: +> > > - At least dual cpu (possibly with 2 cores each) +> > > - 4GB of RAM +> > > - 2 disk RAID 1 array for root disk +> > > - 4 disk RAID 1+0 array for PGDATA +> > > - 2 disk RAID 1 array for pg_xlog +> > > +> > >Does anyone know a vendor that might be able provide such setup? +> > +> > I would look at the HP DL 385 or 585. The 385 is going to max a (2) dual +> > core cpus. The 585 is (4) dual core cpus. +> +> I don't know about DL385 or DL585, but DL380 seem to go south within +> 1 year of heavy hitting; precisely the Smart Array RAID controllers +> (4 out of 6 disks suddenly "red"; insert new disks, ooops red as +> well). +> +> I've seen this happen several times, and came away with a conclusion +> that DL380 is sexy, but you don't want to marry it. Then again, +> maybe the DL385 is different, though I seem to remember that both +> G3 (Smart Array 5i) and G4 (6i) did this. +> +> -- +> How many Vietnam vets does it take to screw in a light bulb? +> You don't know, man. You don't KNOW. +> Cause you weren't THERE. http://bash.org/?255991 + +From pgsql-performance-owner@postgresql.org Fri Aug 18 15:14:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 1A9BA9FB3F9 + for ; + Fri, 18 Aug 2006 15:14:40 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 90971-01-2 + for ; + Fri, 18 Aug 2006 18:12:39 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exprod6og52.obsmtp.com (exprod6og52.obsmtp.com [64.18.1.185]) + by postgresql.org (Postfix) with SMTP id 061E89FB3EE + for ; + Fri, 18 Aug 2006 15:09:49 -0300 (ADT) +Received: from source ([63.240.6.44]) by exprod6ob52.postini.com + ([64.18.5.12]) with SMTP; Fri, 18 Aug 2006 11:09:45 PDT +Received: from 172.16.1.148 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D4)); Fri, 18 Aug 2006 14:09:35 -0400 +X-Server-Uuid: C8FB4D43-1108-484A-A898-3CBCC7906230 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 18 Aug + 2006 14:09:29 -0400 +Received: from 63.80.24.130 ([63.80.24.130]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.134]) with Microsoft Exchange Server HTTP-DAV ; Fri, 18 Aug + 2006 18:09:29 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Fri, 18 Aug 2006 11:09:27 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Scott Marlowe" , + "Michael Stone" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: AcbC8XFGr5jF3i7kEduD2wAWy4o9DA== +In-Reply-To: <721b21dc0608181039x28012fednbeba47c5c4511661@mail.gmail.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 18 Aug 2006 18:09:29.0836 (UTC) + FILETIME=[72F762C0:01C6C2F1] +X-WSS-ID: 68F8DDD53FW3250986-03-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.5 tagged_above=0 required=5 tests=RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/305 +X-Sequence-Number: 20490 + +Steve, + +On 8/18/06 10:39 AM, "Steve Poe" wrote: + +> Nope. it is only a RAID1 for the 2 internal discs connected to the SmartArray +> 6i. This is where I *had* the pg_xlog located when the performance was very +> poor. Also, I just found out the default stripe size is 128k. Would this be a +> problem for pg_xlog? + +ISTM that the main performance issue for xlog is going to be the rate at +which fdatasync operations complete, and the stripe size shouldn't hurt +that. + +What are your postgresql.conf settings for the xlog: how many logfiles, +sync_method, etc? + +> The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter. + +Interesting - the seek rate is very good for two drives, are they 15K RPM? + +- Luke + + + +From pgsql-performance-owner@postgresql.org Fri Aug 18 16:06:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AEEDB9FA502 + for ; + Fri, 18 Aug 2006 16:06:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 81806-02-2 + for ; + Fri, 18 Aug 2006 16:03:56 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.195]) + by postgresql.org (Postfix) with ESMTP id DB0BE9FB3EB + for ; + Fri, 18 Aug 2006 16:00:04 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id l1so602923nzf + for ; + Fri, 18 Aug 2006 12:00:02 -0700 (PDT) +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:references; + b=CyaJx1VfVIkcnWYV/sfFIQo6joVvA17I2K8mYhITVd5PuaFJewalUEnISiT74hhyuY1dQzQRH2/n8B4KBzGyhST+/MdbDC87XWkPR1zxRJRP8iuYQCNh+fs14ptNpJPVu7Wvm1MWSYlv9pQO95uMeN5VWBGHwVVt4N8xEYctxqI= +Received: by 10.65.97.18 with SMTP id z18mr4202004qbl; + Fri, 18 Aug 2006 12:00:02 -0700 (PDT) +Received: by 10.65.163.12 with HTTP; Fri, 18 Aug 2006 12:00:02 -0700 (PDT) +Message-ID: <721b21dc0608181200h308912b0mf2ccfb1d97970f03@mail.gmail.com> +Date: Fri, 18 Aug 2006 12:00:02 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Scott Marlowe" , + "Michael Stone" , + pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_5956_21686494.1155927602643" +References: <721b21dc0608181039x28012fednbeba47c5c4511661@mail.gmail.com> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.447 tagged_above=0 required=5 tests=AWL, HTML_40_50, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/306 +X-Sequence-Number: 20491 + +------=_Part_5956_21686494.1155927602643 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +ISTM that the main performance issue for xlog is going to be the rate at +> which fdatasync operations complete, and the stripe size shouldn't hurt +> that. + + +I thought so. However, I've also tried running the PGDATA off of the RAID1 +as a test and it is poor. + + + +What are your postgresql.conf settings for the xlog: how many logfiles, +> sync_method, etc? + + +wal_sync_method = fsync # the default varies across platforms: + # fsync, fdatasync, open_sync, or +open_datasync +# - Checkpoints - + +checkpoint_segments = 14 # in logfile segments, min 1, 16MB each +checkpoint_timeout = 300 # range 30-3600, in seconds +#checkpoint_warning = 30 # 0 is off, in seconds +#commit_delay = 0 # range 0-100000, in microseconds +#commit_siblings = 5 + +What stumps me is I use the same settings on a Sun box (dual Opteron 4GB w/ +LSI MegaRAID 128M) with the same data. This is on pg 7.4.13. + + + +> The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter. +> +> Interesting - the seek rate is very good for two drives, are they 15K RPM? + + +Nope. 10K. RPM. + + +HP's recommendation for testing is to connect the RAID1 to the second +channel off of the SmartArray 642 adapter since they use the same driver, +and, according to HP, I should not have to rebuilt the RAID1. + +I have to send the new server to the hospital next week, so I have very +little testing time left. + +Steve + +------=_Part_5956_21686494.1155927602643 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +

Luke,

ISTM that the main performance issue for xlog is going to be the rate at +
which fdatasync operations complete, and the stripe size shouldn't hurt
that.

I thought so. However, I've also tried running the PGDATA off of the RAID1 as a test and it is poor.

 
+
What are your postgresql.conf settings for the xlog: how many logfiles,
sync_method, etc? +

wal_sync_method = fsync # the default varies across platforms:
                                # fsync, fdatasync, open_sync, or open_datasync
# - Checkpoints -

checkpoint_segments = 14        # in logfile segments, min 1, 16MB each +
checkpoint_timeout = 300        # range 30-3600, in seconds
#checkpoint_warning = 30        # 0 is off, in seconds
#commit_delay = 0               # range 0-100000, in microseconds
#commit_siblings = 5

+What stumps me is I use the same settings on a Sun box (dual Opteron 4GB w/ LSI MegaRAID 128M) with the same data.  This is on pg 7.4.13.

 

+> The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter.

Interesting - the seek rate is very good for two drives, are they 15K RPM?

Nope. 10K. RPM.


HP's recommendation for testing is to connect the RAID1 to the second channel off of the SmartArray 642 adapter since they use the same driver, and, according to HP, I should not have to rebuilt the RAID1. +

I have to send the new server to the hospital next week, so I have very little testing time left.

Steve

 


+ +------=_Part_5956_21686494.1155927602643-- + +From pgsql-performance-owner@postgresql.org Fri Aug 18 16:12:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 337109FB24C + for ; + Fri, 18 Aug 2006 16:12:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 82452-04-5 + for ; + Fri, 18 Aug 2006 16:10:24 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colo-dns-ext1.juniper.net (colo-dns-ext1.juniper.net + [207.17.137.57]) + by postgresql.org (Postfix) with ESMTP id 058D69FB3E3 + for ; + Fri, 18 Aug 2006 16:07:26 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext1.juniper.net (8.11.3/8.9.3) with ESMTP id k7IJ7PX05017; + Fri, 18 Aug 2006 12:07:25 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k7IJ7Kg08372; + Fri, 18 Aug 2006 12:07:20 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k7IJ7F7S019496; + Fri, 18 Aug 2006 12:07:15 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k7IJ7Bh9019493; + Fri, 18 Aug 2006 12:07:11 -0700 +Date: Fri, 18 Aug 2006 12:07:11 -0700 +From: Kenji Morishige +To: Arjen van der Meijden +Cc: pgsql-performance@postgresql.org, kenjim@juniper.net +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060818190711.GC16222@juniper.net> +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44D9741A.9090303@tweakers.net> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.033 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/307 +X-Sequence-Number: 20492 + +Thanks Arjen, +I have unlimited rack space if I really need it. Is serial/SAS really the +better route to go than SCSI these days? I'm so used to ordering SCSI that +I've been out of the loop with new disk enclosures and disk tech. I been +trying to price out a HP DL585, but those are considerably more than the +Dells. Is it worth waiting a few more weeks/months for Dell to release +something newer? + +-Kenji + +On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +> With such a budget you should easily be able to get something like: +> - A 1U high-performance server (for instance the Dell 1950 with 2x +> Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +> controller and some disks internally) +> - An external SAS direct attached disks storage enclosure full with 15k +> rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +> +> Going for the dell-solution would set you back "only" (including +> savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +> a DL380G5/DL385 with two MSA50's for instance) which also fit in your +> budget afaik. The other players tend to be (a bit) more expensive, force +> you to go with Fibre Channel or "ancient" SCSI external storage ;) +> +> If you'd like to have a product by a generic vendor, have a look at the +> Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +> sas/sata bays in 2U) for storage. +> +> If you're limited to only 2U of rack space, its a bit more difficult to +> get maximum I/O in your budget (you have basically space for about 8 or +> 12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +> But you should still be able to have two top-off-the-line x86 cpu's (amd +> opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +> which is pretty expensive). +> +> Best regards, +> +> Arjen van der Meijden +> +> +> On 8-8-2006 22:43, Kenji Morishige wrote: +> >I've asked for some help here a few months ago and got some really helpfull +> >answers regarding RAID controllers and server configuration. Up until +> >recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +> >machine with a single channel RAID controller (previously Adaptec 2200S, +> >but +> >now changed to LSI MegaRAID). The 2U unit is from a generic vendor using +> >what +> >I believe is a SuperMicro motherboard. In the last week after upgrading +> >the +> >RAID controller, the machine has had disk failure and some other issues. I +> >would like to build a very reliable dedicated postgreSQL server that has +> >the +> >ultimate possible performance and reliabily for around $20,000. The data +> >set +> >size is only currently about 4GB, but is increasing by approximately 50MB +> >daily. The server also requires about 500 connections and I have been +> >monitoring about 100-200 queries per second at the moment. I am planning +> >to +> >run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +> >improves performance. +> > +> >I am considering a setup such as this: +> > - At least dual cpu (possibly with 2 cores each) +> > - 4GB of RAM +> > - 2 disk RAID 1 array for root disk +> > - 4 disk RAID 1+0 array for PGDATA +> > - 2 disk RAID 1 array for pg_xlog +> > +> >Does anyone know a vendor that might be able provide such setup? Any +> >critique in this design? I'm thinking having a 2 channel RAID controller to +> >seperate the PGDATA, root and pg_xlog. +> > +> >Sincerely, +> >Kenji +> > +> >---------------------------(end of broadcast)--------------------------- +> >TIP 2: Don't 'kill -9' the postmaster +> > + +From pgsql-performance-owner@postgresql.org Fri Aug 18 16:49:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 614459FB3FA + for ; + Fri, 18 Aug 2006 16:49:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 85787-04 for + ; + Fri, 18 Aug 2006 16:46:53 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from olive.qinip.net (olive.qinip.net [62.100.30.40]) + by postgresql.org (Postfix) with ESMTP id F29A49FB3E0 + for ; + Fri, 18 Aug 2006 16:41:53 -0300 (ADT) +Received: from [127.0.0.1] (h8441139206.dsl.speedlinq.nl [84.41.139.206]) + by olive.qinip.net (Postfix) with ESMTP id 5854E18387; + Fri, 18 Aug 2006 21:41:49 +0200 (MEST) +Message-ID: <44E61803.6070903@tweakers.net> +Date: Fri, 18 Aug 2006 21:41:55 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Kenji Morishige +CC: pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> + <20060818190711.GC16222@juniper.net> +In-Reply-To: <20060818190711.GC16222@juniper.net> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Antivirus: avast! (VPS 0633-4, 18-08-2006), Outbound message +X-Antivirus-Status: Clean +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.157 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/308 +X-Sequence-Number: 20493 + +Hi Kenji, + +I'm not sure what you mean by 'something newer'? The intel +woodcrest-cpu's are brand-new compared to the amd opterons. But if you +need a 4-cpu config (I take it you want 8-cores in that case), Dell +doesn't offer much. Whether something new will come, I don't know. I'm +not sure when (or if?) a MP-Woodcrest will arrive and/or when Dell will +start offering Opteron-servers. + +Sas has been designed as the successor to SCSI. + +As I see it, SAS has currently one major disadvantage. Lots of new +servers are equipped with SAS-drives, a few nice SAS-raidcontrollers +exist, but the availability of external enclosures for SAS is not +widespread yet. So your options of going beyond (say) 8 disks per system +are a bit limited. + +There are of course advantages as well. The bus is much wider (you can +have 4 lanes of 3Gbps each to an enclosure). You can mix sas and sata +disks, so you could have two arrays in the same enclosure, one big +storage bin and a very fast array or just use only sata disks on a sas +controller. The cabling itself is also much simpler/more flexible +(although using a hot-plug enclosure of course shields you mostly from +that). +But whether its the right choice to make now? I'm not sure. We weren't +to fond of investing a lot of money in an end-of-life system. And since +we're a tech-website, we also had to worry about our "being modern +image", of course ;) + +The main disadvantage I see in this case is, as said, the limited +availability of external enclosures in comparison to SCSI and Fibre +Channel. HP currently only offers their MSA50 (for the rather expensive +SFF disks) while their MSA60 (normal disks) will not be available until +somewhere in 2007 and Dell also only offers one enclosure, the MD1000. +The other big players offer nothing yet, as far as I know, while they +normally offer several SCSI and/or FC-enclosures. +There are also some third-party enclosures (adaptec and promise for +instance) available of course. + +Best regards, + +Arjen + +On 18-8-2006 21:07, Kenji Morishige wrote: +> Thanks Arjen, +> I have unlimited rack space if I really need it. Is serial/SAS really the +> better route to go than SCSI these days? I'm so used to ordering SCSI that +> I've been out of the loop with new disk enclosures and disk tech. I been +> trying to price out a HP DL585, but those are considerably more than the +> Dells. Is it worth waiting a few more weeks/months for Dell to release +> something newer? +> +> -Kenji +> +> On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +>> With such a budget you should easily be able to get something like: +>> - A 1U high-performance server (for instance the Dell 1950 with 2x +>> Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +>> controller and some disks internally) +>> - An external SAS direct attached disks storage enclosure full with 15k +>> rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +>> +>> Going for the dell-solution would set you back "only" (including +>> savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +>> a DL380G5/DL385 with two MSA50's for instance) which also fit in your +>> budget afaik. The other players tend to be (a bit) more expensive, force +>> you to go with Fibre Channel or "ancient" SCSI external storage ;) +>> +>> If you'd like to have a product by a generic vendor, have a look at the +>> Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +>> sas/sata bays in 2U) for storage. +>> +>> If you're limited to only 2U of rack space, its a bit more difficult to +>> get maximum I/O in your budget (you have basically space for about 8 or +>> 12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +>> But you should still be able to have two top-off-the-line x86 cpu's (amd +>> opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +>> which is pretty expensive). +>> +>> Best regards, +>> +>> Arjen van der Meijden +>> +>> +>> On 8-8-2006 22:43, Kenji Morishige wrote: +>>> I've asked for some help here a few months ago and got some really helpfull +>>> answers regarding RAID controllers and server configuration. Up until +>>> recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +>>> machine with a single channel RAID controller (previously Adaptec 2200S, +>>> but +>>> now changed to LSI MegaRAID). The 2U unit is from a generic vendor using +>>> what +>>> I believe is a SuperMicro motherboard. In the last week after upgrading +>>> the +>>> RAID controller, the machine has had disk failure and some other issues. I +>>> would like to build a very reliable dedicated postgreSQL server that has +>>> the +>>> ultimate possible performance and reliabily for around $20,000. The data +>>> set +>>> size is only currently about 4GB, but is increasing by approximately 50MB +>>> daily. The server also requires about 500 connections and I have been +>>> monitoring about 100-200 queries per second at the moment. I am planning +>>> to +>>> run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +>>> improves performance. +>>> +>>> I am considering a setup such as this: +>>> - At least dual cpu (possibly with 2 cores each) +>>> - 4GB of RAM +>>> - 2 disk RAID 1 array for root disk +>>> - 4 disk RAID 1+0 array for PGDATA +>>> - 2 disk RAID 1 array for pg_xlog +>>> +>>> Does anyone know a vendor that might be able provide such setup? Any +>>> critique in this design? I'm thinking having a 2 channel RAID controller to +>>> seperate the PGDATA, root and pg_xlog. +>>> +>>> Sincerely, +>>> Kenji +>>> +>>> ---------------------------(end of broadcast)--------------------------- +>>> TIP 2: Don't 'kill -9' the postmaster +>>> +> + +From pgsql-performance-owner@postgresql.org Fri Aug 18 16:55:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C59E69FB3AA + for ; + Fri, 18 Aug 2006 16:55:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 86466-02-5 + for ; + Fri, 18 Aug 2006 16:53:18 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from colo-dns-ext2.juniper.net (colo-dns-ext2.juniper.net + [207.17.137.64]) + by postgresql.org (Postfix) with ESMTP id 5D4F59FB402 + for ; + Fri, 18 Aug 2006 16:51:26 -0300 (ADT) +Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) + by colo-dns-ext2.juniper.net (8.12.3/8.12.3) with ESMTP id + k7IJpP1Z086062; Fri, 18 Aug 2006 12:51:25 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) + by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k7IJpPg15953; + Fri, 18 Aug 2006 12:51:25 -0700 (PDT) + (envelope-from kenjim@juniper.net) +Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) + by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k7IJpOVD021294; + Fri, 18 Aug 2006 12:51:24 -0700 +Received: (from kenjim@localhost) + by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k7IJpOib021293; + Fri, 18 Aug 2006 12:51:24 -0700 +Date: Fri, 18 Aug 2006 12:51:24 -0700 +From: Kenji Morishige +To: Arjen van der Meijden +Cc: pgsql-performance@postgresql.org, kenjim@juniper.net +Subject: Re: most bang for buck with ~ $20,000 +Message-ID: <20060818195124.GA19731@juniper.net> +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> + <20060818190711.GC16222@juniper.net> + <44E61803.6070903@tweakers.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44E61803.6070903@tweakers.net> +User-Agent: Mutt/1.4.2.1i +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.025 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/309 +X-Sequence-Number: 20494 + +Thanks Arjen for your reply, this is definitely something to consider. I +think in our case, we are not too concerned with the tech image as much as if +the machine will allow us to scale the loads we need. I'm not sure if we +should worry so much about the IO bandwidth as we are not even close to +saturating 320MB/s. I think stability, reliability, and ease-of-use and +recovery is our main concern at the moment. I currently am runing a load +average of about .5 on a dual Xeon 3.06Ghz P4 setup. How much CPU +performance improvement do you think the new woodcrest cpus are over these? + +-Kenji + +On Fri, Aug 18, 2006 at 09:41:55PM +0200, Arjen van der Meijden wrote: +> Hi Kenji, +> +> I'm not sure what you mean by 'something newer'? The intel +> woodcrest-cpu's are brand-new compared to the amd opterons. But if you +> need a 4-cpu config (I take it you want 8-cores in that case), Dell +> doesn't offer much. Whether something new will come, I don't know. I'm +> not sure when (or if?) a MP-Woodcrest will arrive and/or when Dell will +> start offering Opteron-servers. +> +> Sas has been designed as the successor to SCSI. +> +> As I see it, SAS has currently one major disadvantage. Lots of new +> servers are equipped with SAS-drives, a few nice SAS-raidcontrollers +> exist, but the availability of external enclosures for SAS is not +> widespread yet. So your options of going beyond (say) 8 disks per system +> are a bit limited. +> +> There are of course advantages as well. The bus is much wider (you can +> have 4 lanes of 3Gbps each to an enclosure). You can mix sas and sata +> disks, so you could have two arrays in the same enclosure, one big +> storage bin and a very fast array or just use only sata disks on a sas +> controller. The cabling itself is also much simpler/more flexible +> (although using a hot-plug enclosure of course shields you mostly from +> that). +> But whether its the right choice to make now? I'm not sure. We weren't +> to fond of investing a lot of money in an end-of-life system. And since +> we're a tech-website, we also had to worry about our "being modern +> image", of course ;) +> +> The main disadvantage I see in this case is, as said, the limited +> availability of external enclosures in comparison to SCSI and Fibre +> Channel. HP currently only offers their MSA50 (for the rather expensive +> SFF disks) while their MSA60 (normal disks) will not be available until +> somewhere in 2007 and Dell also only offers one enclosure, the MD1000. +> The other big players offer nothing yet, as far as I know, while they +> normally offer several SCSI and/or FC-enclosures. +> There are also some third-party enclosures (adaptec and promise for +> instance) available of course. +> +> Best regards, +> +> Arjen +> +> On 18-8-2006 21:07, Kenji Morishige wrote: +> >Thanks Arjen, +> >I have unlimited rack space if I really need it. Is serial/SAS really the +> >better route to go than SCSI these days? I'm so used to ordering SCSI that +> >I've been out of the loop with new disk enclosures and disk tech. I been +> >trying to price out a HP DL585, but those are considerably more than the +> >Dells. Is it worth waiting a few more weeks/months for Dell to release +> >something newer? +> > +> >-Kenji +> > +> >On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +> >>With such a budget you should easily be able to get something like: +> >>- A 1U high-performance server (for instance the Dell 1950 with 2x +> >>Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +> >>controller and some disks internally) +> >>- An external SAS direct attached disks storage enclosure full with 15k +> >>rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +> >> +> >>Going for the dell-solution would set you back "only" (including +> >>savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +> >>a DL380G5/DL385 with two MSA50's for instance) which also fit in your +> >>budget afaik. The other players tend to be (a bit) more expensive, force +> >>you to go with Fibre Channel or "ancient" SCSI external storage ;) +> >> +> >>If you'd like to have a product by a generic vendor, have a look at the +> >>Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +> >>sas/sata bays in 2U) for storage. +> >> +> >>If you're limited to only 2U of rack space, its a bit more difficult to +> >>get maximum I/O in your budget (you have basically space for about 8 or +> >>12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +> >>But you should still be able to have two top-off-the-line x86 cpu's (amd +> >>opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +> >>which is pretty expensive). +> >> +> >>Best regards, +> >> +> >>Arjen van der Meijden +> >> +> >> +> >>On 8-8-2006 22:43, Kenji Morishige wrote: +> >>>I've asked for some help here a few months ago and got some really +> >>>helpfull +> >>>answers regarding RAID controllers and server configuration. Up until +> >>>recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +> >>>machine with a single channel RAID controller (previously Adaptec 2200S, +> >>>but +> >>>now changed to LSI MegaRAID). The 2U unit is from a generic vendor using +> >>>what +> >>>I believe is a SuperMicro motherboard. In the last week after upgrading +> >>>the +> >>>RAID controller, the machine has had disk failure and some other issues. +> >>>I +> >>>would like to build a very reliable dedicated postgreSQL server that has +> >>>the +> >>>ultimate possible performance and reliabily for around $20,000. The +> >>>data set +> >>>size is only currently about 4GB, but is increasing by approximately 50MB +> >>>daily. The server also requires about 500 connections and I have been +> >>>monitoring about 100-200 queries per second at the moment. I am +> >>>planning to +> >>>run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +> >>>improves performance. +> >>> +> >>>I am considering a setup such as this: +> >>> - At least dual cpu (possibly with 2 cores each) +> >>> - 4GB of RAM +> >>> - 2 disk RAID 1 array for root disk +> >>> - 4 disk RAID 1+0 array for PGDATA +> >>> - 2 disk RAID 1 array for pg_xlog +> >>> +> >>>Does anyone know a vendor that might be able provide such setup? Any +> >>>critique in this design? I'm thinking having a 2 channel RAID controller +> >>>to +> >>>seperate the PGDATA, root and pg_xlog. +> >>> +> >>>Sincerely, +> >>>Kenji +> >>> +> >>>---------------------------(end of broadcast)--------------------------- +> >>>TIP 2: Don't 'kill -9' the postmaster +> >>> +> > + +From pgsql-performance-owner@postgresql.org Fri Aug 18 17:20:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6F6E59FB3F0 + for ; + Fri, 18 Aug 2006 17:20:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 89799-01 for + ; + Fri, 18 Aug 2006 17:18:43 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-22.lumeta.com + [65.246.245.22]) + by postgresql.org (Postfix) with ESMTP id 3CBE09FB3AA + for ; + Fri, 18 Aug 2006 17:13:42 -0300 (ADT) +x-mimeole: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: most bang for buck with ~ $20,000 +Date: Fri, 18 Aug 2006 16:13:39 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104A8F@MAIL.corp.lumeta.com> +In-Reply-To: <44E61803.6070903@tweakers.net> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] most bang for buck with ~ $20,000 +Thread-Index: AcbC/5MQjMkO7ICQRuCXKGrEiqaZOwAADp+A +From: "Bucky Jordan" +To: "Arjen van der Meijden" , + "Kenji Morishige" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.017 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/310 +X-Sequence-Number: 20495 + + +We've been doing some research in this area (the new Woodcrest from +Intel, the Opterons from Dell, and SAS). + +In a nutshell, here's what I'm aware of: + +Dell does provide a 15 disk external SAS enclosure- the performance +numbers they claim look pretty good (of course, go figure) and as far as +I can tell, the Perc5/I (the new SAS controller) actually has reasonable +performance. I've been playing around with a 2950 with 6x300 GB 10k RPM +SAS drives, but no enclosure yet. You can also apparently daisy chain up +to 3 enclosures and use multiple perc cards. + +Dell originally was planning to only support 4 socket opteron boxes, but +now they have also apparently decided to support 2 socket ones also. +According to this article, they're saying before end of the year. +http://www.eweek.com/article2/0,1895,2004886,00.asp + +Some say that the Woodcrest performs just as well, if not better than +the opteron, but I have been unable to do specific tests as of yet. If +anyone has a comparable Opteron box (to a PE2950 2x3.0 8 GB RAM +Woodcrest), I'd be happy to run some benchmarks.=20 + +Lastly, Sun just came out with their new X4600. 48 drives, 24 TB +storage, 4 U rack space. http://www.sun.com/servers/x64/x4500/getit.jsp +That's over your $20k limit though, but looks like it'd be a great DB +box. + +For $20k with dell, you could probably get a 2 CPU 2950, with an +external drive cage and 15 SAS drives (just large/med business pricing +on their website). I know I would be very curious about the performance +of this setup if anyone got their hands on it. + +We're a Dell shop, so it looks like we'll be settling in on the 2950 +Woodcrest for a while, but I have managed to get some people interested +in the Sun box and the 4-way opteron from Dell if the need for more +performance should arise. + +HTH, + +Bucky + + + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Arjen van +der Meijden +Sent: Friday, August 18, 2006 3:42 PM +To: Kenji Morishige +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] most bang for buck with ~ $20,000 + +Hi Kenji, + +I'm not sure what you mean by 'something newer'? The intel=20 +woodcrest-cpu's are brand-new compared to the amd opterons. But if you=20 +need a 4-cpu config (I take it you want 8-cores in that case), Dell=20 +doesn't offer much. Whether something new will come, I don't know. I'm=20 +not sure when (or if?) a MP-Woodcrest will arrive and/or when Dell will=20 +start offering Opteron-servers. + +Sas has been designed as the successor to SCSI. + +As I see it, SAS has currently one major disadvantage. Lots of new=20 +servers are equipped with SAS-drives, a few nice SAS-raidcontrollers=20 +exist, but the availability of external enclosures for SAS is not=20 +widespread yet. So your options of going beyond (say) 8 disks per system + +are a bit limited. + +There are of course advantages as well. The bus is much wider (you can=20 +have 4 lanes of 3Gbps each to an enclosure). You can mix sas and sata=20 +disks, so you could have two arrays in the same enclosure, one big=20 +storage bin and a very fast array or just use only sata disks on a sas=20 +controller. The cabling itself is also much simpler/more flexible=20 +(although using a hot-plug enclosure of course shields you mostly from=20 +that). +But whether its the right choice to make now? I'm not sure. We weren't=20 +to fond of investing a lot of money in an end-of-life system. And since=20 +we're a tech-website, we also had to worry about our "being modern=20 +image", of course ;) + +The main disadvantage I see in this case is, as said, the limited=20 +availability of external enclosures in comparison to SCSI and Fibre=20 +Channel. HP currently only offers their MSA50 (for the rather expensive=20 +SFF disks) while their MSA60 (normal disks) will not be available until=20 +somewhere in 2007 and Dell also only offers one enclosure, the MD1000. +The other big players offer nothing yet, as far as I know, while they=20 +normally offer several SCSI and/or FC-enclosures. +There are also some third-party enclosures (adaptec and promise for=20 +instance) available of course. + +Best regards, + +Arjen + +On 18-8-2006 21:07, Kenji Morishige wrote: +> Thanks Arjen,=20 +> I have unlimited rack space if I really need it. Is serial/SAS really +the +> better route to go than SCSI these days? I'm so used to ordering SCSI +that +> I've been out of the loop with new disk enclosures and disk tech. I +been +> trying to price out a HP DL585, but those are considerably more than +the +> Dells. Is it worth waiting a few more weeks/months for Dell to +release +> something newer? +>=20 +> -Kenji +>=20 +> On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +>> With such a budget you should easily be able to get something like: +>> - A 1U high-performance server (for instance the Dell 1950 with 2x=20 +>> Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid=20 +>> controller and some disks internally) +>> - An external SAS direct attached disks storage enclosure full with +15k=20 +>> rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +>> +>> Going for the dell-solution would set you back "only" (including=20 +>> savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 +or=20 +>> a DL380G5/DL385 with two MSA50's for instance) which also fit in your + +>> budget afaik. The other players tend to be (a bit) more expensive, +force=20 +>> you to go with Fibre Channel or "ancient" SCSI external storage ;) +>> +>> If you'd like to have a product by a generic vendor, have a look at +the=20 +>> Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 + +>> sas/sata bays in 2U) for storage. +>> +>> If you're limited to only 2U of rack space, its a bit more difficult +to=20 +>> get maximum I/O in your budget (you have basically space for about 8 +or=20 +>> 12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with +HP)). +>> But you should still be able to have two top-off-the-line x86 cpu's +(amd=20 +>> opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB +Dimm,=20 +>> which is pretty expensive). +>> +>> Best regards, +>> +>> Arjen van der Meijden +>> +>> +>> On 8-8-2006 22:43, Kenji Morishige wrote: +>>> I've asked for some help here a few months ago and got some really +helpfull +>>> answers regarding RAID controllers and server configuration. Up +until +>>> recently I've been running PostgreSQL on a two year old Dual Xeon +3.06Ghz +>>> machine with a single channel RAID controller (previously Adaptec +2200S,=20 +>>> but +>>> now changed to LSI MegaRAID). The 2U unit is from a generic vendor +using=20 +>>> what +>>> I believe is a SuperMicro motherboard. In the last week after +upgrading=20 +>>> the +>>> RAID controller, the machine has had disk failure and some other +issues. I +>>> would like to build a very reliable dedicated postgreSQL server that +has=20 +>>> the +>>> ultimate possible performance and reliabily for around $20,000. The +data=20 +>>> set +>>> size is only currently about 4GB, but is increasing by approximately +50MB +>>> daily. The server also requires about 500 connections and I have +been +>>> monitoring about 100-200 queries per second at the moment. I am +planning=20 +>>> to +>>> run FreeBSD 6.1 if possible, but I am open to any other suggestions +if it +>>> improves performance. +>>> +>>> I am considering a setup such as this: +>>> - At least dual cpu (possibly with 2 cores each) +>>> - 4GB of RAM +>>> - 2 disk RAID 1 array for root disk +>>> - 4 disk RAID 1+0 array for PGDATA +>>> - 2 disk RAID 1 array for pg_xlog +>>> +>>> Does anyone know a vendor that might be able provide such setup? +Any +>>> critique in this design? I'm thinking having a 2 channel RAID +controller to +>>> seperate the PGDATA, root and pg_xlog. +>>> +>>> Sincerely, +>>> Kenji +>>> +>>> ---------------------------(end of +broadcast)--------------------------- +>>> TIP 2: Don't 'kill -9' the postmaster +>>> +>=20 + +---------------------------(end of broadcast)--------------------------- +TIP 5: don't forget to increase your free space map settings + +From pgsql-performance-owner@postgresql.org Fri Aug 18 18:34:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8B9D19FB306 + for ; + Fri, 18 Aug 2006 18:34:40 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 52883-02 for + ; + Fri, 18 Aug 2006 21:34:36 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exprod6og50.obsmtp.com (exprod6og50.obsmtp.com [64.18.1.181]) + by postgresql.org (Postfix) with SMTP id 481459FB214 + for ; + Fri, 18 Aug 2006 18:32:57 -0300 (ADT) +Received: from source ([63.240.6.47]) by exprod6ob50.postini.com + ([64.18.5.12]) with SMTP; Fri, 18 Aug 2006 14:32:54 PDT +Received: from 172.16.1.25 by mail.Mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D1)); Fri, 18 Aug 2006 17:32:47 -0400 +X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 18 Aug + 2006 17:32:47 -0400 +Received: from 63.80.24.130 ([63.80.24.130]) by MI8NYCMAIL06.Mi8.com ( + [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( + [172.16.1.134]) with Microsoft Exchange Server HTTP-DAV ; Fri, 18 Aug + 2006 21:32:46 +0000 +User-Agent: Microsoft-Entourage/11.2.5.060620 +Date: Fri, 18 Aug 2006 14:32:44 -0700 +Subject: Re: Postgresql Performance on an HP DL385 and +From: "Luke Lonergan" +To: "Steve Poe" +cc: "Scott Marlowe" , + "Michael Stone" , + pgsql-performance@postgresql.org +Message-ID: +Thread-Topic: [PERFORM] Postgresql Performance on an HP DL385 and +Thread-Index: AcbDDddBFcSLVi8BEduD2wAWy4o9DA== +In-Reply-To: <721b21dc0608181200h308912b0mf2ccfb1d97970f03@mail.gmail.com> +MIME-Version: 1.0 +X-OriginalArrivalTime: 18 Aug 2006 21:32:47.0300 (UTC) + FILETIME=[D938B040:01C6C30D] +X-WSS-ID: 68F8EE754OS2747562-01-01 +Content-Type: multipart/alternative; + boundary=B_3238756364_1506691 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.997 tagged_above=0 required=5 tests=HTML_40_50, + HTML_MESSAGE, RCVD_NUMERIC_HELO +X-Spam-Level: * +X-Archive-Number: 200608/311 +X-Sequence-Number: 20496 + +> This message is in MIME format. Since your mail reader does not understand +this format, some or all of this message may not be legible. + +--B_3238756364_1506691 +Content-Type: text/plain; + charset=iso-8859-1 +Content-Transfer-Encoding: quoted-printable + +Steve, + +One thing here is that =B3wal_sync_method=B2 should be set to =B3fdatasync=B2 and +not =B3fsync=B2. In fact, the default is fdatasync, but because you have +uncommented the standard line in the file, it is changed to =B3fsync=B2, which +is a lot slower. This is a bug in the file defaults. + +That could speed things up quite a bit on the xlog. + +WRT the difference between the two systems, I=B9m kind of stumped. + +- Luke + + +On 8/18/06 12:00 PM, "Steve Poe" wrote: + +>=20 +> Luke,=20 +>=20 +>> ISTM that the main performance issue for xlog is going to be the rate at +>> which fdatasync operations complete, and the stripe size shouldn't hurt +>> that. +>=20 +> I thought so. However, I've also tried running the PGDATA off of the RAID= +1 as +> a test and it is poor. +>=20 +> =20 +>=20 +>> What are your postgresql.conf settings for the xlog: how many logfiles, +>> sync_method, etc? +>=20 +> wal_sync_method =3D fsync # the default varies across platforms: +> # fsync, fdatasync, open_sync, or +> open_datasync +> # - Checkpoints - +>=20 +> checkpoint_segments =3D 14 # in logfile segments, min 1, 16MB each +> checkpoint_timeout =3D 300 # range 30-3600, in seconds +> #checkpoint_warning =3D 30 # 0 is off, in seconds +> #commit_delay =3D 0 # range 0-100000, in microseconds +> #commit_siblings =3D 5 +>=20 +> What stumps me is I use the same settings on a Sun box (dual Opteron 4GB = +w/ +> LSI MegaRAID 128M) with the same data. This is on pg 7.4.13. +>=20 +> =20 +>=20 +>>> > The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter. +>>=20 +>> Interesting - the seek rate is very good for two drives, are they 15K RP= +M? +>=20 +> Nope. 10K. RPM. =20 +>=20 +>=20 +> HP's recommendation for testing is to connect the RAID1 to the second cha= +nnel +> off of the SmartArray 642 adapter since they use the same driver, and, +> according to HP, I should not have to rebuilt the RAID1. +>=20 +> I have to send the new server to the hospital next week, so I have very l= +ittle +> testing time left. +>=20 +> Steve +>=20 +> =20 +>=20 +>=20 +>=20 + + + +--B_3238756364_1506691 +Content-Type: text/html; + charset=iso-8859-1 +Content-Transfer-Encoding: quoted-printable + + + +Re: [PERFORM] Postgresql Performance on an HP DL385 and + + +Steve= +,
+
+One thing here is that “wal_sync_method” should be set to ̶= +0;fdatasync” and not “fsync”.  In fact, the default i= +s fdatasync, but because you have uncommented the standard line in the file,= + it is changed to “fsync”, which is a lot slower.  This is = +a bug in the file defaults.
+
+That could speed things up quite a bit on the xlog.
+
+WRT the difference between the two systems, I’m kind of stumped.
+
+- Luke
+
+
+On 8/18/06 12:00 PM, "Steve Poe" <steve.poe@gmail.com> wrot= +e:
+
+

+Luke,
+
+
ISTM that the main performance issue for xlog is going = +to be the rate at
+which fdatasync operations complete, and the stripe size shouldn't hurt
+that.
+

+I thought so. However, I've also tried running the PGDATA off of the RAID1 = +as a test and it is poor.
+

+
+
What are your postgresql.conf settings for the xlog: ho= +w many logfiles,
+sync_method, etc?
+

+wal_sync_method =3D fsync # the default varies across platforms:
+            &nb= +sp;            &= +nbsp;      # fsync, fdatasync, open_sync, or o= +pen_datasync
+# - Checkpoints -
+
+checkpoint_segments =3D 14        # in log= +file segments, min 1, 16MB each
+checkpoint_timeout =3D 300        # range = +30-3600, in seconds
+#checkpoint_warning =3D 30        # 0 is o= +ff, in seconds
+#commit_delay =3D 0          &nb= +sp;    # range 0-100000, in microseconds
+#commit_siblings =3D 5
+
+What stumps me is I use the same settings on a Sun box (dual Opteron 4GB w/= + LSI MegaRAID 128M) with the same data.  This is on pg 7.4.13.
+

+
+
> The 6-disc RAID10 you speak of is on the SmartArra= +y 642 RAID adapter.
+
+Interesting - the seek rate is very good for two drives, are they 15K RPM?<= +BR> +

+Nope. 10K. RPM.  
+
+
+HP's recommendation for testing is to connect the RAID1 to the second chann= +el off of the SmartArray 642 adapter since they use the same driver, and, ac= +cording to HP, I should not have to rebuilt the RAID1.
+
+I have to send the new server to the hospital next week, so I have very lit= +tle testing time left.
+
+Steve
+

+
+
+
+

+
+ + + + +--B_3238756364_1506691-- + + +From pgsql-performance-owner@postgresql.org Fri Aug 18 19:22:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A033F9FB3F9 + for ; + Fri, 18 Aug 2006 19:22:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 69665-08 for + ; + Fri, 18 Aug 2006 22:22:28 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from olive.qinip.net (olive.qinip.net [62.100.30.40]) + by postgresql.org (Postfix) with ESMTP id 0C6029F931B + for ; + Fri, 18 Aug 2006 19:22:25 -0300 (ADT) +Received: from [10.0.0.21] (h8441139206.dsl.speedlinq.nl [84.41.139.206]) + by olive.qinip.net (Postfix) with ESMTP id 2D67718165; + Sat, 19 Aug 2006 00:22:24 +0200 (MEST) +Message-ID: <44E63DA3.6050401@tweakers.net> +Date: Sat, 19 Aug 2006 00:22:27 +0200 +From: Arjen van der Meijden +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Kenji Morishige +CC: pgsql-performance@postgresql.org +Subject: Re: most bang for buck with ~ $20,000 +References: <20060808204354.GN29379@juniper.net> + <44D9741A.9090303@tweakers.net> + <20060818190711.GC16222@juniper.net> + <44E61803.6070903@tweakers.net> + <20060818195124.GA19731@juniper.net> +In-Reply-To: <20060818195124.GA19731@juniper.net> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/312 +X-Sequence-Number: 20497 + +Well, that's of course really hard to tell. From personal experience in +a read-mostly environment, the subtop woodcrest 5150 (2.6Ghz) +outperforms the top dempsey 5080 (3.7Ghz, in the same system) by quite a +nice margin. But that dempsey already has the faster FB-Dimm memory and +a much wider FSB compared to your 3.06Ghz Xeons. +But if we assume that the 3.7Ghz 5080 is just the extra mhz faster (~ +25%), for a single (dual core) 3Ghz Woodcrest you might already be +talking about a 50% improvement in terms of cpu-power over your current +set-up. Of course depending on workload and its scalability etc etc. + +In a perfect world, with linear scalability (note, a read-mostly +postgresql can actually do that on a Sun fire T2000 with solaris) that +would yield a 200% improvement when going form 2 to 4 cores. A 70-80% +scaling is more reasonable and would still imply you'd improve more than +150% over your current set-up. +Please note that this is partially based on internal testing and partial +on assumptions and would at least require more real-world testing for a +app more similar to yours. + +As soon as we're publishing some numbers on this (and I don't forget), +I'll let you know on the list. That will include postgresql and recent +x86 cpu's on linux and should be ready soon. + +Best regards, + +Arjen + + +On 18-8-2006 21:51, Kenji Morishige wrote: +> Thanks Arjen for your reply, this is definitely something to consider. I +> think in our case, we are not too concerned with the tech image as much as if +> the machine will allow us to scale the loads we need. I'm not sure if we +> should worry so much about the IO bandwidth as we are not even close to +> saturating 320MB/s. I think stability, reliability, and ease-of-use and +> recovery is our main concern at the moment. I currently am runing a load +> average of about .5 on a dual Xeon 3.06Ghz P4 setup. How much CPU +> performance improvement do you think the new woodcrest cpus are over these? +> +> -Kenji +> +> On Fri, Aug 18, 2006 at 09:41:55PM +0200, Arjen van der Meijden wrote: +>> Hi Kenji, +>> +>> I'm not sure what you mean by 'something newer'? The intel +>> woodcrest-cpu's are brand-new compared to the amd opterons. But if you +>> need a 4-cpu config (I take it you want 8-cores in that case), Dell +>> doesn't offer much. Whether something new will come, I don't know. I'm +>> not sure when (or if?) a MP-Woodcrest will arrive and/or when Dell will +>> start offering Opteron-servers. +>> +>> Sas has been designed as the successor to SCSI. +>> +>> As I see it, SAS has currently one major disadvantage. Lots of new +>> servers are equipped with SAS-drives, a few nice SAS-raidcontrollers +>> exist, but the availability of external enclosures for SAS is not +>> widespread yet. So your options of going beyond (say) 8 disks per system +>> are a bit limited. +>> +>> There are of course advantages as well. The bus is much wider (you can +>> have 4 lanes of 3Gbps each to an enclosure). You can mix sas and sata +>> disks, so you could have two arrays in the same enclosure, one big +>> storage bin and a very fast array or just use only sata disks on a sas +>> controller. The cabling itself is also much simpler/more flexible +>> (although using a hot-plug enclosure of course shields you mostly from +>> that). +>> But whether its the right choice to make now? I'm not sure. We weren't +>> to fond of investing a lot of money in an end-of-life system. And since +>> we're a tech-website, we also had to worry about our "being modern +>> image", of course ;) +>> +>> The main disadvantage I see in this case is, as said, the limited +>> availability of external enclosures in comparison to SCSI and Fibre +>> Channel. HP currently only offers their MSA50 (for the rather expensive +>> SFF disks) while their MSA60 (normal disks) will not be available until +>> somewhere in 2007 and Dell also only offers one enclosure, the MD1000. +>> The other big players offer nothing yet, as far as I know, while they +>> normally offer several SCSI and/or FC-enclosures. +>> There are also some third-party enclosures (adaptec and promise for +>> instance) available of course. +>> +>> Best regards, +>> +>> Arjen +>> +>> On 18-8-2006 21:07, Kenji Morishige wrote: +>>> Thanks Arjen, +>>> I have unlimited rack space if I really need it. Is serial/SAS really the +>>> better route to go than SCSI these days? I'm so used to ordering SCSI that +>>> I've been out of the loop with new disk enclosures and disk tech. I been +>>> trying to price out a HP DL585, but those are considerably more than the +>>> Dells. Is it worth waiting a few more weeks/months for Dell to release +>>> something newer? +>>> +>>> -Kenji +>>> +>>> On Wed, Aug 09, 2006 at 07:35:22AM +0200, Arjen van der Meijden wrote: +>>>> With such a budget you should easily be able to get something like: +>>>> - A 1U high-performance server (for instance the Dell 1950 with 2x +>>>> Woodcrest 5160, 16GB of FB-Dimm memory, one 5i and one 5e perc raid +>>>> controller and some disks internally) +>>>> - An external SAS direct attached disks storage enclosure full with 15k +>>>> rpm 36GB disks (for instance the MD1000, with 15x 36GB 15k disks) +>>>> +>>>> Going for the dell-solution would set you back "only" (including +>>>> savings) about $13-$14k. HP offers a similar solutions (a HP DL360G5 or +>>>> a DL380G5/DL385 with two MSA50's for instance) which also fit in your +>>>> budget afaik. The other players tend to be (a bit) more expensive, force +>>>> you to go with Fibre Channel or "ancient" SCSI external storage ;) +>>>> +>>>> If you'd like to have a product by a generic vendor, have a look at the +>>>> Adaptec JS50 SAS Jbod enclosure or Promise's Vtrak 300 (both offer 12 +>>>> sas/sata bays in 2U) for storage. +>>>> +>>>> If you're limited to only 2U of rack space, its a bit more difficult to +>>>> get maximum I/O in your budget (you have basically space for about 8 or +>>>> 12 3.5" disks (with generic suppliers) or 16 2.5" sff disks (with HP)). +>>>> But you should still be able to have two top-off-the-line x86 cpu's (amd +>>>> opteron 285 or intel woorcrest 5160) and 16GB of memory (even FB Dimm, +>>>> which is pretty expensive). +>>>> +>>>> Best regards, +>>>> +>>>> Arjen van der Meijden +>>>> +>>>> +>>>> On 8-8-2006 22:43, Kenji Morishige wrote: +>>>>> I've asked for some help here a few months ago and got some really +>>>>> helpfull +>>>>> answers regarding RAID controllers and server configuration. Up until +>>>>> recently I've been running PostgreSQL on a two year old Dual Xeon 3.06Ghz +>>>>> machine with a single channel RAID controller (previously Adaptec 2200S, +>>>>> but +>>>>> now changed to LSI MegaRAID). The 2U unit is from a generic vendor using +>>>>> what +>>>>> I believe is a SuperMicro motherboard. In the last week after upgrading +>>>>> the +>>>>> RAID controller, the machine has had disk failure and some other issues. +>>>>> I +>>>>> would like to build a very reliable dedicated postgreSQL server that has +>>>>> the +>>>>> ultimate possible performance and reliabily for around $20,000. The +>>>>> data set +>>>>> size is only currently about 4GB, but is increasing by approximately 50MB +>>>>> daily. The server also requires about 500 connections and I have been +>>>>> monitoring about 100-200 queries per second at the moment. I am +>>>>> planning to +>>>>> run FreeBSD 6.1 if possible, but I am open to any other suggestions if it +>>>>> improves performance. +>>>>> +>>>>> I am considering a setup such as this: +>>>>> - At least dual cpu (possibly with 2 cores each) +>>>>> - 4GB of RAM +>>>>> - 2 disk RAID 1 array for root disk +>>>>> - 4 disk RAID 1+0 array for PGDATA +>>>>> - 2 disk RAID 1 array for pg_xlog +>>>>> +>>>>> Does anyone know a vendor that might be able provide such setup? Any +>>>>> critique in this design? I'm thinking having a 2 channel RAID controller +>>>>> to +>>>>> seperate the PGDATA, root and pg_xlog. +>>>>> +>>>>> Sincerely, +>>>>> Kenji +>>>>> +>>>>> ---------------------------(end of broadcast)--------------------------- +>>>>> TIP 2: Don't 'kill -9' the postmaster +>>>>> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + +From pgsql-performance-owner@postgresql.org Fri Aug 18 19:23:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D6E899F931B + for ; + Fri, 18 Aug 2006 19:23:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 70335-02-3 + for ; + Fri, 18 Aug 2006 22:23:28 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.181]) + by postgresql.org (Postfix) with ESMTP id 499B39FB3FA + for ; + Fri, 18 Aug 2006 19:23:14 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so1443755pyd + for ; + Fri, 18 Aug 2006 15:23:12 -0700 (PDT) +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:references; + b=VL0n5llsfv5Hk4nEA+hxw1m4OGGPUV5iU8xPdlGtUqJKWq76WzzWizDlCVpJ75Yt88DnusZinLds8MhSyW9MMHAoETQyDmdJ8h3beT6G+mCDy5RbpFILhJLDs1snkLEKmx14eT85QE3P49scRYB6HEJAC2mk/fkHDAIlw7NeA7k= +Received: by 10.65.59.20 with SMTP id m20mr4293492qbk; + Fri, 18 Aug 2006 15:23:12 -0700 (PDT) +Received: by 10.65.163.12 with HTTP; Fri, 18 Aug 2006 15:23:11 -0700 (PDT) +Message-ID: <721b21dc0608181523o72942b30k933bd98125b3d04a@mail.gmail.com> +Date: Fri, 18 Aug 2006 15:23:11 -0700 +From: "Steve Poe" +To: "Luke Lonergan" +Subject: Re: Postgresql Performance on an HP DL385 and +Cc: "Scott Marlowe" , + "Michael Stone" , + pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_7476_3551897.1155939791994" +References: <721b21dc0608181200h308912b0mf2ccfb1d97970f03@mail.gmail.com> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.696 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/313 +X-Sequence-Number: 20498 + +------=_Part_7476_3551897.1155939791994 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke, + +I'll try it, but you're right, it should not matter. The two systems are: + +HP DL385 (dual Opteron 265 I believe) 8GB of RAM, two internal RAID1 U320 +10K + +Sun W2100z (dual Opteron 245 I believe) 4GB of RAM, 1 U320 10K drive with +LSI MegaRAID 2X 128M driving two external 4-disc arrays U320 10K drives in a +RAID10 configuration. Running same version of LInux (Centos 4.3 ) and same +kernel version. No changes within the kernel for each of them. Running the +same *.conf files for Postgresql 7.4.13. + +Steve + +On 8/18/06, Luke Lonergan wrote: +> +> Steve, +> +> One thing here is that "wal_sync_method" should be set to "fdatasync" and +> not "fsync". In fact, the default is fdatasync, but because you have +> uncommented the standard line in the file, it is changed to "fsync", which +> is a lot slower. This is a bug in the file defaults. +> +> That could speed things up quite a bit on the xlog. +> +> WRT the difference between the two systems, I'm kind of stumped. +> +> - Luke +> +> +> On 8/18/06 12:00 PM, "Steve Poe" wrote: +> +> +> Luke, +> +> ISTM that the main performance issue for xlog is going to be the rate at +> which fdatasync operations complete, and the stripe size shouldn't hurt +> that. +> +> +> I thought so. However, I've also tried running the PGDATA off of the RAID1 +> as a test and it is poor. +> +> +> +> What are your postgresql.conf settings for the xlog: how many logfiles, +> sync_method, etc? +> +> +> wal_sync_method = fsync # the default varies across platforms: +> # fsync, fdatasync, open_sync, or +> open_datasync +> # - Checkpoints - +> +> checkpoint_segments = 14 # in logfile segments, min 1, 16MB each +> checkpoint_timeout = 300 # range 30-3600, in seconds +> #checkpoint_warning = 30 # 0 is off, in seconds +> #commit_delay = 0 # range 0-100000, in microseconds +> #commit_siblings = 5 +> +> What stumps me is I use the same settings on a Sun box (dual Opteron 4GB +> w/ LSI MegaRAID 128M) with the same data. This is on pg 7.4.13. +> +> +> +> > The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter. +> +> Interesting - the seek rate is very good for two drives, are they 15K RPM? +> +> +> Nope. 10K. RPM. +> +> +> HP's recommendation for testing is to connect the RAID1 to the second +> channel off of the SmartArray 642 adapter since they use the same driver, +> and, according to HP, I should not have to rebuilt the RAID1. +> +> I have to send the new server to the hospital next week, so I have very +> little testing time left. +> +> Steve +> +> +> +> +> +> +> + +------=_Part_7476_3551897.1155939791994 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Luke,

I'll try it, but you're right, it should not matter. The two systems are:

HP DL385 (dual Opteron 265 I believe) 8GB of RAM, two internal RAID1 U320 10K

Sun W2100z (dual Opteron 245 I believe) 4GB of RAM, 1 U320 10K drive with LSI MegaRAID 2X 128M driving two external 4-disc arrays U320 10K drives in a RAID10 configuration. Running same version of LInux (Centos +4.3 ) and same kernel version. No changes within the kernel for each of them. Running the same *.conf files for Postgresql 7.4.13.

Steve

On 8/18/06, +Luke Lonergan <llonergan@greenplum.com> wrote:
+
+ + + +
+Steve,
+
+One thing here is that "wal_sync_method" should be set to "fdatasync" and not "fsync".  In fact, the default is fdatasync, but because you have uncommented the standard line in the file, it is changed to "fsync", which is a lot slower.  This is a bug in the file defaults. +
+
+That could speed things up quite a bit on the xlog.
+
+WRT the difference between the two systems, I'm kind of stumped.
+
+- Luke
+
+
+On 8/18/06 12:00 PM, "Steve Poe" <steve.poe@gmail.com> wrote:
+
+

+Luke,
+
+
ISTM that the main performance issue for xlog is going to be the rate at
+which fdatasync operations complete, and the stripe size shouldn't hurt
+that.
+

+I thought so. However, I've also tried running the PGDATA off of the RAID1 as a test and it is poor.
+

+
+
What are your postgresql.conf settings for the xlog: how many logfiles,
+sync_method, etc?
+

+wal_sync_method = fsync # the default varies across platforms:
+                                # fsync, fdatasync, open_sync, or open_datasync
+# - Checkpoints -
+
+checkpoint_segments = 14        # in logfile segments, min 1, 16MB each
+checkpoint_timeout = 300        # range 30-3600, in seconds
+#checkpoint_warning = 30        # 0 is off, in seconds
+#commit_delay = 0               # range 0-100000, in microseconds
+#commit_siblings = 5
+
+What stumps me is I use the same settings on a Sun box (dual Opteron 4GB w/ LSI MegaRAID 128M) with the same data.  This is on pg 7.4.13.
+

+
+
> The 6-disc RAID10 you speak of is on the SmartArray 642 RAID adapter.
+
+Interesting - the seek rate is very good for two drives, are they 15K RPM?
+

+Nope. 10K. RPM.  
+
+
+HP's recommendation for testing is to connect the RAID1 to the second channel off of the SmartArray 642 adapter since they use the same driver, and, according to HP, I should not have to rebuilt the RAID1.
+
+I have to send the new server to the hospital next week, so I have very little testing time left.
+
+Steve
+

+
+
+
+

+
+
+ + + +

+ +------=_Part_7476_3551897.1155939791994-- + +From pgsql-performance-owner@postgresql.org Mon Aug 21 14:52:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1E10B9FB2FD + for ; + Mon, 21 Aug 2006 14:52:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 49241-04 for + ; + Mon, 21 Aug 2006 14:52:35 -0300 (ADT) +X-Greylist: delayed 00:17:00.945876 by SQLgrey- +Received: from mail.intrusic.com (mail.intrusic.com [63.251.138.101]) + by postgresql.org (Postfix) with ESMTP id 0952F9FB3EF + for ; + Mon, 21 Aug 2006 14:52:35 -0300 (ADT) +Received: from cha1-mail1.intrusic.com (unknown [65.223.207.194]) + by mail.intrusic.com (Postfix) with ESMTP id E9032F9F + for ; + Mon, 21 Aug 2006 13:13:34 -0500 (EST) +Received: from [127.0.0.1] (unknown [192.168.100.126]) + by cha1-mail1.intrusic.com (Postfix) with ESMTP id 1B3DCC5666 + for ; + Mon, 21 Aug 2006 09:30:17 -0400 (EDT) +Message-ID: <44E9EEF9.7050901@intrusic.com> +Date: Mon, 21 Aug 2006 13:35:53 -0400 +From: Scott Matseas +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Index usage +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/314 +X-Sequence-Number: 20499 + +We're having a problem with one of our queries being slow. It appears to be due +to the index being used to go from tableA to tableB. + +Here are the tables: +CREATE TABLE tableA +( + table_idA int8 NOT NULL DEFAULT nextval('tableA_id_seq'::regclass), + CONSTRAINT table_idA_pk PRIMARY KEY (table_idA), +) +WITHOUT OIDS; + +CREATE TABLE tableB +( + table_idB int8 NOT NULL DEFAULT nextval('tableB_id_seq'::regclass), + table_idA int8 NOT NULL, + direction char NOT NULL, + CONSTRAINT tableB_pk PRIMARY KEY (table_idB), + CONSTRAINT tableB_unq UNIQUE (table_idA, direction), +) +WITHOUT OIDS; + +CREATE TABLE last_summarized +( + summary_name varchar(64) NOT NULL, + summarized_id int8, + max_session_id int8, + CONSTRAINT last_summarized_pk PRIMARY KEY (summary_name) +) +WITHOUT OIDS; + +Here is the query: +explain + SELECT * FROM + last_summarized ls + JOIN tableA s ON s.table_idA > ls.summarized_id AND s.table_idA + <= ls.max_session_id + LEFT JOIN tableB sf ON s.table_idA = sf.table_idA AND sf.direction = 'a'::"char" + LEFT JOIN tableB sfb ON s.table_idA = sfb.table_idA AND sfb.direction = 'b'::"char" + WHERE ls.summary_name::text = 'summary'::text + +Size of tables in # of rows +tableA: 9,244,816 +tableB: 15,398,497 +last_summarized: 1 + + +Explain of the above query: +"Hash Left Join (cost=1811349.31..18546527.89 rows=1029087 width=294)" +" Hash Cond: ("outer".table_idA = "inner".table_idA)" +" -> Hash Left Join (cost=915760.88..7519203.61 rows=1029087 width=219)" +" Hash Cond: ("outer".table_idA = "inner".table_idA)" +" -> Nested Loop (cost=0.00..126328.57 rows=1029087 width=144)" +" -> Index Scan using last_summarized_pk on last_summarized ls (cost=0.00..5.98 rows=1 width=82)" +" Index Cond: ((summary_name)::text = 'summary'::text)" +" -> Index Scan using table_idA_pk on tableA s (cost=0.00..110886.29 rows=1029087 width=62)" +" Index Cond: ((s.table_idA > "outer".summarized_id) AND (s.table_idA <= "outer".max_session_id))" +" -> Hash (cost=784763.16..784763.16 rows=8100289 width=75)" +" -> Bitmap Heap Scan on tableB sf (cost=216418.55..784763.16 rows=8100289 width=75)" +" Recheck Cond: (direction = 'a'::"char")" +" -> Bitmap Index Scan on tableB_unq (cost=0.00..216418.55 rows=8100289 width=0)" +" Index Cond: (direction = 'a'::"char")" <------ USING part of Index +" -> Hash (cost=775968.61..775968.61 rows=7396725 width=75)" +" -> Bitmap Heap Scan on tableB sfb (cost=216418.55..775968.61 rows=7396725 width=75)" +" Recheck Cond: (direction = 'b'::"char")" +" -> Bitmap Index Scan on tableB_unq (cost=0.00..216418.55 rows=7396725 width=0)" +" Index Cond: (direction = 'b'::"char")" <------ USING part of Index + + From the above explain see inline comment("<------ USING part of Index"). The table_idA column +looks like it is being ignored in the index Cond. If I enable sequential scan the Index Cond in +question gets replaced with a Seq scan. + +Also if I disable enable_bitmapscan sometimes both columns of the index(tableB_unq) will be +used. + +Does anyone know why we're experiencing this behavior? + + + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 15:29:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8C5639FB40C + for ; + Mon, 21 Aug 2006 15:29:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 52999-03-3 + for ; + Mon, 21 Aug 2006 15:29:02 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id CC8859FB422 + for ; + Mon, 21 Aug 2006 15:26:21 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7LIQJvG005600; + Mon, 21 Aug 2006 14:26:19 -0400 (EDT) +To: Scott Matseas +cc: pgsql-performance@postgresql.org +Subject: Re: Index usage +In-reply-to: <44E9EEF9.7050901@intrusic.com> +References: <44E9EEF9.7050901@intrusic.com> +Comments: In-reply-to Scott Matseas + message dated "Mon, 21 Aug 2006 13:35:53 -0400" +Date: Mon, 21 Aug 2006 14:26:19 -0400 +Message-ID: <5599.1156184779@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.163 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/315 +X-Sequence-Number: 20500 + +Scott Matseas writes: +> If I enable sequential scan the Index Cond in +> question gets replaced with a Seq scan. + +What other planner parameters have you been fooling with? + +With no data in the tables, I get a reasonably sane-looking plan, +so I'm thinking you've chosen bad values for something or other +(starting with enable_seqscan = off ;-)) + +explain + SELECT * FROM + last_summarized ls + JOIN tableA s ON s.table_idA > ls.summarized_id AND s.table_idA + <= ls.max_session_id + LEFT JOIN tableB sf ON s.table_idA = sf.table_idA AND sf.direction = 'a'::char + LEFT JOIN tableB sfb ON s.table_idA = sfb.table_idA AND sfb.direction = 'b'::char + WHERE ls.summary_name::text = 'summary'::text ; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- + Nested Loop Left Join (cost=6.16..54.51 rows=216 width=116) + -> Nested Loop Left Join (cost=6.16..42.05 rows=216 width=95) + -> Nested Loop (cost=6.16..29.58 rows=216 width=74) + -> Index Scan using last_summarized_pk on last_summarized ls (cost=0.00..8.02 rows=1 width=66) + Index Cond: ((summary_name)::text = 'summary'::text) + -> Bitmap Heap Scan on tablea s (cost=6.16..18.32 rows=216 width=8) + Recheck Cond: ((s.table_ida > ls.summarized_id) AND (s.table_ida <= ls.max_session_id)) + -> Bitmap Index Scan on table_ida_pk (cost=0.00..6.16 rows=216 width=0) + Index Cond: ((s.table_ida > ls.summarized_id) AND (s.table_ida <= ls.max_session_id)) + -> Index Scan using tableb_unq on tableb sfb (cost=0.00..0.05 rows=1 width=21) + Index Cond: ((s.table_ida = sfb.table_ida) AND (sfb.direction = 'b'::bpchar)) + -> Index Scan using tableb_unq on tableb sf (cost=0.00..0.05 rows=1 width=21) + Index Cond: ((s.table_ida = sf.table_ida) AND (sf.direction = 'a'::bpchar)) +(13 rows) + + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Aug 21 16:14:03 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 844F19FB2DB + for ; + Mon, 21 Aug 2006 16:14:02 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 32359-04-5 + for ; + Mon, 21 Aug 2006 19:13:53 +0000 (UTC) +X-Greylist: delayed 00:23:04.944144 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 7CBCB9FB33F + for ; + Mon, 21 Aug 2006 16:13:10 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from main.xsigo.com (nat0.xsigo.com [216.184.48.10]) + by svr4.postgresql.org (Postfix) with SMTP id 3056E5AF02A + for ; + Mon, 21 Aug 2006 18:50:04 +0000 (GMT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_001_01C6C552.9C196878" +Subject: Vacuum not identifying rows for removal.. +Date: Mon, 21 Aug 2006 11:50:02 -0700 +Message-ID: <9146E3EBBFBCC94D95F95A1C4065348A837AB1@exch01.xsigo.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Vacuum not identifying rows for removal.. +Thread-Index: AcbFUpw5Zlr9a5NCQ4+SP0/jxxYrnQ== +From: "Eamonn Kent" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/316 +X-Sequence-Number: 20501 + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01C6C552.9C196878 +Content-Type: text/plain; + charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable + +Hi, + +=20 + +I am using PostgreSQL 8.1.4 for an embedded application. For some +reason, vacuum is not able to identify rows that are candidates for +removal (i.e., mark space as available). + +=20 + +Background Info: + +=20 + +I observed some performance problems - our database seemed to be using +an unusually high amount of cpu. Further investigation of the problem +revealed a very bloated database; the database was around 300M when it +should have been about 150M. A number of the database files were quite +large, however, the tables that they stored information for were very +small. For example, we had one table that had only 46 rows, but was +using up more than 17M of disk space. We had a number of other tables +that were similarly large.=20 + +=20 + +We run auto vacuum and I can see from the logs that it is running quite +frequently. When I run vacuum full from the psql, I can see that space +is not being recovered. I have run vacuum full with the verbose flag +set, I can see that messages that indicate the existence of "dead row +versions that cannot be removed yet. =20 + +=20 + +<--- CUT FROM VACUUM OUTPUT ---> + +CPU 0.00s/0.00u sec elapsed 0.18 sec. + +INFO: "ibportreceivestatsca": found 0 removable, 88017 nonremovable row +versions in 4001 pages + +DETAIL: 87957 dead row versions cannot be removed yet. + +There were 1 unused item pointers. + +<--- CUT FROM VACUUM OUTPUT ---> + +=20 + +If I shutdown our application and run a vacuum full, the space is +recovered and the database size goes down to 150M. =20 + +=20 + +So, my best guess is that something in our application is preventing +vacuum from removing dead rows. What could cause this? Would it be +caused by a long-living transaction? What is the best way to track the +problem down...right now, I am looking through pg_stat_activity and +pg_locks to find processes that are "in transaction" and what locks they +are holding. + +=20 + +Has anyone had a similar problem? If so, how did you resolve it? + +=20 + +Thanks + +=20 + +Ike + +=20 + +=20 + +=20 + +=20 + +=20 + +=20 + + +------_=_NextPart_001_01C6C552.9C196878 +Content-Type: text/html; + charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable + + + + + + + + + + + + +
+ +

Hi,

+ +

 

+ +

I am using PostgreSQL 8.1.4 for an embedded +application.  For some reason, vacuum is not able to identify rows = +that +are candidates for removal (i.e., mark space as = +available).

+ +

 

+ +

Background Info:

+ +

 

+ +

I observed some performance problems – our = +database +seemed to be using an unusually high amount of cpu.  Further = +investigation +of the problem revealed a very bloated database; the database was around = +300M +when it should have been about 150M.  A number of the database = +files were +quite large, however, the tables that they stored information for were = +very +small.  For example, we had one table that had only 46 rows, but = +was using +up more than 17M of disk space.  We had a number of other tables = +that were +similarly large.

+ +

 

+ +

We run auto vacuum and I can see from the logs that = +it is +running quite frequently. When I run vacuum full from the psql, I can = +see that +space is not being recovered.  I have run vacuum full with the = +verbose +flag set, I can see that messages that indicate the existence of = +“dead +row versions that cannot be removed yet.  = +

+ +

 

+ +

<--- CUT FROM VACUUM OUTPUT = +--->

+ +

CPU 0.00s/0.00u sec elapsed 0.18 = +sec.

+ +

INFO:  +"ibportreceivestatsca": found 0 removable, 88017 nonremovable = +row +versions in 4001 pages

+ +

DETAIL:  87957 dead row = +versions +cannot be removed yet.

+ +

There were 1 unused item = +pointers.

+ +

<--- CUT FROM VACUUM OUTPUT = +--->

+ +

 

+ +

If I shutdown our application and run a vacuum full, = +the +space is recovered and the database size goes down to 150M.  = +

+ +

 

+ +

So, my best guess is that something in our = +application is +preventing vacuum from removing dead rows.  What could cause = +this?  +Would it be caused by a long-living transaction?  What is the best = +way to +track the problem down...right now, I am looking through = +pg_stat_activity and +pg_locks to find processes that are “in transaction” and = +what locks +they are holding.

+ +

 

+ +

Has anyone had a similar problem?  If so, how = +did you +resolve it?

+ +

 

+ +

Thanks

+ +

 

+ +

Ike

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +
+ + + + + +------_=_NextPart_001_01C6C552.9C196878-- + +From pgsql-performance-owner@postgresql.org Mon Aug 21 16:25:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3A0FF9FB3F7 + for ; + Mon, 21 Aug 2006 16:25:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 37855-07 for + ; + Mon, 21 Aug 2006 19:25:24 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.libertyrms.com (vgateway.libertyrms.info [207.219.45.62]) + by postgresql.org (Postfix) with ESMTP id 651689FB3C4 + for ; + Mon, 21 Aug 2006 16:25:06 -0300 (ADT) +Received: from dba5.int.libertyrms.com ([10.1.3.44]) + by mail.libertyrms.com with esmtp (Exim 4.22) + id 1GFFOT-0001n0-3s; Mon, 21 Aug 2006 15:25:05 -0400 +Subject: Re: Vacuum not identifying rows for removal.. +From: Brad Nicholson +To: Eamonn Kent +Cc: pgsql-performance@postgresql.org +In-Reply-To: <9146E3EBBFBCC94D95F95A1C4065348A837AB1@exch01.xsigo.com> +References: <9146E3EBBFBCC94D95F95A1C4065348A837AB1@exch01.xsigo.com> +Content-Type: text/plain; charset=iso-8859-13 +Date: Mon, 21 Aug 2006 15:25:04 -0400 +Message-Id: <1156188304.8772.6.camel@dba5.int.libertyrms.com> +Mime-Version: 1.0 +X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5) +Content-Transfer-Encoding: quoted-printable +X-SA-Exim-Mail-From: bnichols@ca.afilias.info +X-SA-Exim-Scanned: No; SAEximRunCond expanded to false +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/317 +X-Sequence-Number: 20502 + +On Mon, 2006-08-21 at 11:50 -0700, Eamonn Kent wrote: + +> So, my best guess is that something in our application is preventing +> vacuum from removing dead rows. What could cause this? Would it be +> caused by a long-living transaction? What is the best way to track +> the problem down...right now, I am looking through pg_stat_activity +> and pg_locks to find processes that are =B4in transaction=A1 and what +> locks they are holding. + +If you have any long running transactions - idle or active, that's your +problem. Vacuum can only clear out dead tuples older than that oldest +transaction. Deal with those. Make sure every single transaction your +app initiates commits or rolls back every single time. =20 + +You'll generally find them in pg_stat_activity, but not always. ps may +show you idle transactions not showing as idle in pg_stat_activity +=20 +--=20 +Brad Nicholson 416-673-4106 +Database Administrator, Afilias Canada Corp. + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 17:25:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3C8909FB334 + for ; + Mon, 21 Aug 2006 17:25:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 53749-06 for + ; + Mon, 21 Aug 2006 20:24:55 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.intrusic.com (mail.intrusic.com [63.251.138.101]) + by postgresql.org (Postfix) with ESMTP id CE36C9FB307 + for ; + Mon, 21 Aug 2006 17:24:52 -0300 (ADT) +Received: from cha1-mail1.intrusic.com (unknown [65.223.207.194]) + by mail.intrusic.com (Postfix) with ESMTP + id 33644FB3; Mon, 21 Aug 2006 16:02:52 -0500 (EST) +Received: from [127.0.0.1] (unknown [192.168.100.126]) + by cha1-mail1.intrusic.com (Postfix) with ESMTP + id 46D1DC5666; Mon, 21 Aug 2006 12:19:35 -0400 (EDT) +Message-ID: <44EA16A6.6080607@intrusic.com> +Date: Mon, 21 Aug 2006 16:25:10 -0400 +From: Scott Matseas +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Tom Lane +Cc: pgsql-performance@postgresql.org +Subject: Re: Index usage +References: <44E9EEF9.7050901@intrusic.com> <5599.1156184779@sss.pgh.pa.us> +In-Reply-To: <5599.1156184779@sss.pgh.pa.us> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/318 +X-Sequence-Number: 20503 + +Tom Lane wrote: +> What other planner parameters have you been fooling with? +Hi Tom, +The other parameters that have been changed are: +set join_collapse_limit to 1 +set enable_sort to off + +We are using version 8.1.3. We've noticed the query plan changing depending +on the amount of data in the tables especially when the query looks at +more rows +in tableA. The parameter work_mem is set to 262,144. + +Thanks, +Scott + + + + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 18:09:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6AC5C9FB2A9 + for ; + Mon, 21 Aug 2006 18:09:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 76353-02 for + ; + Mon, 21 Aug 2006 18:09:45 -0300 (ADT) +X-Greylist: delayed 00:26:29.710138 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 45B809FB2B5 + for ; + Mon, 21 Aug 2006 18:09:45 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by svr4.postgresql.org (Postfix) with ESMTP id 35C905AF03F + for ; + Mon, 21 Aug 2006 20:43:14 +0000 (GMT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: How to get higher tps +Date: Mon, 21 Aug 2006 16:45:11 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E3074@SITE3MAIL04.jeeves.ask.info> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: How to get higher tps +Thread-Index: + Aca8IZ89nVtsgavYRYOVEp/7fobzgAAhCuugASfOG6AAAIWVgAAAtlNwAATfnoAAAGanMAAELkHQAAAczu4AAB130AAAI7WwAADwgeAAAJdJ8AABYMEwAACb+KAAABqAYAAAFKeAAAAWeaAAAAU8kAAAhncgAATTEGAAGsxMQAAAWSeAAAUAiWAABXHhMAAARxmwACklM4AAAlziEAABLCkgAAFN78AAABlKgAABTXTgAAASntAAAAnFIAAGwfcQAABp0nAAADmhYAAAb8QgAADfDuAAADogUAAAvMkwAIZ6BHAAAUm6cAAA4xHwAAASRTAABU6QcAAAh8BgAAGC3dAAAEddcAABMKGwAAAkEbAAAFkvoAAASo1QAADKfJA= +From: "Marty Jia" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.142 tagged_above=0 required=5 tests=SPF_FAIL +X-Spam-Level: * +X-Archive-Number: 200608/320 +X-Sequence-Number: 20505 + +I'm exhausted to try all performance tuning ideas, like following +parameters + +shared_buffers=20 +fsync=20 +max_fsm_pages +max_connections=20 +shared_buffers =20 +work_mem=20 +max_fsm_pages +effective_cache_size=20 +random_page_cost=20 + +I believe all above have right size and values, but I just can not get +higher tps more than 300 testd by pgbench + +Here is our hardware + + +Dual Intel Xeon 2.8GHz +6GB RAM +Linux 2.4 kernel +RedHat Enterprise Linux AS 3 +200GB for PGDATA on 3Par, ext3 +50GB for WAL on 3Par, ext3 + +With PostgreSql 8.1.4 + +We don't have i/o bottle neck.=20 + +Whatelse I can try to better tps? Someone told me I can should get tps +over 1500, it is hard to believe. + +Thanks + +Marty + +From pgsql-performance-owner@postgresql.org Mon Aug 21 18:06:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1BD8A9FB2B5 + for ; + Mon, 21 Aug 2006 18:06:40 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 69703-05 for + ; + Mon, 21 Aug 2006 18:06:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 541179FB2C2 + for ; + Mon, 21 Aug 2006 18:06:30 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7LL6SYT019273; + Mon, 21 Aug 2006 17:06:28 -0400 (EDT) +To: "Eamonn Kent" +cc: pgsql-performance@postgresql.org +Subject: Re: Vacuum not identifying rows for removal.. +In-reply-to: <9146E3EBBFBCC94D95F95A1C4065348A837AB1@exch01.xsigo.com> +References: <9146E3EBBFBCC94D95F95A1C4065348A837AB1@exch01.xsigo.com> +Comments: In-reply-to "Eamonn Kent" + message dated "Mon, 21 Aug 2006 11:50:02 -0700" +Date: Mon, 21 Aug 2006 17:06:28 -0400 +Message-ID: <19272.1156194388@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.162 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/319 +X-Sequence-Number: 20504 + +"Eamonn Kent" writes: +> I am using PostgreSQL 8.1.4 for an embedded application. For some +> reason, vacuum is not able to identify rows that are candidates for +> removal (i.e., mark space as available). +> ... +> We run auto vacuum and I can see from the logs that it is running quite +> frequently. When I run vacuum full from the psql, I can see that space +> is not being recovered. I have run vacuum full with the verbose flag +> set, I can see that messages that indicate the existence of "dead row +> versions that cannot be removed yet. + +This means you've got an open transaction somewhere that could +potentially still be able to see those rows. Look around for +applications sitting "idle in transaction". + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Aug 21 18:43:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 168699FB348 + for ; + Mon, 21 Aug 2006 18:43:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 77390-08 for + ; + Mon, 21 Aug 2006 18:43:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id 4E0F89FAE4E + for ; + Mon, 21 Aug 2006 18:23:30 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) + id 1GFHEz-0001yz-7e; Mon, 21 Aug 2006 14:23:25 -0700 +Subject: Re: How to get higher tps +From: Jeff Davis +To: Marty Jia +Cc: pgsql-performance@postgresql.org +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain +Date: Mon, 21 Aug 2006 14:23:26 -0700 +Message-Id: <1156195406.15743.28.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.294 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/321 +X-Sequence-Number: 20506 + +On Mon, 2006-08-21 at 16:45 -0400, Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following +> parameters +> +> shared_buffers +> fsync + +By "tuning" fsync, what do you mean? Did you turn it off? + +If you turned fsync off, that could compromise your data in case of any +kind of crash or power failure. However, if you turn fsync off you +should much higher TPS on pgbench than you're getting. + + +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 + +Does your disk controller have battery-backed writeback cache? How much? + +> With PostgreSql 8.1.4 +> +> We don't have i/o bottle neck. +> + +Well, chances are PostgreSQL is waiting for fsync, which means you do +have an I/O bottleneck (however, you're not using all of your I/O +bandwidth, most likely). + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 18:56:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DBBC69FAE4E + for ; + Mon, 21 Aug 2006 18:56:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 91302-02 for + ; + Mon, 21 Aug 2006 18:56:27 -0300 (ADT) +X-Greylist: delayed 00:53:13.045431 by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id 566F79FA48E + for ; + Mon, 21 Aug 2006 18:36:26 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Mon, 21 Aug 2006 17:38:26 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E312C@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <1156195406.15743.28.camel@dogma.v10.wvs> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbFaFabhe0o+7AjSXa4cbOyNaINKwAAZJqw +From: "Marty Jia" +To: "Jeff Davis" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.335 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/324 +X-Sequence-Number: 20509 + +Jeff, + +Thanks for your response, I did turn the fsync off, no performance +improvement. + +Since the application is a network monring program, data is not critical +for us. + +Marty=20 + +-----Original Message----- +From: Jeff Davis [mailto:pgsql@j-davis.com]=20 +Sent: Monday, August 21, 2006 5:23 PM +To: Marty Jia +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] How to get higher tps + +On Mon, 2006-08-21 at 16:45 -0400, Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following=20 +> parameters +>=20 +> shared_buffers +> fsync + +By "tuning" fsync, what do you mean? Did you turn it off? + +If you turned fsync off, that could compromise your data in case of any +kind of crash or power failure. However, if you turn fsync off you +should much higher TPS on pgbench than you're getting. + + +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 + +Does your disk controller have battery-backed writeback cache? How much? + +> With PostgreSql 8.1.4 +>=20 +> We don't have i/o bottle neck.=20 +>=20 + +Well, chances are PostgreSQL is waiting for fsync, which means you do +have an I/O bottleneck (however, you're not using all of your I/O +bandwidth, most likely). + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 18:50:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 9EF789FB3F2 + for ; + Mon, 21 Aug 2006 18:50:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 89097-01-7 + for ; + Mon, 21 Aug 2006 18:50:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) + by postgresql.org (Postfix) with ESMTP id 353DC9FAE4E + for ; + Mon, 21 Aug 2006 18:47:29 -0300 (ADT) +Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP + with MS-WebStorage 6.0.6249 +Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; + 21 Aug 2006 14:47:25 -0700 +Subject: Re: How to get higher tps +From: Mark Lewis +To: Marty Jia +Cc: pgsql-performance@postgresql.org +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Organization: MIR3, Inc. +Date: Mon, 21 Aug 2006 14:47:25 -0700 +Message-Id: <1156196845.9657.82.camel@archimedes> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.2 (2.0.2-27) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.321 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/322 +X-Sequence-Number: 20507 + +Not much we can do unless you give us more info about how you're testing +(pgbench setup), and what you've done with the parameters you listed +below. It would also be useful if you told us more about your drive +array than just "3Par". We need to know the RAID level, number/speed of +disks, whether it's got a battery-backed write cache that's turned on, +things like this. + +Like Jeff just said, it's likely that you're waiting for rotational +latency, which would limit your maximum tps for sequential jobs based on +the number of disks in your array. For example, a 2-disk array of 10k +RPM disks is going to max out somewhere around 333 tps. (2*10000/60). + +-- Mark Lewis + + + +On Mon, 2006-08-21 at 16:45 -0400, Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following +> parameters +> +> shared_buffers +> fsync +> max_fsm_pages +> max_connections +> shared_buffers +> work_mem +> max_fsm_pages +> effective_cache_size +> random_page_cost +> +> I believe all above have right size and values, but I just can not get +> higher tps more than 300 testd by pgbench +> +> Here is our hardware +> +> +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 +> +> With PostgreSql 8.1.4 +> +> We don't have i/o bottle neck. +> +> Whatelse I can try to better tps? Someone told me I can should get tps +> over 1500, it is hard to believe. +> +> Thanks +> +> Marty +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster + +From pgsql-performance-owner@postgresql.org Mon Aug 21 18:52:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 351AA9FB347 + for ; + Mon, 21 Aug 2006 18:52:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 76293-09-2 + for ; + Mon, 21 Aug 2006 18:51:56 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id 982AB9FB3FE + for ; + Mon, 21 Aug 2006 18:50:58 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) id 1GFHfa-0002Zk-5r + for pgsql-performance@postgresql.org; Mon, 21 Aug 2006 14:50:54 -0700 +Subject: Storage Options +From: Jeff Davis +To: pgsql-performance@postgresql.org +Content-Type: text/plain +Date: Mon, 21 Aug 2006 14:50:51 -0700 +Message-Id: <1156197051.15743.50.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.288 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/323 +X-Sequence-Number: 20508 + +I am trying to decide what kind of storage options to use for a pair of +good database servers, a primary and a read-only that can be a failover. +Here is what I'm thinking so far: + +(1) We have a nice NetApp that can do iSCSI. It has a large (multi-GB) +battery-backed cache so it could potentially perform the transactions at +a very high rate. However there are many other applications accessing +the NetApp over NFS, so I am not sure what performance to expect. Any +suggestions about using network storage like this for the database? Will +the database make huge demands on the NetApp, and force my department +spend huge amounts on new NetApp hardware? + +(2) I read with interest this thread: +http://archives.postgresql.org/pgsql-performance/2006-08/msg00164.php + +Is there any consensus on whether to do WAL on a RAID-1 and PGDATA on a +RAID-10 versus everything on a RAID-10? How does the number of disks I +have affect this decision (I will probably have 4-8 disks per server). + +Some of the applications I initially need to support will be a high +volume of simple transactions without many tablescans, if that helps. +However, I expect that these servers will need to serve many needs. + +Any other suggestions are appreciated. Is there a common place to look +for hardware suggestions (like a postgresql hardware FAQ)? + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 19:08:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 767D39FB33F + for ; + Mon, 21 Aug 2006 19:08:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 90692-03 for + ; + Mon, 21 Aug 2006 19:08:43 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id F1ACF9FB334 + for ; + Mon, 21 Aug 2006 19:08:42 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7LM8ccK021671 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Mon, 21 Aug 2006 15:08:39 -0700 +Message-ID: <44EA2EE3.8030207@commandprompt.com> +Date: Mon, 21 Aug 2006 15:08:35 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Marty Jia +CC: pgsql-performance@postgresql.org +Subject: Re: How to get higher tps +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 21 Aug 2006 15:08:39 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.187 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/325 +X-Sequence-Number: 20510 + +Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following +> parameters +> +> shared_buffers +> fsync +> max_fsm_pages +> max_connections +> shared_buffers +> work_mem +> max_fsm_pages +> effective_cache_size +> random_page_cost +> +> I believe all above have right size and values, but I just can not get +> higher tps more than 300 testd by pgbench + +What values did you use? + +> +> Here is our hardware +> +> +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 +> +> With PostgreSql 8.1.4 +> +> We don't have i/o bottle neck. + +Are you sure? What does iostat say during a pgbench? What parameters are +you passing to pgbench? + +Well in theory, upgrading to 2.6 kernel will help as well as making your +WAL ext2 instead of ext3. + +> Whatelse I can try to better tps? Someone told me I can should get tps +> over 1500, it is hard to believe. + +1500? Hmmm... I don't know about that, I can get 470tps or so on my +measily dual core 3800 with 2gig of ram though. + +Joshua D. Drake + + +> +> Thanks +> +> Marty +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Mon Aug 21 20:43:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A4A1A9FB2DB + for ; + Mon, 21 Aug 2006 20:43:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 32770-06 for + ; + Mon, 21 Aug 2006 23:43:52 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 82AE69FB2A8 + for ; + Mon, 21 Aug 2006 20:43:52 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Mon, 21 Aug 2006 23:43:50 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 21 Aug 2006 18:43:50 -0500 +Subject: Re: How to get higher tps +From: Scott Marlowe +To: Marty Jia +Cc: pgsql-performance@postgresql.org +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156203830.1090.117.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Mon, 21 Aug 2006 18:43:50 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/326 +X-Sequence-Number: 20511 + +On Mon, 2006-08-21 at 15:45, Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following +> parameters +> +> shared_buffers +> fsync +> max_fsm_pages +> max_connections +> shared_buffers +> work_mem +> max_fsm_pages +> effective_cache_size +> random_page_cost +> +> I believe all above have right size and values, but I just can not get +> higher tps more than 300 testd by pgbench +> +> Here is our hardware +> +> +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 +> +> With PostgreSql 8.1.4 + +I assume this is on a blade server then? Just guessing. I'd suspect +your vscsi drivers if that's the case. Look into getting the latest +drivers for your hardware platform and your scsi/vscsi etc... drivers. +If you're connecting through a fibrechannel card make sure you've got +the latest drivers for that as well. + +1500, btw, is quite high. Most fast machines I've dealt with were +hitting 600 to 800 tps on fairly good sized RAID arrays. + +You may be able to put your pg_xlog on a sep partition / set of spindles +and get some perf gain. Also look into how your drives are configured. +The more drives you can throw into a RAID 10 the better. RAID 5 will +usually never give as good of write performance as RAID 10, although it +gets better as the number of drives increases. + +From pgsql-performance-owner@postgresql.org Mon Aug 21 22:28:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3960E9FB2C0 + for ; + Mon, 21 Aug 2006 22:28:06 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 65612-05 for + ; + Tue, 22 Aug 2006 01:27:57 +0000 (UTC) +X-Greylist: delayed 06:37:47.518331 by SQLgrey- +Received: from main.xsigo.com (nat0.xsigo.com [216.184.48.10]) + by postgresql.org (Postfix) with SMTP id C03D79FB2B8 + for ; + Mon, 21 Aug 2006 22:27:55 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Vacuum not identifying rows for removal.. +Date: Mon, 21 Aug 2006 18:27:53 -0700 +Message-ID: <9146E3EBBFBCC94D95F95A1C4065348A837AB4@exch01.xsigo.com> +In-Reply-To: <19272.1156194388@sss.pgh.pa.us> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Vacuum not identifying rows for removal.. +Thread-Index: AcbFZbCx7lVZ2b8qRTSIUGu6ZtlcoAAH9coA +From: "Eamonn Kent" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/327 +X-Sequence-Number: 20512 + +Hello, + +Thanks for the help...It appears that a transaction is indeed being +opened and remains idle. I am able to identify the postgreSQL backend +process that is associated with the transaction, however, I need to +further localize the issue. We have around 22 (postgres) backend +processes associated with various application processes. I would like +to identify our application process. =20 + +I have tried using netstat -ap and looking through the logs..but, to no +avail. (Both the database and the server processes are running on the +same server...connected via unix sockets I believe, perhaps this is +making the association difficult to determine). + +Any ideas of how to identify the application process that is the +postgres process (whose id I know). Perhaps I need to turn on a +different log flag? + + +Thanks + +Ike + + + + +-----Original Message----- +From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 +Sent: Monday, August 21, 2006 2:06 PM +To: Eamonn Kent +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Vacuum not identifying rows for removal..=20 + +"Eamonn Kent" writes: +> I am using PostgreSQL 8.1.4 for an embedded application. For some +> reason, vacuum is not able to identify rows that are candidates for +> removal (i.e., mark space as available). +> ... +> We run auto vacuum and I can see from the logs that it is running +quite +> frequently. When I run vacuum full from the psql, I can see that space +> is not being recovered. I have run vacuum full with the verbose flag +> set, I can see that messages that indicate the existence of "dead row +> versions that cannot be removed yet. + +This means you've got an open transaction somewhere that could +potentially still be able to see those rows. Look around for +applications sitting "idle in transaction". + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Aug 21 22:56:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 12F829FB2C0 + for ; + Mon, 21 Aug 2006 22:56:02 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 34202-06 for + ; + Mon, 21 Aug 2006 22:55:55 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 4436F9FB2B8 + for ; + Mon, 21 Aug 2006 22:55:55 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7M1tsNo025535 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Mon, 21 Aug 2006 18:55:58 -0700 +Message-ID: <44EA6426.4020901@commandprompt.com> +Date: Mon, 21 Aug 2006 18:55:50 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Eamonn Kent +CC: pgsql-performance@postgresql.org +Subject: Re: Vacuum not identifying rows for removal.. +References: <9146E3EBBFBCC94D95F95A1C4065348A837AB4@exch01.xsigo.com> +In-Reply-To: <9146E3EBBFBCC94D95F95A1C4065348A837AB4@exch01.xsigo.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 21 Aug 2006 18:55:58 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.187 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/328 +X-Sequence-Number: 20513 + + +> Any ideas of how to identify the application process that is the +> postgres process (whose id I know). Perhaps I need to turn on a +> different log flag? + +select * from pg_stat_activity will give you the pid :) + +Joshua D. Drake + + +> +> +> Thanks +> +> Ike +> +> +> +> +> -----Original Message----- +> From: Tom Lane [mailto:tgl@sss.pgh.pa.us] +> Sent: Monday, August 21, 2006 2:06 PM +> To: Eamonn Kent +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Vacuum not identifying rows for removal.. +> +> "Eamonn Kent" writes: +>> I am using PostgreSQL 8.1.4 for an embedded application. For some +>> reason, vacuum is not able to identify rows that are candidates for +>> removal (i.e., mark space as available). +>> ... +>> We run auto vacuum and I can see from the logs that it is running +> quite +>> frequently. When I run vacuum full from the psql, I can see that space +>> is not being recovered. I have run vacuum full with the verbose flag +>> set, I can see that messages that indicate the existence of "dead row +>> versions that cannot be removed yet. +> +> This means you've got an open transaction somewhere that could +> potentially still be able to see those rows. Look around for +> applications sitting "idle in transaction". +> +> regards, tom lane +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 00:55:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 247539FB2B3 + for ; + Tue, 22 Aug 2006 00:55:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 43759-07 for + ; + Tue, 22 Aug 2006 00:55:36 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from momjian.us (momjian.us [70.90.9.53]) + by postgresql.org (Postfix) with ESMTP id 938759FA465 + for ; + Tue, 22 Aug 2006 00:55:36 -0300 (ADT) +Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id + k7M3o2s14894; + Mon, 21 Aug 2006 23:50:02 -0400 (EDT) +From: Bruce Momjian +Message-Id: <200608220350.k7M3o2s14894@momjian.us> +Subject: Re: Effects of cascading references in foreign keys +In-Reply-To: <12097.1130610925@sss.pgh.pa.us> +To: Tom Lane +Date: Mon, 21 Aug 2006 23:50:02 -0400 (EDT) +CC: Michael Fuhr , Bruno Wolff III , + Martin Lesser , + Stephan Szabo , + pgsql-performance@postgresql.org +X-Mailer: ELM [version 2.4ME+ PL123] +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; charset="US-ASCII" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.14 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/329 +X-Sequence-Number: 20514 + +Tom Lane wrote: +> I wrote: +> > Looking at this, I wonder if there isn't a bug or at least an +> > inefficiency in 8.1. The KeysEqual short circuit tests are still there +> > in ri_triggers.c; aren't they now redundant with the test in triggers.c? +> > And don't they need to account for the special case mentioned in the +> > comment in triggers.c, that the RI check must still be done if we are +> > looking at a row updated by the same transaction that created it? +> +> OK, I take back the possible-bug comment: the special case only applies +> to the FK-side triggers, which is to say RI_FKey_check, and that routine +> doesn't attempt to skip the check on equal old/new keys. I'm still +> wondering though if the KeysEqual tests in the other RI triggers aren't +> now a waste of cycles. + +Would someone please research this? Thanks. + +-- + Bruce Momjian bruce@momjian.us + EnterpriseDB http://www.enterprisedb.com + + + If your life is a hard drive, Christ can be your backup. + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 06:23:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id EB6E19FB36F + for ; + Tue, 22 Aug 2006 06:23:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 68495-01-3 + for ; + Tue, 22 Aug 2006 06:23:20 -0300 (ADT) +X-Greylist: delayed 00:13:17.152436 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 613C29FB3AB + for ; + Tue, 22 Aug 2006 06:23:08 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from havoc.unixathome.org (havoc.unixathome.org [66.154.98.130]) + by svr4.postgresql.org (Postfix) with ESMTP id 4E4065AF2CB + for ; + Tue, 22 Aug 2006 09:09:49 +0000 (GMT) +Received: from localhost (localhost [127.0.0.1]) + by havoc.unixathome.org (Postfix) with ESMTP id 6E408564A1 + for ; + Tue, 22 Aug 2006 02:09:43 -0700 (PDT) +X-Virus-Scanned: by amavisd-new at unixathome.org +Received: from havoc.unixathome.org ([127.0.0.1]) + by localhost (havoc.unixathome.org [127.0.0.1]) (amavisd-new, + port 10024) + with ESMTP id c2rXbWMfM9YP for ; + Tue, 22 Aug 2006 02:09:39 -0700 (PDT) +Received: from bast.unixathome.org (bast.unixathome.org [70.26.229.230]) + by havoc.unixathome.org (Postfix) with ESMTP id D397056431 + for ; + Tue, 22 Aug 2006 02:09:38 -0700 (PDT) +Received: from [10.55.0.99] (wocker.unixathome.org [10.55.0.99]) + by bast.unixathome.org (Postfix) with ESMTP id 52B0FB822 + for ; + Tue, 22 Aug 2006 05:09:37 -0400 (EDT) +From: "Dan Langille" +To: pgsql-performance@postgresql.org +Date: Tue, 22 Aug 2006 05:09:36 -0400 +MIME-Version: 1.0 +Subject: Forcing index usage without 'enable_hashjoin = FALSE' +Message-ID: <44EA9190.5306.162A8DE9@dan.langille.org> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/330 +X-Sequence-Number: 20515 + +I'm using PostgreSQL 8.1.4 and I'm trying to force the planner to use +an index. With the index, I get executions times of 0.5 seconds. +Without, it's closer to 2.5 seconds. + +Compare these two sets of results (also provided at +http://rafb.net/paste/results/ywcOZP66.html +should it appear poorly formatted below): + +freshports.org=# \i test2.sql + +QUERY PLAN +---------------------------------------------------------------------- +---------------------------------------------------------------------- +- + Merge Join (cost=24030.39..24091.43 rows=3028 width=206) (actual +time=301.301..355.261 rows=3149 loops=1) + Merge Cond: ("outer".id = "inner".category_id) + -> Sort (cost=11.17..11.41 rows=97 width=4) (actual +time=0.954..1.300 rows=95 loops=1) + Sort Key: c.id + -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +width=4) (actual time=0.092..0.517 rows=97 loops=1) + -> Sort (cost=24019.22..24026.79 rows=3028 width=206) (actual +time=300.317..314.114 rows=3149 loops=1) + Sort Key: p.category_id + -> Nested Loop (cost=0.00..23844.14 rows=3028 width=206) +(actual time=0.082..264.459 rows=3149 loops=1) + -> Seq Scan on ports p (cost=0.00..6141.11 rows=3028 +width=206) (actual time=0.026..133.575 rows=3149 loops=1) + Filter: (status = 'D'::bpchar) + -> Index Scan using element_pkey on element e +(cost=0.00..5.83 rows=1 width=4) (actual time=0.022..0.026 rows=1 +loops=3149) + Index Cond: ("outer".element_id = e.id) + Total runtime: 369.869 ms +(13 rows) + +freshports.org=# set enable_hashjoin = true; +SET +freshports.org=# \i test2.sql + QUERY PLAN +---------------------------------------------------------------------- +---------------------------------------------------------- + Hash Join (cost=6156.90..13541.14 rows=3028 width=206) (actual +time=154.741..2334.366 rows=3149 loops=1) + Hash Cond: ("outer".category_id = "inner".id) + -> Hash Join (cost=6148.68..13472.36 rows=3028 width=206) +(actual time=153.801..2288.792 rows=3149 loops=1) + Hash Cond: ("outer".id = "inner".element_id) + -> Seq Scan on element e (cost=0.00..4766.70 rows=252670 +width=4) (actual time=0.022..1062.626 rows=252670 loops=1) + -> Hash (cost=6141.11..6141.11 rows=3028 width=206) +(actual time=151.105..151.105 rows=3149 loops=1) + -> Seq Scan on ports p (cost=0.00..6141.11 rows=3028 +width=206) (actual time=0.027..131.072 rows=3149 loops=1) + Filter: (status = 'D'::bpchar) + -> Hash (cost=7.97..7.97 rows=97 width=4) (actual +time=0.885..0.885 rows=97 loops=1) + -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +width=4) (actual time=0.076..0.476 rows=97 loops=1) + Total runtime: 2346.877 ms +(11 rows) + +freshports.org=# + +Without leaving "enable_hashjoin = false", can you suggest a way to +force the index usage? + +FYI, the query is: + +explain analyse +SELECT P.id, + P.category_id, + P.version as version, + P.revision as revision, + P.element_id, + P.maintainer, + P.short_description, + to_char(P.date_added - SystemTimeAdjust(), 'DD Mon YYYY +HH24:MI:SS') as date_added, + P.last_commit_id as last_change_log_id, + P.package_exists, + P.extract_suffix, + P.homepage, + P.status, + P.broken, + P.forbidden, + P.ignore, + P.restricted, + P.deprecated, + P.no_cdrom, + P.expiration_date, + P.latest_link + FROM categories C, ports P JOIN element E on P.element_id = E.id + WHERE P.status = 'D' + AND P.category_id = C.id; + +-- +Dan Langille : Software Developer looking for work +my resume: http://www.freebsddiary.org/dan_langille.php + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 07:03:16 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 9996A9FB1E7 + for ; + Tue, 22 Aug 2006 07:03:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 51423-03 for + ; + Tue, 22 Aug 2006 10:02:55 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms040pub.verizon.net (vms040pub.verizon.net [206.46.252.40]) + by postgresql.org (Postfix) with ESMTP id 7774F9FB2C0 + for ; + Tue, 22 Aug 2006 07:02:55 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.85]) + by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J4E00DAJ98H46E5@vms040.mailsrvcs.net> for + pgsql-performance@postgresql.org; Tue, 22 Aug 2006 05:02:42 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id 80A266FD6B for + ; + Tue, 22 Aug 2006 06:02:40 -0400 (EDT) +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 3oLspkuMwP5Q for ; Tue, + 22 Aug 2006 06:02:39 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id D284F6FD70; Tue, 22 Aug 2006 06:02:38 -0400 (EDT) +Date: Tue, 22 Aug 2006 06:02:38 -0400 +From: Michael Stone +Subject: Re: Storage Options +In-reply-to: <1156197051.15743.50.camel@dogma.v10.wvs> +To: pgsql-performance@postgresql.org +Mail-followup-to: pgsql-performance@postgresql.org +Message-id: <20060822100236.GW2900@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: <1156197051.15743.50.camel@dogma.v10.wvs> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/331 +X-Sequence-Number: 20516 + +On Mon, Aug 21, 2006 at 02:50:51PM -0700, Jeff Davis wrote: +>the NetApp over NFS, so I am not sure what performance to expect. Any +>suggestions about using network storage like this for the database? + +Don't. Unless you're using a very small (toy-scale) database, the netapp +storage is way too expensive for the kind of usage you see with a +database application. You're much better off buying much cheaper storage +twice and using a database replication solution than either choking a +really expensive netapp or getting lousy performance from the same. The +netapps have their niche, but database storage isn't it. (Peformance in +general really isn't it--the advantages are managability, snapshotting, +and cross-platform data exchange. It may be that those factors are +important enough to make that a good solution for your particular +situation, but they're generally not particularly relevant in the +postgres space.) + +>Is there any consensus on whether to do WAL on a RAID-1 and PGDATA on a +>RAID-10 versus everything on a RAID-10? How does the number of disks I +>have affect this decision (I will probably have 4-8 disks per server). + +You can't get a good answer without testing with your actual data. I'd +suspect that with such a low number of disks you're better off with a +single array, assuming that you have a good bbu raid controller and +assuming that you're not doing write-mostly transaction work. But +testing with your actual workload is the only way to really know. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Tue Aug 22 10:00:43 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 9C2309FB3A3 + for ; + Tue, 22 Aug 2006 10:00:42 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 82383-03-7 + for ; + Tue, 22 Aug 2006 10:00:37 -0300 (ADT) +X-Greylist: delayed 00:22:17.62743 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id A52409FB3CE + for ; + Tue, 22 Aug 2006 09:59:52 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from rose.ctd.hcltech.com (rose.ctd.hcltech.com [202.54.64.23]) + by svr4.postgresql.org (Postfix) with ESMTP id 9B54C5AF8D3 + for ; + Tue, 22 Aug 2006 12:39:31 +0000 (GMT) +X-MessageTextProcessor: DisclaimIt (2.50.252) [HCL Technologies Limited] +Content-Class: urn:content-classes:message +Received: from Ganesh.ctd.hcltech.com ([202.54.64.2]) by rose.ctd.hcltech.com + with Microsoft SMTPSVC(5.0.2195.6713); + Tue, 22 Aug 2006 18:09:27 +0530 +Received: by Ganesh.ctd.hcltech.com with Internet Mail Service (5.5.2653.19) + id ; Tue, 22 Aug 2006 18:09:27 +0530 +Message-ID: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +From: "Ravindran G - TLS, Chennai." +To: +Subject: Postgre SQL 7.1 cygwin performance issue. +Date: Tue, 22 Aug 2006 18:09:21 +0530 +Importance: high +X-Priority: 1 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +MIME-Version: 1.0 +X-Mailer: Internet Mail Service (5.5.2653.19) +Content-Type: multipart/mixed; + boundary="----_=_NextPart_000_01C6C5E7.FDD7AAEC" +X-OriginalArrivalTime: 22 Aug 2006 12:39:27.0241 (UTC) + FILETIME=[015A2F90:01C6C5E8] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.502 tagged_above=0 required=5 tests=SARE_RAND_1, + SPF_NEUTRAL, X_PRIORITY_HIGH +X-Spam-Level: *** +X-Archive-Number: 200608/332 +X-Sequence-Number: 20517 + +This is a multi-part message in MIME format. + +------_=_NextPart_000_01C6C5E7.FDD7AAEC +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; + charset="iso-8859-1" + +Hi, + +We are using PostgreSQL 7.1 cygwin installed on Windows 2000 (2 GB = +Memory, +P4).=20 + +We understand that the maximum connections that can be set is 64 in +Postgresql 7.1 version.=20 + +The performance is very slow and some time the database is not getting +connected from our application because of this.=20 + +Please advise us on how to increase the performance by setting any +attributes in configuration files ?.=20 + +Find enclosed the configuration file.=20 + +Thanks and regards, +Ravi + + +To post a message to the mailing list, send it to + pgsql-performance@postgresql.org + + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] +Sent: Tuesday, August 22, 2006 5:32 PM +To: ravig3 +Subject: 7E88-5CD9-AD0E : CONFIRM from pgsql-performance (subscribe) + + +__=20 +The following request + + "subscribe pgsql-performance ravig3 " + +was sent to =20 +by ravig3 . + +To accept or reject this request, please do one of the following: + +1. If you have web browsing capability, visit +=20 + + and follow the instructions there. + +2. Reply to majordomo@postgresql.org=20 + with one of the following two commands in the body of the message: + + accept + reject + + (The number 7E88-5CD9-AD0E must be in the Subject header) + +3. Reply to majordomo@postgresql.org=20 + with one of the following two commands in the body of the message: + =20 + accept 7E88-5CD9-AD0E + reject 7E88-5CD9-AD0E + +Your confirmation is required for the following reason(s): + + The subscribe_policy rule says that the "subscribe" command=20 + must be confirmed by the person affected by the command. + =20 + +If you do not respond within 4 days, a reminder will be sent. + +If you do not respond within 7 days, this token will expire, +and the request will not be completed. + +If you would like to communicate with a person,=20 +send mail to pgsql-performance-owner@postgresql.org. +DISCLAIMER=20 +The contents of this e-mail and any attachment(s) are confidential and = +intended for the=20 + +named recipient(s) only. It shall not attach any liability on the = +originator or HCL or its=20 + +affiliates. Any views or opinions presented in this email are solely = +those of the author and=20 + +may not necessarily reflect the opinions of HCL or its affiliates. Any = +form of reproduction,=20 + +dissemination, copying, disclosure, modification, distribution and / or = +publication of this=20 + +message without the prior written consent of the author of this e-mail = +is strictly=20 + +prohibited. If you have received this email in error please delete it = +and notify the sender=20 + +immediately. Before opening any mail and attachments please check them = +for viruses and=20 + +defect. + +------_=_NextPart_000_01C6C5E7.FDD7AAEC +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + name="postgresql.conf.txt" +Content-Disposition: attachment; + filename="postgresql.conf.txt" + +# +# PostgreSQL configuration file +# ----------------------------- +# +# This file consists of lines of the form +# +# name = value +# +# (The `=' is optional.) White space is collapsed, comments are +# introduced by `#' anywhere on a line. The complete list of option +# names and allowed values can be found in the PostgreSQL +# documentation. The commented-out settings shown in this file +# represent the default values. + +# Any option can also be given as a command line switch to the +# postmaster, e.g., 'postmaster -c log_connections=on'. Some options +# can be changed at run-time with the 'SET' SQL command. + + +#======================================================================== + + +# +# Connection Parameters +# +tcpip_socket = true +#ssl = false + +max_connections = 64 + +#port = 5432 +#hostname_lookup = false +#show_source_port = false + +#unix_socket_directory = '' +#unix_socket_group = '' +#unix_socket_permissions = 0777 + +#virtual_host = '' + +#krb_server_keyfile = '' + + +# +# Shared Memory Size +# +shared_buffers = 20000 # 2*max_connections, min 16 +#max_fsm_relations = 100 # min 10, fsm is free space map +max_fsm_pages = 20000 # min 1000, fsm is free space map +#max_locks_per_transaction = 64 # min 10 +#wal_buffers = 8 # min 4 + +# +# Non-shared Memory Sizes +# +#sort_mem = 512 # min 32 +#vacuum_mem = 8192 # min 1024 + + +# +# Write-ahead log (WAL) +# +#wal_files = 0 # range 0-64 +wal_sync_method = open_sync # the default varies across platforms: +# # fsync, fdatasync, open_sync, or open_datasync +#wal_debug = 0 # range 0-16 +#commit_delay = 0 # range 0-100000 +#commit_siblings = 5 # range 1-1000 +#checkpoint_segments = 3 # in logfile segments (16MB each), min 1 +#checkpoint_timeout = 300 # in seconds, range 30-3600 +#fsync = true + + +# +# Optimizer Parameters +# +#enable_seqscan = true +#enable_indexscan = true +#enable_tidscan = true +#enable_sort = true +#enable_nestloop = true +#enable_mergejoin = true +#enable_hashjoin = true + +#ksqo = false + +effective_cache_size = 5000 # default in 8k pages +#random_page_cost = 4 +#cpu_tuple_cost = 0.01 +#cpu_index_tuple_cost = 0.001 +#cpu_operator_cost = 0.0025 + + +# +# GEQO Optimizer Parameters +# +#geqo = true +#geqo_selection_bias = 2.0 # range 1.5-2.0 +#geqo_threshold = 11 +#geqo_pool_size = 0 # default based on #tables in query, range 128-1024 +#geqo_effort = 1 +#geqo_generations = 0 +#geqo_random_seed = -1 # auto-compute seed + + +# +# Debug display +# +#silent_mode = false + +log_connections = true +log_timestamp = true +#log_pid = false + +#debug_level = 0 # range 0-16 + +debug_print_query = true +#debug_print_parse = false +#debug_print_rewritten = false +#debug_print_plan = false +#debug_pretty_print = false + +# requires USE_ASSERT_CHECKING +#debug_assertions = true + + +# +# Syslog +# +# requires ENABLE_SYSLOG +#syslog = 0 # range 0-2 +#syslog_facility = 'LOCAL0' +#syslog_ident = 'postgres' + + +# +# Statistics +# +#show_parser_stats = false +#show_planner_stats = false +#show_executor_stats = false +#show_query_stats = false + +# requires BTREE_BUILD_STATS +#show_btree_build_stats = false + + +# +# Access statistics collection +# +#stats_start_collector = true +#stats_reset_on_server_start = true +#stats_command_string = false +#stats_row_level = false +#stats_block_level = false + + +# +# Lock Tracing +# +#trace_notify = false + +# requires LOCK_DEBUG +#trace_locks = false +#trace_userlocks = false +#trace_lwlocks = false +#debug_deadlocks = false +#trace_lock_oidmin = 16384 +#trace_lock_table = 0 + + +# +# Misc +# +#dynamic_library_path = '$libdir' +#australian_timezones = false +#authentication_timeout = 60 # min 1, max 600 +#deadlock_timeout = 1000 +#default_transaction_isolation = 'read committed' +#max_expr_depth = 10000 # min 10 +#max_files_per_process = 1000 # min 25 +#password_encryption = false +#sql_inheritance = true +#transform_null_equals = false + + +------_=_NextPart_000_01C6C5E7.FDD7AAEC-- + +From pgsql-performance-owner@postgresql.org Tue Aug 22 10:15:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 45C009FB279 + for ; + Tue, 22 Aug 2006 10:15:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 00459-03 for + ; + Tue, 22 Aug 2006 13:15:00 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) + by postgresql.org (Postfix) with ESMTP id C28D79FB20A + for ; + Tue, 22 Aug 2006 10:14:59 -0300 (ADT) +Received: by wx-out-0506.google.com with SMTP id t13so1887790wxc + for ; + Tue, 22 Aug 2006 06:14:58 -0700 (PDT) +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:references; + b=HQfTCO75JFT/e27/sPKr1QexZsniZGg7NnTBuYkqoC0ojNNEdRyz5hYNM0P5yH0CHwFs9mY0UtGIsOPZXdxLtQOiK4mmbPPl7HYfO+ucRM3bf3McZ+0RjImSocoLHxaOWMT2Op3ZA3rCCGlKRHFIoSGBbjMrp6R4+CD96upY7HU= +Received: by 10.70.52.5 with SMTP id z5mr11555642wxz; + Tue, 22 Aug 2006 06:14:58 -0700 (PDT) +Received: by 10.70.73.10 with HTTP; Tue, 22 Aug 2006 06:14:58 -0700 (PDT) +Message-ID: <1d219a6f0608220614r29dd5dddg5f96d0c317bd7a1e@mail.gmail.com> +Date: Tue, 22 Aug 2006 09:14:58 -0400 +From: "Chris Hoover" +To: "Ravindran G - TLS, Chennai." +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Cc: pgsql-performance@postgresql.org +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_74127_2242186.1156252498406" +References: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=4.191 tagged_above=0 required=5 tests=HTML_30_40, + HTML_MESSAGE, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: **** +X-Archive-Number: 200608/334 +X-Sequence-Number: 20519 + +------=_Part_74127_2242186.1156252498406 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Is there a reason you are not upgrading to PostgreSQL 8.1? it will run +natively on Windoze, and will give you much better performance. 7.1 is way +out of date, and has a lot of bad issues in it. + +Upgrading will most likely fix this issue. + +Chris + +On 8/22/06, Ravindran G - TLS, Chennai. wrote: +> +> Hi, +> +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000 (2 GB Memory, +> P4). +> +> We understand that the maximum connections that can be set is 64 in +> Postgresql 7.1 version. +> +> The performance is very slow and some time the database is not getting +> connected from our application because of this. +> +> Please advise us on how to increase the performance by setting any +> attributes in configuration files ?. +> +> Find enclosed the configuration file. +> +> Thanks and regards, +> Ravi +> +> +> To post a message to the mailing list, send it to +> pgsql-performance@postgresql.org +> +> +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] +> Sent: Tuesday, August 22, 2006 5:32 PM +> To: ravig3 +> Subject: 7E88-5CD9-AD0E : CONFIRM from pgsql-performance (subscribe) +> +> +> __ +> The following request +> +> "subscribe pgsql-performance ravig3 " +> +> was sent to +> by ravig3 . +> +> To accept or reject this request, please do one of the following: +> +> 1. If you have web browsing capability, visit +> +> < +> http://mail.postgresql.org/mj/mj_confirm/domain=postgresql.org?t=7E88-5CD9- +> AD0E> +> and follow the instructions there. +> +> 2. Reply to majordomo@postgresql.org +> with one of the following two commands in the body of the message: +> +> accept +> reject +> +> (The number 7E88-5CD9-AD0E must be in the Subject header) +> +> 3. Reply to majordomo@postgresql.org +> with one of the following two commands in the body of the message: +> +> accept 7E88-5CD9-AD0E +> reject 7E88-5CD9-AD0E +> +> Your confirmation is required for the following reason(s): +> +> The subscribe_policy rule says that the "subscribe" command +> must be confirmed by the person affected by the command. +> +> +> If you do not respond within 4 days, a reminder will be sent. +> +> If you do not respond within 7 days, this token will expire, +> and the request will not be completed. +> +> If you would like to communicate with a person, +> send mail to pgsql-performance-owner@postgresql.org. +> DISCLAIMER +> The contents of this e-mail and any attachment(s) are confidential and +> intended for the +> +> named recipient(s) only. It shall not attach any liability on the +> originator or HCL or its +> +> affiliates. Any views or opinions presented in this email are solely those +> of the author and +> +> may not necessarily reflect the opinions of HCL or its affiliates. Any +> form of reproduction, +> +> dissemination, copying, disclosure, modification, distribution and / or +> publication of this +> +> message without the prior written consent of the author of this e-mail is +> strictly +> +> prohibited. If you have received this email in error please delete it and +> notify the sender +> +> immediately. Before opening any mail and attachments please check them for +> viruses and +> +> defect. +> +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: explain analyze is your friend +> +> +> +> + +------=_Part_74127_2242186.1156252498406 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Is there a reason you are not upgrading to PostgreSQL 8.1?  it will run natively on Windoze, and will give you much better performance.  7.1 is way out of date, and has a lot of bad issues in it.

Upgrading will most likely fix this issue. +

Chris

On 8/22/06, Ravindran G - TLS, Chennai. <ravindran_g@hcl.in> wrote:
+Hi,

We are using PostgreSQL 7.1 cygwin installed on Windows 2000 (2 GB Memory,
P4).

We understand that the maximum connections that can be set is 64 in
Postgresql 7.1 version.

The performance is very slow and some time the database is not getting +
connected from our application because of this.

Please advise us on how to increase the performance by setting any
attributes in configuration files ?.

Find enclosed the configuration file.

Thanks and regards, +
Ravi


To post a message to the mailing list, send it to
  pgsql-performance@postgresql.org


-----Original Message-----
From: +pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org]
Sent: Tuesday, August 22, 2006 5:32 PM
To: ravig3
Subject: 7E88-5CD9-AD0E : CONFIRM from pgsql-performance (subscribe) +


__
The following request

  "subscribe pgsql-performance ravig3 <ravindran_g@hcl.in>"

was sent to
by ravig3 < +ravindran_g@hcl.in>.

To accept or reject this request, please do one of the following:

1. If you have web browsing capability, visit

< +http://mail.postgresql.org/mj/mj_confirm/domain=postgresql.org?t=7E88-5CD9-
AD0E>
   and follow the instructions there.

2. Reply to majordomo@postgresql.org +
   with one of the following two commands in the body of the message:

    accept
    reject

   (The number 7E88-5CD9-AD0E must be in the Subject header)

3. Reply to +majordomo@postgresql.org
   with one of the following two commands in the body of the message:

    accept 7E88-5CD9-AD0E
    reject 7E88-5CD9-AD0E

Your confirmation is required for the following reason(s): +

  The subscribe_policy rule says that the "subscribe" command
  must be confirmed by the person affected by the command.


If you do not respond within 4 days, a reminder will be sent.

+If you do not respond within 7 days, this token will expire,
and the request will not be completed.

If you would like to communicate with a person,
send mail to +pgsql-performance-owner@postgresql.org.
DISCLAIMER
The contents of this e-mail and any attachment(s) are confidential and intended for the

named recipient(s) only. It shall not attach any liability on the originator or HCL or its +

affiliates. Any views or opinions presented in this email are solely those of the author and

may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction,

dissemination, copying, disclosure, modification, distribution and / or publication of this +

message without the prior written consent of the author of this e-mail is strictly

prohibited. If you have received this email in error please delete it and notify the sender

immediately. Before opening any mail and attachments please check them for viruses and +

defect.



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend




+ +------=_Part_74127_2242186.1156252498406-- + +From pgsql-performance-owner@postgresql.org Tue Aug 22 10:14:56 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 255789FB2D7 + for ; + Tue, 22 Aug 2006 10:14:56 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 02098-01 for + ; + Tue, 22 Aug 2006 13:14:36 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id E38C29FB26A + for ; + Tue, 22 Aug 2006 10:14:35 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 09:16:34 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31DF@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <1156196845.9657.82.camel@archimedes> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbFa68oZ7MBBflSTfSfvawHRw+dWwAgL7NQ +From: "Marty Jia" +To: "Mark Lewis" +Cc: , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/333 +X-Sequence-Number: 20518 + +Hi, Mark + +Thanks, here is our hardware info: + +RAID 10, using 3Par virtual volume technology across ~200 physical FC +disks. 4 virtual disks for PGDATA, striped with LVM into one volume, 2 +virtual disks for WAL, also striped. SAN attached with Qlogic SAN +surfer multipathing to load balance each LUN on two 2GBs paths. HBAs +are Qlogic 2340's. 16GB host cache on 3Par. + +Detailed major config values + +shared_buffers =3D 80000 +fsync =3D on +max_fsm_pages =3D 350000 +max_connections =3D 1000 +work_mem =3D 65536 +effective_cache_size =3D 610000 +random_page_cost =3D 3 + + +Marty +=20 + +-----Original Message----- +From: Mark Lewis [mailto:mark.lewis@mir3.com]=20 +Sent: Monday, August 21, 2006 5:47 PM +To: Marty Jia +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] How to get higher tps + +Not much we can do unless you give us more info about how you're testing +(pgbench setup), and what you've done with the parameters you listed +below. It would also be useful if you told us more about your drive +array than just "3Par". We need to know the RAID level, number/speed of +disks, whether it's got a battery-backed write cache that's turned on, +things like this. + +Like Jeff just said, it's likely that you're waiting for rotational +latency, which would limit your maximum tps for sequential jobs based on +the number of disks in your array. For example, a 2-disk array of 10k +RPM disks is going to max out somewhere around 333 tps. (2*10000/60). + +-- Mark Lewis + +=20 + +On Mon, 2006-08-21 at 16:45 -0400, Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following=20 +> parameters +>=20 +> shared_buffers +> fsync +> max_fsm_pages +> max_connections +> shared_buffers +> work_mem +> max_fsm_pages +> effective_cache_size +> random_page_cost +>=20 +> I believe all above have right size and values, but I just can not get + +> higher tps more than 300 testd by pgbench +>=20 +> Here is our hardware +>=20 +>=20 +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 +>=20 +> With PostgreSql 8.1.4 +>=20 +> We don't have i/o bottle neck.=20 +>=20 +> Whatelse I can try to better tps? Someone told me I can should get tps + +> over 1500, it is hard to believe. +>=20 +> Thanks +>=20 +> Marty +>=20 +> ---------------------------(end of=20 +> broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster + +From pgsql-performance-owner@postgresql.org Tue Aug 22 10:17:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id CF8349FB279 + for ; + Tue, 22 Aug 2006 10:17:27 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 03017-01-8 + for ; + Tue, 22 Aug 2006 13:17:14 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 3C1CA9FB361 + for ; + Tue, 22 Aug 2006 10:17:08 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7MDH4TF002321; + Tue, 22 Aug 2006 09:17:04 -0400 (EDT) +To: "Ravindran G - TLS, Chennai." +cc: pgsql-performance@postgresql.org +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +In-reply-to: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +References: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +Comments: In-reply-to "Ravindran G - TLS, Chennai." + message dated "Tue, 22 Aug 2006 18:09:21 +0530" +Date: Tue, 22 Aug 2006 09:17:04 -0400 +Message-ID: <2320.1156252624@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/335 +X-Sequence-Number: 20520 + +"Ravindran G - TLS, Chennai." writes: +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000 (2 GB Memory, +> P4). + +Egad :-( + +If you are worried about performance, get off 7.1. Even if you are not +worried about performance, get off 7.1. It *will* eat your data someday. + +A native Windows build of PG 8.1 will blow the doors off 7.1/cygwin as +to both performance and reliability. + +I know little about Windows versions, but I suspect people will tell you +that a newer version of Windows would be a good idea too. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 22 10:17:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id B8BE69FB352 + for ; + Tue, 22 Aug 2006 10:17:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 02335-02 for + ; + Tue, 22 Aug 2006 13:17:43 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id 2C6749FB348 + for ; + Tue, 22 Aug 2006 10:17:41 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 09:19:40 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31E1@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <44EA2EE3.8030207@commandprompt.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbFbqZ3pwXSn1WgSyO9PlRQeXyZggAfqGRQ +From: "Marty Jia" +To: "Joshua D. Drake" +Cc: , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/336 +X-Sequence-Number: 20521 + +Joshua, + +Here is=20 + +shared_buffers =3D 80000 +fsync =3D on +max_fsm_pages =3D 350000 +max_connections =3D 1000 +work_mem =3D 65536 +effective_cache_size =3D 610000 +random_page_cost =3D 3 +=20 +Here is pgbench I used: + +pgbench -c 10 -t 10000 -d HQDB + +Thanks + +Marty + +-----Original Message----- +From: Joshua D. Drake [mailto:jd@commandprompt.com]=20 +Sent: Monday, August 21, 2006 6:09 PM +To: Marty Jia +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] How to get higher tps + +Marty Jia wrote: +> I'm exhausted to try all performance tuning ideas, like following=20 +> parameters +>=20 +> shared_buffers +> fsync +> max_fsm_pages +> max_connections +> shared_buffers +> work_mem +> max_fsm_pages +> effective_cache_size +> random_page_cost +>=20 +> I believe all above have right size and values, but I just can not get + +> higher tps more than 300 testd by pgbench + +What values did you use? + +>=20 +> Here is our hardware +>=20 +>=20 +> Dual Intel Xeon 2.8GHz +> 6GB RAM +> Linux 2.4 kernel +> RedHat Enterprise Linux AS 3 +> 200GB for PGDATA on 3Par, ext3 +> 50GB for WAL on 3Par, ext3 +>=20 +> With PostgreSql 8.1.4 +>=20 +> We don't have i/o bottle neck.=20 + +Are you sure? What does iostat say during a pgbench? What parameters are +you passing to pgbench? + +Well in theory, upgrading to 2.6 kernel will help as well as making your +WAL ext2 instead of ext3. + +> Whatelse I can try to better tps? Someone told me I can should get tps + +> over 1500, it is hard to believe. + +1500? Hmmm... I don't know about that, I can get 470tps or so on my +measily dual core 3800 with 2gig of ram though. + +Joshua D. Drake + + +>=20 +> Thanks +>=20 +> Marty +>=20 +> ---------------------------(end of=20 +> broadcast)--------------------------- +> TIP 2: Don't 'kill -9' the postmaster +>=20 + + +--=20 + + =3D=3D=3D The PostgreSQL Company: Command Prompt, Inc. =3D=3D=3D +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 11:32:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 050E79FB2EE + for ; + Tue, 22 Aug 2006 11:32:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 14662-08 for + ; + Tue, 22 Aug 2006 14:31:52 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) + by postgresql.org (Postfix) with ESMTP id 382A19FB1EE + for ; + Tue, 22 Aug 2006 11:31:51 -0300 (ADT) +Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP + with MS-WebStorage 6.0.6249 +Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; + 22 Aug 2006 07:31:49 -0700 +Subject: Re: How to get higher tps +From: Mark Lewis +To: Marty Jia +Cc: "Joshua D. Drake" , + pgsql-performance@postgresql.org, + DBAs , Rich Wilson , + Ernest Wurzbach +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31E1@SITE3MAIL04.jeeves.ask.info> +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31E1@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Organization: MIR3, Inc. +Date: Tue, 22 Aug 2006 07:31:49 -0700 +Message-Id: <1156257109.9657.93.camel@archimedes> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.2 (2.0.2-27) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY +X-Spam-Level: *** +X-Archive-Number: 200608/337 +X-Sequence-Number: 20522 + +Well, at least on my test machines running gnome-terminal, my pgbench +runs tend to get throttled by gnome-terminal's lousy performance to no +more than 300 tps or so. Running with 2>/dev/null to throw away all the +detailed logging gives me 2-3x improvement in scores. Caveat: in my +case the db is on the local machine, so who knows what all the +interactions are. + +Also, when you initialized the pgbench db what scaling factor did you +use? And does running pgbench with -v improve performance at all? + +-- Mark + +On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> Joshua, +> +> Here is +> +> shared_buffers = 80000 +> fsync = on +> max_fsm_pages = 350000 +> max_connections = 1000 +> work_mem = 65536 +> effective_cache_size = 610000 +> random_page_cost = 3 +> +> Here is pgbench I used: +> +> pgbench -c 10 -t 10000 -d HQDB +> +> Thanks +> +> Marty +> +> -----Original Message----- +> From: Joshua D. Drake [mailto:jd@commandprompt.com] +> Sent: Monday, August 21, 2006 6:09 PM +> To: Marty Jia +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] How to get higher tps +> +> Marty Jia wrote: +> > I'm exhausted to try all performance tuning ideas, like following +> > parameters +> > +> > shared_buffers +> > fsync +> > max_fsm_pages +> > max_connections +> > shared_buffers +> > work_mem +> > max_fsm_pages +> > effective_cache_size +> > random_page_cost +> > +> > I believe all above have right size and values, but I just can not get +> +> > higher tps more than 300 testd by pgbench +> +> What values did you use? +> +> > +> > Here is our hardware +> > +> > +> > Dual Intel Xeon 2.8GHz +> > 6GB RAM +> > Linux 2.4 kernel +> > RedHat Enterprise Linux AS 3 +> > 200GB for PGDATA on 3Par, ext3 +> > 50GB for WAL on 3Par, ext3 +> > +> > With PostgreSql 8.1.4 +> > +> > We don't have i/o bottle neck. +> +> Are you sure? What does iostat say during a pgbench? What parameters are +> you passing to pgbench? +> +> Well in theory, upgrading to 2.6 kernel will help as well as making your +> WAL ext2 instead of ext3. +> +> > Whatelse I can try to better tps? Someone told me I can should get tps +> +> > over 1500, it is hard to believe. +> +> 1500? Hmmm... I don't know about that, I can get 470tps or so on my +> measily dual core 3800 with 2gig of ram though. +> +> Joshua D. Drake +> +> +> > +> > Thanks +> > +> > Marty +> > +> > ---------------------------(end of +> > broadcast)--------------------------- +> > TIP 2: Don't 'kill -9' the postmaster +> > +> +> + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:25:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8023B9FA50F + for ; + Tue, 22 Aug 2006 12:25:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 92369-08 for + ; + Tue, 22 Aug 2006 12:25:32 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from main.xsigo.com (nat0.xsigo.com [216.184.48.10]) + by postgresql.org (Postfix) with SMTP id 091979FA3AD + for ; + Tue, 22 Aug 2006 12:25:31 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Vacuum not identifying rows for removal.. +Date: Tue, 22 Aug 2006 08:25:30 -0700 +Message-ID: <9146E3EBBFBCC94D95F95A1C4065348A837AB5@exch01.xsigo.com> +In-Reply-To: <44EA6426.4020901@commandprompt.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Vacuum not identifying rows for removal.. +Thread-Index: AcbFjiExztGDNn6uRUm2+f7BXiW3UQAcHbpA +From: "Eamonn Kent" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/338 +X-Sequence-Number: 20523 + + +Hi Joshua, + +Thanks for the info...but, what I already have the backend id. I was +trying to get the process id of the client application. The client is +using libpq and running on the same workstation. We have approximately +22 different clients running and it would help to isolate the client +program that is causing the problem.=20 + +I was unable to locate the client using the backend server's process id +with lsof and netstat. Really the information should be there...since, +each (I believe) each backend postgreSQL server will service a single +client via a unix socket (in the case where they are collocated on a +unix workstation). + +Thanks + +Ike + + + +> Any ideas of how to identify the application process that is the +> postgres process (whose id I know). Perhaps I need to turn on a +> different log flag? + +select * from pg_stat_activity will give you the pid :) + +Joshua D. Drake + + +>=20 +>=20 +> Thanks +>=20 +> Ike +>=20 +>=20 +>=20 +>=20 +> -----Original Message----- +> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 +> Sent: Monday, August 21, 2006 2:06 PM +> To: Eamonn Kent +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Vacuum not identifying rows for removal..=20 +>=20 +> "Eamonn Kent" writes: +>> I am using PostgreSQL 8.1.4 for an embedded application. For some +>> reason, vacuum is not able to identify rows that are candidates for +>> removal (i.e., mark space as available). +>> ... +>> We run auto vacuum and I can see from the logs that it is running +> quite +>> frequently. When I run vacuum full from the psql, I can see that +space +>> is not being recovered. I have run vacuum full with the verbose flag +>> set, I can see that messages that indicate the existence of "dead row +>> versions that cannot be removed yet. +>=20 +> This means you've got an open transaction somewhere that could +> potentially still be able to see those rows. Look around for +> applications sitting "idle in transaction". +>=20 +> regards, tom lane +>=20 +> ---------------------------(end of +broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +>=20 + + +--=20 + + =3D=3D=3D The PostgreSQL Company: Command Prompt, Inc. =3D=3D=3D +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:26:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 49F2C9FB2EE + for ; + Tue, 22 Aug 2006 12:26:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 93829-02 for + ; + Tue, 22 Aug 2006 12:26:43 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 1CE709FB2FA + for ; + Tue, 22 Aug 2006 12:26:42 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Tue, 22 Aug 2006 15:26:41 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 22 Aug 2006 10:26:41 -0500 +Subject: Re: How to get higher tps +From: Scott Marlowe +To: Marty Jia +Cc: Mark Lewis , pgsql-performance@postgresql.org, + DBAs , Rich Wilson , + Ernest Wurzbach +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31DF@SITE3MAIL04.jeeves.ask.info> +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31DF@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156260401.7223.14.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Tue, 22 Aug 2006 10:26:41 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.086 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/339 +X-Sequence-Number: 20524 + +On Tue, 2006-08-22 at 08:16, Marty Jia wrote: +> Hi, Mark +> +> Thanks, here is our hardware info: +> +> RAID 10, using 3Par virtual volume technology across ~200 physical FC +> disks. 4 virtual disks for PGDATA, striped with LVM into one volume, 2 +> virtual disks for WAL, also striped. SAN attached with Qlogic SAN +> surfer multipathing to load balance each LUN on two 2GBs paths. HBAs +> are Qlogic 2340's. 16GB host cache on 3Par. + +A few points. + +Someone (Luke I think) posted that Linux's LVM has a throughput limit of +around 600 Megs/second. + +Why are you using multiple virtual disks on an LPAR? Did you try this +with just a single big virtual disk first to have something to compare +it to? I think your disk subsystem is overthought for an LPAR. If you +were running physical disks on a locally attached RAID card, it would be +a good idea. But here you're just adding layers of complexity for no +gain, and in fact may be heading backwards. + +I'd make two volumes on the LPAR, and let the LPAR do all the +virtualization for you. Put a couple disks in a mirror set for the +pg_xlog, format it ext2, and mount it noatime. Make another from a +dozen or so disks in an RAID 0 on top of RAID 1 (i.e. make a bunch of +mirror sets and stripe them into one big partition) and mount that for +PGDATA. Simplify, and get a baseline. Then, start mucking about to see +if you can get better performance. change ONE THING at a time, and only +one thing, and test it well. + +Got the latest and greatest drivers for the qlogic cards? + +I would suggest some component testing to make sure everything is +working well. bonnie++ and dd come to mind. + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:27:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D377D9FA3AD + for ; + Tue, 22 Aug 2006 12:27:18 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 34864-03 for + ; + Tue, 22 Aug 2006 15:27:01 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wr-out-0506.google.com (wr-out-0506.google.com + [64.233.184.232]) + by postgresql.org (Postfix) with ESMTP id 705D69FB2FA + for ; + Tue, 22 Aug 2006 12:27:00 -0300 (ADT) +Received: by wr-out-0506.google.com with SMTP id i31so409806wra + for ; + Tue, 22 Aug 2006 08:26:58 -0700 (PDT) +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:references; + b=YtwNAC6/+VqLLTM64rQ9LxwrYkP6Op66NWg9ueLN1EGm++dMhHdNhH6FvzjIUkMQ2mZMYYVfYiwWQJXj9VIgrzJVIpXhNlWcrZQKvGZ1+FlaVlAz7r9mYSR4qFmRsASnsz1NXj/nxrTljllhS1xCJj7SuGCabtdvZy+2/fmjAf4= +Received: by 10.90.71.12 with SMTP id t12mr538192aga; + Tue, 22 Aug 2006 08:26:58 -0700 (PDT) +Received: by 10.90.79.9 with HTTP; Tue, 22 Aug 2006 08:26:57 -0700 (PDT) +Message-ID: <33c6269f0608220826u1c2f44b3id8c6816a12f81912@mail.gmail.com> +Date: Tue, 22 Aug 2006 11:26:57 -0400 +From: "Alex Turner" +To: "Mark Lewis" +Subject: Re: How to get higher tps +Cc: "Marty Jia" , "Joshua D. Drake" , + pgsql-performance@postgresql.org, DBAs , + "Rich Wilson" , "Ernest Wurzbach" +In-Reply-To: <1156257109.9657.93.camel@archimedes> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_6971_20142034.1156260417658" +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31E1@SITE3MAIL04.jeeves.ask.info> + <1156257109.9657.93.camel@archimedes> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/340 +X-Sequence-Number: 20525 + +------=_Part_6971_20142034.1156260417658 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +First things first, run a bonnie++ benchmark, and post the numbers. That +will give a good indication of raw IO performance, and is often the first +inidication of problems separate from the DB. We have seen pretty bad +performance from SANs in the past. How many FC lines do you have running to +your server, remember each line is limited to about 200MB/sec, to get good +throughput, you will need multiple connections. + +When you run pgbench, run a iostat also and see what the numbers say. + +Alex. + +On 8/22/06, Mark Lewis wrote: +> +> Well, at least on my test machines running gnome-terminal, my pgbench +> runs tend to get throttled by gnome-terminal's lousy performance to no +> more than 300 tps or so. Running with 2>/dev/null to throw away all the +> detailed logging gives me 2-3x improvement in scores. Caveat: in my +> case the db is on the local machine, so who knows what all the +> interactions are. +> +> Also, when you initialized the pgbench db what scaling factor did you +> use? And does running pgbench with -v improve performance at all? +> +> -- Mark +> +> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> > Joshua, +> > +> > Here is +> > +> > shared_buffers = 80000 +> > fsync = on +> > max_fsm_pages = 350000 +> > max_connections = 1000 +> > work_mem = 65536 +> > effective_cache_size = 610000 +> > random_page_cost = 3 +> > +> > Here is pgbench I used: +> > +> > pgbench -c 10 -t 10000 -d HQDB +> > +> > Thanks +> > +> > Marty +> > +> > -----Original Message----- +> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +> > Sent: Monday, August 21, 2006 6:09 PM +> > To: Marty Jia +> > Cc: pgsql-performance@postgresql.org +> > Subject: Re: [PERFORM] How to get higher tps +> > +> > Marty Jia wrote: +> > > I'm exhausted to try all performance tuning ideas, like following +> > > parameters +> > > +> > > shared_buffers +> > > fsync +> > > max_fsm_pages +> > > max_connections +> > > shared_buffers +> > > work_mem +> > > max_fsm_pages +> > > effective_cache_size +> > > random_page_cost +> > > +> > > I believe all above have right size and values, but I just can not get +> > +> > > higher tps more than 300 testd by pgbench +> > +> > What values did you use? +> > +> > > +> > > Here is our hardware +> > > +> > > +> > > Dual Intel Xeon 2.8GHz +> > > 6GB RAM +> > > Linux 2.4 kernel +> > > RedHat Enterprise Linux AS 3 +> > > 200GB for PGDATA on 3Par, ext3 +> > > 50GB for WAL on 3Par, ext3 +> > > +> > > With PostgreSql 8.1.4 +> > > +> > > We don't have i/o bottle neck. +> > +> > Are you sure? What does iostat say during a pgbench? What parameters are +> > you passing to pgbench? +> > +> > Well in theory, upgrading to 2.6 kernel will help as well as making your +> > WAL ext2 instead of ext3. +> > +> > > Whatelse I can try to better tps? Someone told me I can should get tps +> > +> > > over 1500, it is hard to believe. +> > +> > 1500? Hmmm... I don't know about that, I can get 470tps or so on my +> > measily dual core 3800 with 2gig of ram though. +> > +> > Joshua D. Drake +> > +> > +> > > +> > > Thanks +> > > +> > > Marty +> > > +> > > ---------------------------(end of +> > > broadcast)--------------------------- +> > > TIP 2: Don't 'kill -9' the postmaster +> > > +> > +> > +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that your +> message can get through to the mailing list cleanly +> + +------=_Part_6971_20142034.1156260417658 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +First things first, run a bonnie++ benchmark, and post the numbers.  That will give a good indication of raw IO performance, and is often the first inidication of problems separate from the DB.  We have seen pretty bad performance from SANs in the past.  How many FC lines do you have running to your server, remember each line is limited to about 200MB/sec, to get good throughput, you will need multiple connections. +

When you run pgbench, run a iostat also and see what the numbers say.

Alex.

On 8/22/06, Mark Lewis < +mark.lewis@mir3.com> wrote:
Well, at least on my test machines running gnome-terminal, my pgbench +
runs tend to get throttled by gnome-terminal's lousy performance to no
more than 300 tps or so.  Running with 2>/dev/null to throw away all the
detailed logging gives me 2-3x improvement in scores.  Caveat: in my +
case the db is on the local machine, so who knows what all the
interactions are.

Also, when you initialized the pgbench db what scaling factor did you
use?  And does running pgbench with -v improve performance at all? +

-- Mark

On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote:
> Joshua,
>
> Here is
>
> shared_buffers = 80000
> fsync = on
> max_fsm_pages = 350000
> max_connections = 1000 +
> work_mem = 65536
> effective_cache_size = 610000
> random_page_cost = 3
>
> Here is pgbench I used:
>
> pgbench -c 10 -t 10000 -d HQDB
>
> Thanks
>
> Marty +
>
> -----Original Message-----
> From: Joshua D. Drake [mailto:jd@commandprompt.com]
> Sent: Monday, August 21, 2006 6:09 PM
> To: Marty Jia
> Cc: +pgsql-performance@postgresql.org
> Subject: Re: [PERFORM] How to get higher tps
>
> Marty Jia wrote:
> > I'm exhausted to try all performance tuning ideas, like following +
> > parameters
> >
> > shared_buffers
> > fsync
> > max_fsm_pages
> > max_connections
> > shared_buffers
> > work_mem
> > max_fsm_pages
+> > effective_cache_size
> > random_page_cost
> >
> > I believe all above have right size and values, but I just can not get
>
> > higher tps more than 300 testd by pgbench
+>
> What values did you use?
>
> >
> > Here is our hardware
> >
> >
> > Dual Intel Xeon 2.8GHz
> > 6GB RAM
> > Linux 2.4 kernel
> > RedHat Enterprise Linux AS 3 +
> > 200GB for PGDATA on 3Par, ext3
> > 50GB for WAL on 3Par, ext3
> >
> > With PostgreSql 8.1.4
> >
> > We don't have i/o bottle neck.
>
> Are you sure? What does iostat say during a pgbench? What parameters are +
> you passing to pgbench?
>
> Well in theory, upgrading to 2.6 kernel will help as well as making your
> WAL ext2 instead of ext3.
>
> > Whatelse I can try to better tps? Someone told me I can should get tps +
>
> > over 1500, it is hard to believe.
>
> 1500? Hmmm... I don't know about that, I can get 470tps or so on my
> measily dual core 3800 with 2gig of ram though.
>
> Joshua D. Drake +
>
>
> >
> > Thanks
> >
> > Marty
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 2: Don't 'kill -9' the postmaster +
> >
>
>

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to +majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly

+ +------=_Part_6971_20142034.1156260417658-- + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:27:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 460959FB2EE + for ; + Tue, 22 Aug 2006 12:27:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 36248-01 for + ; + Tue, 22 Aug 2006 15:27:28 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wr-out-0506.google.com (wr-out-0506.google.com + [64.233.184.232]) + by postgresql.org (Postfix) with ESMTP id 452409FA3AD + for ; + Tue, 22 Aug 2006 12:27:28 -0300 (ADT) +Received: by wr-out-0506.google.com with SMTP id i31so409806wra + for ; + Tue, 22 Aug 2006 08:27:28 -0700 (PDT) +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:references; + b=OeRYyDZcmmD0CUzNgRAcy5mg96Tzb3ckNEy9toGmx6LXYtwED5P3q3wqmznfbiIclXiRA2Dt89Tt3uKPUMHC7xlA6VEdZLOpRDBFcfWnGFc/wFmCvhWLcPB19CXW6XM8nLFrG6+EY2WpuJ8P3Ps+LAFYR4b85BCMGpg4rsK70Go= +Received: by 10.90.118.10 with SMTP id q10mr538441agc; + Tue, 22 Aug 2006 08:27:26 -0700 (PDT) +Received: by 10.90.79.9 with HTTP; Tue, 22 Aug 2006 08:27:26 -0700 (PDT) +Message-ID: <33c6269f0608220827i77f493d6rb321f29f4a44dccb@mail.gmail.com> +Date: Tue, 22 Aug 2006 11:27:26 -0400 +From: "Alex Turner" +To: "Mark Lewis" +Subject: Re: How to get higher tps +Cc: "Marty Jia" , "Joshua D. Drake" , + pgsql-performance@postgresql.org, DBAs , + "Rich Wilson" , "Ernest Wurzbach" +In-Reply-To: <33c6269f0608220826u1c2f44b3id8c6816a12f81912@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_6979_14209717.1156260446918" +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E31E1@SITE3MAIL04.jeeves.ask.info> + <1156257109.9657.93.camel@archimedes> + <33c6269f0608220826u1c2f44b3id8c6816a12f81912@mail.gmail.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=4.191 tagged_above=0 required=5 tests=HTML_30_40, + HTML_MESSAGE, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: **** +X-Archive-Number: 200608/341 +X-Sequence-Number: 20526 + +------=_Part_6979_14209717.1156260446918 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Oh - and it's usefull to know if you are CPU bound, or IO bound. Check top +or vmstat to get an idea of that + +Alex + +On 8/22/06, Alex Turner wrote: +> +> First things first, run a bonnie++ benchmark, and post the numbers. That +> will give a good indication of raw IO performance, and is often the first +> inidication of problems separate from the DB. We have seen pretty bad +> performance from SANs in the past. How many FC lines do you have running to +> your server, remember each line is limited to about 200MB/sec, to get good +> throughput, you will need multiple connections. +> +> When you run pgbench, run a iostat also and see what the numbers say. +> +> Alex. +> +> +> On 8/22/06, Mark Lewis < mark.lewis@mir3.com> wrote: +> > +> > Well, at least on my test machines running gnome-terminal, my pgbench +> > runs tend to get throttled by gnome-terminal's lousy performance to no +> > more than 300 tps or so. Running with 2>/dev/null to throw away all the +> > detailed logging gives me 2-3x improvement in scores. Caveat: in my +> > case the db is on the local machine, so who knows what all the +> > interactions are. +> > +> > Also, when you initialized the pgbench db what scaling factor did you +> > use? And does running pgbench with -v improve performance at all? +> > +> > -- Mark +> > +> > On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> > > Joshua, +> > > +> > > Here is +> > > +> > > shared_buffers = 80000 +> > > fsync = on +> > > max_fsm_pages = 350000 +> > > max_connections = 1000 +> > > work_mem = 65536 +> > > effective_cache_size = 610000 +> > > random_page_cost = 3 +> > > +> > > Here is pgbench I used: +> > > +> > > pgbench -c 10 -t 10000 -d HQDB +> > > +> > > Thanks +> > > +> > > Marty +> > > +> > > -----Original Message----- +> > > From: Joshua D. Drake [mailto:jd@commandprompt.com] +> > > Sent: Monday, August 21, 2006 6:09 PM +> > > To: Marty Jia +> > > Cc: pgsql-performance@postgresql.org +> > > Subject: Re: [PERFORM] How to get higher tps +> > > +> > > Marty Jia wrote: +> > > > I'm exhausted to try all performance tuning ideas, like following +> > > > parameters +> > > > +> > > > shared_buffers +> > > > fsync +> > > > max_fsm_pages +> > > > max_connections +> > > > shared_buffers +> > > > work_mem +> > > > max_fsm_pages +> > > > effective_cache_size +> > > > random_page_cost +> > > > +> > > > I believe all above have right size and values, but I just can not +> > get +> > > +> > > > higher tps more than 300 testd by pgbench +> > > +> > > What values did you use? +> > > +> > > > +> > > > Here is our hardware +> > > > +> > > > +> > > > Dual Intel Xeon 2.8GHz +> > > > 6GB RAM +> > > > Linux 2.4 kernel +> > > > RedHat Enterprise Linux AS 3 +> > > > 200GB for PGDATA on 3Par, ext3 +> > > > 50GB for WAL on 3Par, ext3 +> > > > +> > > > With PostgreSql 8.1.4 +> > > > +> > > > We don't have i/o bottle neck. +> > > +> > > Are you sure? What does iostat say during a pgbench? What parameters +> > are +> > > you passing to pgbench? +> > > +> > > Well in theory, upgrading to 2.6 kernel will help as well as making +> > your +> > > WAL ext2 instead of ext3. +> > > +> > > > Whatelse I can try to better tps? Someone told me I can should get +> > tps +> > > +> > > > over 1500, it is hard to believe. +> > > +> > > 1500? Hmmm... I don't know about that, I can get 470tps or so on my +> > > measily dual core 3800 with 2gig of ram though. +> > > +> > > Joshua D. Drake +> > > +> > > +> > > > +> > > > Thanks +> > > > +> > > > Marty +> > > > +> > > > ---------------------------(end of +> > > > broadcast)--------------------------- +> > > > TIP 2: Don't 'kill -9' the postmaster +> > > > +> > > +> > > +> > +> > ---------------------------(end of broadcast)--------------------------- +> > TIP 1: if posting/reading through Usenet, please send an appropriate +> > subscribe-nomail command to majordomo@postgresql.org so that your +> > message can get through to the mailing list cleanly +> > +> +> + +------=_Part_6979_14209717.1156260446918 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Oh - and it's usefull to know if you are CPU bound, or IO bound.  Check top or vmstat to get an idea of that

Alex

On 8/22/06, Alex Turner < +armtuk@gmail.com> wrote:
First things first, run a bonnie++ benchmark, and post the numbers.  That will give a good indication of raw IO performance, and is often the first inidication of problems separate from the DB.  We have seen pretty bad performance from SANs in the past.  How many FC lines do you have running to your server, remember each line is limited to about 200MB/sec, to get good throughput, you will need multiple connections. +

When you run pgbench, run a iostat also and see what the numbers say.

Alex.


On 8/22/06, +Mark Lewis < +mark.lewis@mir3.com> wrote:
Well, at least on my test machines running gnome-terminal, my pgbench +
runs tend to get throttled by gnome-terminal's lousy performance to no
more than 300 tps or so.  Running with 2>/dev/null to throw away all the
detailed logging gives me 2-3x improvement in scores.  Caveat: in my +
case the db is on the local machine, so who knows what all the
interactions are.

Also, when you initialized the pgbench db what scaling factor did you
use?  And does running pgbench with -v improve performance at all? +

-- Mark

On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote:
> Joshua,
>
> Here is
>
> shared_buffers = 80000
> fsync = on
> max_fsm_pages = 350000
> max_connections = 1000 +
> work_mem = 65536
> effective_cache_size = 610000
> random_page_cost = 3
>
> Here is pgbench I used:
>
> pgbench -c 10 -t 10000 -d HQDB
>
> Thanks
>
> Marty +
>
> -----Original Message-----
> From: Joshua D. Drake [mailto:jd@commandprompt.com]
+> Sent: Monday, August 21, 2006 6:09 PM
> To: Marty Jia
> Cc: +pgsql-performance@postgresql.org
> Subject: Re: [PERFORM] How to get higher tps
>
+> Marty Jia wrote:
> > I'm exhausted to try all performance tuning ideas, like following +
> > parameters
> >
> > shared_buffers
> > fsync
> > max_fsm_pages
> > max_connections
> > shared_buffers
> > work_mem
> > max_fsm_pages
+ +> > effective_cache_size
> > random_page_cost
> >
> > I believe all above have right size and values, but I just can not get
>
> > higher tps more than 300 testd by pgbench +
+>
> What values did you use?
>
> >
> > Here is our hardware
> >
> >
> > Dual Intel Xeon 2.8GHz
> > 6GB RAM
> > Linux 2.4 kernel
> > RedHat Enterprise Linux AS 3 +
> > 200GB for PGDATA on 3Par, ext3
> > 50GB for WAL on 3Par, ext3
> >
> > With PostgreSql 8.1.4
> >
> > We don't have i/o bottle neck.
>
> Are you sure? What does iostat say during a pgbench? What parameters are +
> you passing to pgbench?
>
> Well in theory, upgrading to 2.6 kernel will help as well as making your
> WAL ext2 instead of ext3.
>
> > Whatelse I can try to better tps? Someone told me I can should get tps +
>
> > over 1500, it is hard to believe.
>
> 1500? Hmmm... I don't know about that, I can get 470tps or so on my
> measily dual core 3800 with 2gig of ram though.
>
> Joshua D. Drake +
>
>
> >
> > Thanks
> >
> > Marty
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 2: Don't 'kill -9' the postmaster +
> >
>
>

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to + +majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly

+ +

+ +------=_Part_6979_14209717.1156260446918-- + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:30:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id BDDB69FA3AD + for ; + Tue, 22 Aug 2006 12:30:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 93516-06-3 + for ; + Tue, 22 Aug 2006 12:30:06 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id BA3F29FB38B + for ; + Tue, 22 Aug 2006 12:29:51 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 11:31:51 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E3293@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <1156257109.9657.93.camel@archimedes> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbF+AGOMg8lzqIyQH28X9Fjv1WJhAAB/nsw +From: "Marty Jia" +To: "Mark Lewis" +Cc: "Joshua D. Drake" , + , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.192 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/342 +X-Sequence-Number: 20527 + +The scaling factor is 20 +I used -v and 2>/dev/null, now I got=20 + +tps =3D 389.796376 (excluding connections establishing) + +This is best so far I can get + +Thanks=20 + +-----Original Message----- +From: Mark Lewis [mailto:mark.lewis@mir3.com]=20 +Sent: Tuesday, August 22, 2006 10:32 AM +To: Marty Jia +Cc: Joshua D. Drake; pgsql-performance@postgresql.org; DBAs; Rich +Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + +Well, at least on my test machines running gnome-terminal, my pgbench +runs tend to get throttled by gnome-terminal's lousy performance to no +more than 300 tps or so. Running with 2>/dev/null to throw away all the +detailed logging gives me 2-3x improvement in scores. Caveat: in my +case the db is on the local machine, so who knows what all the +interactions are. + +Also, when you initialized the pgbench db what scaling factor did you +use? And does running pgbench with -v improve performance at all? + +-- Mark + +On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> Joshua, +>=20 +> Here is +>=20 +> shared_buffers =3D 80000 +> fsync =3D on +> max_fsm_pages =3D 350000 +> max_connections =3D 1000 +> work_mem =3D 65536 +> effective_cache_size =3D 610000 +> random_page_cost =3D 3 +> =20 +> Here is pgbench I used: +>=20 +> pgbench -c 10 -t 10000 -d HQDB +>=20 +> Thanks +>=20 +> Marty +>=20 +> -----Original Message----- +> From: Joshua D. Drake [mailto:jd@commandprompt.com] +> Sent: Monday, August 21, 2006 6:09 PM +> To: Marty Jia +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] How to get higher tps +>=20 +> Marty Jia wrote: +> > I'm exhausted to try all performance tuning ideas, like following=20 +> > parameters +> >=20 +> > shared_buffers +> > fsync +> > max_fsm_pages +> > max_connections +> > shared_buffers +> > work_mem +> > max_fsm_pages +> > effective_cache_size +> > random_page_cost +> >=20 +> > I believe all above have right size and values, but I just can not=20 +> > get +>=20 +> > higher tps more than 300 testd by pgbench +>=20 +> What values did you use? +>=20 +> >=20 +> > Here is our hardware +> >=20 +> >=20 +> > Dual Intel Xeon 2.8GHz +> > 6GB RAM +> > Linux 2.4 kernel +> > RedHat Enterprise Linux AS 3 +> > 200GB for PGDATA on 3Par, ext3 +> > 50GB for WAL on 3Par, ext3 +> >=20 +> > With PostgreSql 8.1.4 +> >=20 +> > We don't have i/o bottle neck.=20 +>=20 +> Are you sure? What does iostat say during a pgbench? What parameters=20 +> are you passing to pgbench? +>=20 +> Well in theory, upgrading to 2.6 kernel will help as well as making=20 +> your WAL ext2 instead of ext3. +>=20 +> > Whatelse I can try to better tps? Someone told me I can should get=20 +> > tps +>=20 +> > over 1500, it is hard to believe. +>=20 +> 1500? Hmmm... I don't know about that, I can get 470tps or so on my=20 +> measily dual core 3800 with 2gig of ram though. +>=20 +> Joshua D. Drake +>=20 +>=20 +> >=20 +> > Thanks +> >=20 +> > Marty +> >=20 +> > ---------------------------(end of +> > broadcast)--------------------------- +> > TIP 2: Don't 'kill -9' the postmaster +> >=20 +>=20 +>=20 + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:42:38 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CFEFC9FB1CB + for ; + Tue, 22 Aug 2006 12:42:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 94914-04 for + ; + Tue, 22 Aug 2006 12:42:22 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id 212919FA69A + for ; + Tue, 22 Aug 2006 12:42:21 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_001_01C6C601.D62D90A4" +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 11:44:21 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E32A5@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <33c6269f0608220827i77f493d6rb321f29f4a44dccb@mail.gmail.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbF/8PSFZ0T4k8mRLOzl/R8ML86sQAAeGLQ +From: "Marty Jia" +To: "Alex Turner" , + "Mark Lewis" +Cc: "Joshua D. Drake" , + , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.128 tagged_above=0 required=5 tests=AWL, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/343 +X-Sequence-Number: 20528 + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01C6C601.D62D90A4 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +----------- Here is vmstat + +procs memory swap io system +cpu + r b swpd free buff cache si so bi bo in cs us sy +id wa + 0 1 15416 18156 73372 4348488 1 1 3 2 4 1 2 +1 2 2 +=20 +=20 +----------- Here is iostat +=20 +avg-cpu: %user %nice %sys %iowait %idle + 11.59 0.00 6.13 10.77 71.50 +=20 +Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +sda 2.76 6.88 36.35 16036474 84688320 +sda1 0.00 0.01 0.00 30100 1056 +sda2 0.27 2.36 1.72 5509296 4017224 +sda3 1.85 0.78 21.99 1819850 51242800 +sda4 0.00 0.00 0.00 20 0 +sda5 0.15 0.49 1.47 1131624 3425672 +sda6 0.49 3.14 11.12 7320616 25899088 +sda7 0.01 0.09 0.04 219960 102480 +sdb 2.75 6.78 36.35 15803532 84688320 +sdb1 0.00 0.01 0.00 24322 1056 +sdb2 0.27 2.31 1.72 5391682 4017224 +sdb3 1.84 0.79 21.99 1836088 51242800 +sdb4 0.00 0.00 0.00 20 0 +sdb5 0.15 0.49 1.47 1134546 3425672 +sdb6 0.49 3.12 11.12 7273816 25899088 +sdb7 0.01 0.06 0.04 138138 102480 +sdc 0.00 0.00 0.00 632 0 +sdd 0.00 0.00 0.00 80 0 +sde 0.00 0.00 0.00 80 0 +sdf 0.00 0.00 0.00 80 0 +sdg 0.00 0.00 0.00 112 0 +sdh 0.00 0.00 0.00 112 0 +sdi 139.89 680.59 839.42 1585722266 1955771032 +sdj 139.72 680.21 835.90 1584829368 1947590800 +sdk 139.82 680.30 840.74 1585053608 1958864880 +sdl 139.86 680.56 841.26 1585657408 1960079576 +sdm 54.80 6.67 891.38 15547618 2076836720 +sdn 54.71 6.66 891.35 15509096 2076776352 +=20 +=20 +=20 +=20 + +=20 +________________________________ + +From: Alex Turner [mailto:armtuk@gmail.com]=20 +Sent: Tuesday, August 22, 2006 11:27 AM +To: Mark Lewis +Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + + +Oh - and it's usefull to know if you are CPU bound, or IO bound. Check +top or vmstat to get an idea of that + +Alex + + +On 8/22/06, Alex Turner < armtuk@gmail.com > +wrote:=20 + + First things first, run a bonnie++ benchmark, and post the +numbers. That will give a good indication of raw IO performance, and is +often the first inidication of problems separate from the DB. We have +seen pretty bad performance from SANs in the past. How many FC lines do +you have running to your server, remember each line is limited to about +200MB/sec, to get good throughput, you will need multiple connections.=20 +=09 + When you run pgbench, run a iostat also and see what the numbers +say. +=09 +=09 + Alex. +=09 +=09 +=09 + On 8/22/06, Mark Lewis < mark.lewis@mir3.com + > wrote:=20 + + Well, at least on my test machines running +gnome-terminal, my pgbench=20 + runs tend to get throttled by gnome-terminal's lousy +performance to no + more than 300 tps or so. Running with 2>/dev/null to +throw away all the + detailed logging gives me 2-3x improvement in scores. +Caveat: in my=20 + case the db is on the local machine, so who knows what +all the + interactions are. + =09 + Also, when you initialized the pgbench db what scaling +factor did you + use? And does running pgbench with -v improve +performance at all?=20 + =09 + -- Mark + =09 + On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: + > Joshua, + > + > Here is + > + > shared_buffers =3D 80000 + > fsync =3D on + > max_fsm_pages =3D 350000 + > max_connections =3D 1000=20 + > work_mem =3D 65536 + > effective_cache_size =3D 610000 + > random_page_cost =3D 3 + > + > Here is pgbench I used: + > + > pgbench -c 10 -t 10000 -d HQDB + > + > Thanks + > + > Marty=20 + > + > -----Original Message----- + > From: Joshua D. Drake [mailto:jd@commandprompt.com] + > Sent: Monday, August 21, 2006 6:09 PM + > To: Marty Jia + > Cc: pgsql-performance@postgresql.org + > Subject: Re: [PERFORM] How to get higher tps + > + > Marty Jia wrote: + > > I'm exhausted to try all performance tuning ideas, +like following=20 + > > parameters + > > + > > shared_buffers + > > fsync + > > max_fsm_pages + > > max_connections + > > shared_buffers + > > work_mem + > > max_fsm_pages + > > effective_cache_size + > > random_page_cost + > > + > > I believe all above have right size and values, but +I just can not get + > + > > higher tps more than 300 testd by pgbench=20 + > + > What values did you use? + > + > > + > > Here is our hardware + > > + > > + > > Dual Intel Xeon 2.8GHz + > > 6GB RAM + > > Linux 2.4 kernel + > > RedHat Enterprise Linux AS 3=20 + > > 200GB for PGDATA on 3Par, ext3 + > > 50GB for WAL on 3Par, ext3 + > > + > > With PostgreSql 8.1.4 + > > + > > We don't have i/o bottle neck. + > + > Are you sure? What does iostat say during a pgbench? +What parameters are=20 + > you passing to pgbench? + > + > Well in theory, upgrading to 2.6 kernel will help as +well as making your + > WAL ext2 instead of ext3. + > + > > Whatelse I can try to better tps? Someone told me I +can should get tps=20 + > + > > over 1500, it is hard to believe. + > + > 1500? Hmmm... I don't know about that, I can get +470tps or so on my + > measily dual core 3800 with 2gig of ram though. + > + > Joshua D. Drake=20 + > + > + > > + > > Thanks + > > + > > Marty + > > + > > ---------------------------(end of + > > broadcast)--------------------------- + > > TIP 2: Don't 'kill -9' the postmaster=20 + > > + > + > + =09 + ---------------------------(end of +broadcast)--------------------------- + TIP 1: if posting/reading through Usenet, please send an +appropriate + subscribe-nomail command to +majordomo@postgresql.org so that your + message can get through to the mailing list +cleanly + =09 + + + + +------_=_NextPart_001_01C6C601.D62D90A4 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + + + +
+
----------- Here is = +vmstat
+
procs       = +;            = +  =20 +memory     =20 +swap         =20 +io    =20 +system         = +cpu
 r =20 +b   swpd   free   buff  = +cache  =20 +si   so    bi    bo  =20 +in    cs us sy id wa
 0  1  15416  = + +18156  73372 4348488    1   =20 +1     3     2   =20 +4     1  2  1  2  = +2
+
 
+
 
= + +
----------- Here  is = +iostat
+
 
+
avg-cpu: =20 +%user   %nice    %sys %iowait  =20 +%idle
         =20 +11.59    0.00    6.13  =20 +10.77   71.50
+
 
+
Device:         &nb= +sp; =20 +tps   Blk_read/s   Blk_wrtn/s  =20 +Blk_read  =20 +Blk_wrtn
sda         &nbs= +p;    =20 +2.76        =20 +6.88        36.35  =20 +16036474  =20 +84688320
sda1         &nb= +sp;   =20 +0.00        =20 +0.01        =20 +0.00      = +30100      =20 +1056
sda2          &= +nbsp;  =20 +0.27        =20 +2.36         = +1.72   =20 +5509296   =20 +4017224
sda3         &nbs= +p;   =20 +1.85        =20 +0.78        21.99   =20 +1819850  =20 +51242800
sda4         &nb= +sp;   =20 +0.00        =20 +0.00        =20 +0.00        =20 +20         =20 +0
sda5          &nbs= +p;  =20 +0.15        =20 +0.49         = +1.47   =20 +1131624   =20 +3425672
sda6         &nbs= +p;   =20 +0.49        =20 +3.14        11.12   =20 +7320616  =20 +25899088
sda7         &nb= +sp;   =20 +0.01        =20 +0.09        =20 +0.04     219960    =20 +102480
sdb          = +    =20 +2.75        =20 +6.78        36.35  =20 +15803532  =20 +84688320
sdb1         &nb= +sp;   =20 +0.00        =20 +0.01        =20 +0.00      = +24322      =20 +1056
sdb2          &= +nbsp;  =20 +0.27        =20 +2.31         = +1.72   =20 +5391682   =20 +4017224
sdb3         &nbs= +p;   =20 +1.84        =20 +0.79        21.99   =20 +1836088  =20 +51242800
sdb4         &nb= +sp;   =20 +0.00        =20 +0.00        =20 +0.00        =20 +20         =20 +0
sdb5          &nbs= +p;  =20 +0.15        =20 +0.49         = +1.47   =20 +1134546   =20 +3425672
sdb6         &nbs= +p;   =20 +0.49        =20 +3.12        11.12   =20 +7273816  =20 +25899088
sdb7         &nb= +sp;   =20 +0.01        =20 +0.06        =20 +0.04     138138    =20 +102480
sdc          = +    =20 +0.00        =20 +0.00        =20 +0.00       =20 +632         =20 +0
sdd           = +;   =20 +0.00        =20 +0.00        =20 +0.00        =20 +80         =20 +0
sde           = +;   =20 +0.00        =20 +0.00        =20 +0.00        =20 +80         =20 +0
sdf           = +;   =20 +0.00        =20 +0.00        =20 +0.00        =20 +80         =20 +0
sdg           = +;   =20 +0.00        =20 +0.00        =20 +0.00       =20 +112         =20 +0
sdh           = +;   =20 +0.00        =20 +0.00        =20 +0.00       =20 +112         =20 +0
sdi           = +; =20 +139.89      =20 +680.59       839.42 1585722266=20 +1955771032
sdj         &n= +bsp;  =20 +139.72      =20 +680.21       835.90 1584829368=20 +1947590800
sdk         &n= +bsp;  =20 +139.82      =20 +680.30       840.74 1585053608=20 +1958864880
sdl         &n= +bsp;  =20 +139.86      =20 +680.56       841.26 1585657408=20 +1960079576
sdm         &n= +bsp;   =20 +54.80        =20 +6.67       891.38   15547618=20 +2076836720
sdn         &n= +bsp;   =20 +54.71        =20 +6.66       891.35   15509096=20 +2076776352
+
 
+
 
+
 
+
 
+

 
+
+
+From: Alex Turner = +[mailto:armtuk@gmail.com]=20 +
Sent: Tuesday, August 22, 2006 11:27 AM
To: Mark=20 +Lewis
Cc: Marty Jia; Joshua D. Drake;=20 +pgsql-performance@postgresql.org; DBAs; Rich Wilson; Ernest=20 +Wurzbach
Subject: Re: [PERFORM] How to get higher=20 +tps

+
Oh - and it's usefull to know if you are CPU bound, or IO=20 +bound.  Check top or vmstat to get an idea of = +that

Alex

+
On 8/22/06, Alex=20 +Turner < = +armtuk@gmail.com>=20 +wrote: +
+
First things first, run a bonnie++ benchmark, and post the = +numbers. =20 + That will give a good indication of raw IO performance, and is often = +the first=20 + inidication of problems separate from the DB.  We have seen = +pretty bad=20 + performance from SANs in the past.  How many FC lines do you have = +running=20 + to your server, remember each line is limited to about 200MB/sec, to = +get good=20 + throughput, you will need multiple connections.

When you run = +pgbench,=20 + run a iostat also and see what the numbers say.
+

Alex.
+


+
On 8/22/06, Mark=20 + Lewis < = +mark.lewis@mir3.com>=20 + wrote: +
Well,=20 + at least on my test machines running gnome-terminal, my pgbench = +
runs=20 + tend to get throttled by gnome-terminal's lousy performance to = +no
more=20 + than 300 tps or so.  Running with 2>/dev/null to throw = +away all=20 + the
detailed logging gives me 2-3x improvement in=20 + scores.  Caveat: in my
case the db is on the local = +machine, so=20 + who knows what all the
interactions are.

Also, when you=20 + initialized the pgbench db what scaling factor did=20 + you
use?  And does running pgbench with -v improve = +performance=20 + at all?

-- Mark

On Tue, 2006-08-22 at 09:19 -0400, = +Marty Jia=20 + wrote:
> Joshua,
>
> Here is
>
>=20 + shared_buffers =3D 80000
> fsync =3D on
> max_fsm_pages = +=3D=20 + 350000
> max_connections =3D 1000
> work_mem =3D = +65536
>=20 + effective_cache_size =3D 610000
> random_page_cost =3D = +3
>
>=20 + Here is pgbench I used:
>
> pgbench -c 10 -t 10000 -d=20 + HQDB
>
> Thanks
>
> Marty
>
>=20 + -----Original Message-----
> From: Joshua D. Drake [mailto:jd@commandprompt.com]
> Sent: Monday, = +August 21,=20 + 2006 6:09 PM
> To: Marty Jia
> Cc: pgsql-performance@postgresql.org
> = +Subject: Re:=20 + [PERFORM] How to get higher tps
>
> Marty Jia = +wrote:
>=20 + > I'm exhausted to try all performance tuning ideas, like = +following=20 +
> > parameters
> >
> > = +shared_buffers
>=20 + > fsync
> > max_fsm_pages
> > = +max_connections
>=20 + > shared_buffers
> > work_mem
> > = +max_fsm_pages
>=20 + > effective_cache_size
> > random_page_cost
> = +>
>=20 + > I believe all above have right size and values, but I just can = +not=20 + get
>
> > higher tps more than 300 testd by pgbench=20 +
>
> What values did you use?
>
> = +>
> >=20 + Here is our hardware
> >
> >
> > Dual = +Intel Xeon=20 + 2.8GHz
> > 6GB RAM
> > Linux 2.4 kernel
> = +>=20 + RedHat Enterprise Linux AS 3
> > 200GB for PGDATA on 3Par, = + + ext3
> > 50GB for WAL on 3Par, ext3
> >
> = +> With=20 + PostgreSql 8.1.4
> >
> > We don't have i/o bottle=20 + neck.
>
> Are you sure? What does iostat say during a = +pgbench?=20 + What parameters are
> you passing to pgbench?
>
> = +Well in=20 + theory, upgrading to 2.6 kernel will help as well as making = +your
> WAL=20 + ext2 instead of ext3.
>
> > Whatelse I can try to = +better tps?=20 + Someone told me I can should get tps
>
> > over = +1500, it is=20 + hard to believe.
>
> 1500? Hmmm... I don't know about = +that, I=20 + can get 470tps or so on my
> measily dual core 3800 with 2gig = +of ram=20 + though.
>
> Joshua D. Drake
>
>
>=20 + >
> > Thanks
> >
> > Marty
>=20 + >
> > ---------------------------(end of
> >=20 + broadcast)---------------------------
> > TIP 2: Don't = +'kill -9'=20 + the postmaster
>=20 + >
>
>

---------------------------(end of=20 + broadcast)---------------------------
TIP 1: if posting/reading = +through=20 + Usenet, please send an = +appropriate
      =20 + subscribe-nomail command to majordomo@postgresql.org so that=20 + your
       message can get through = +to the=20 + mailing list=20 +cleanly


+ +------_=_NextPart_001_01C6C601.D62D90A4-- + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:44:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E45D99FB1CF + for ; + Tue, 22 Aug 2006 12:44:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 96197-01 for + ; + Tue, 22 Aug 2006 12:44:35 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id 994709FB1CB + for ; + Tue, 22 Aug 2006 12:44:34 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_001_01C6C602.25222CB8" +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 11:46:34 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E32A7@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <33c6269f0608220827i77f493d6rb321f29f4a44dccb@mail.gmail.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbF/8PSFZ0T4k8mRLOzl/R8ML86sQAAlS9g +From: "Marty Jia" +To: "Alex Turner" , + "Mark Lewis" +Cc: "Joshua D. Drake" , + , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.11 tagged_above=0 required=5 tests=AWL, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/344 +X-Sequence-Number: 20529 + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01C6C602.25222CB8 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Here is iostat when running pgbench: +=20 +avg-cpu: %user %nice %sys %iowait %idle + 26.17 0.00 8.25 23.17 42.42 +=20 +Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +sda 0.00 0.00 0.00 0 0 +sda1 0.00 0.00 0.00 0 0 +sda2 0.00 0.00 0.00 0 0 +sda3 0.00 0.00 0.00 0 0 +sda4 0.00 0.00 0.00 0 0 +sda5 0.00 0.00 0.00 0 0 +sda6 0.00 0.00 0.00 0 0 +sda7 0.00 0.00 0.00 0 0 +sdb 0.00 0.00 0.00 0 0 +sdb1 0.00 0.00 0.00 0 0 +sdb2 0.00 0.00 0.00 0 0 +sdb3 0.00 0.00 0.00 0 0 +sdb4 0.00 0.00 0.00 0 0 +sdb5 0.00 0.00 0.00 0 0 +sdb6 0.00 0.00 0.00 0 0 +sdb7 0.00 0.00 0.00 0 0 +sdc 0.00 0.00 0.00 0 0 +sdd 0.00 0.00 0.00 0 0 +sde 0.00 0.00 0.00 0 0 +sdf 0.00 0.00 0.00 0 0 +sdg 0.00 0.00 0.00 0 0 +sdh 0.00 0.00 0.00 0 0 +sdi 40.33 0.00 413.33 0 1240 +sdj 34.33 0.00 394.67 0 1184 +sdk 36.00 0.00 410.67 0 1232 +sdl 37.00 0.00 429.33 0 1288 +sdm 375.00 0.00 3120.00 0 9360 +sdn 378.33 0.00 3120.00 0 9360 + +________________________________ + +From: Alex Turner [mailto:armtuk@gmail.com]=20 +Sent: Tuesday, August 22, 2006 11:27 AM +To: Mark Lewis +Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + + +Oh - and it's usefull to know if you are CPU bound, or IO bound. Check +top or vmstat to get an idea of that + +Alex + + +On 8/22/06, Alex Turner < armtuk@gmail.com > +wrote:=20 + + First things first, run a bonnie++ benchmark, and post the +numbers. That will give a good indication of raw IO performance, and is +often the first inidication of problems separate from the DB. We have +seen pretty bad performance from SANs in the past. How many FC lines do +you have running to your server, remember each line is limited to about +200MB/sec, to get good throughput, you will need multiple connections.=20 +=09 + When you run pgbench, run a iostat also and see what the numbers +say. +=09 +=09 + Alex. +=09 +=09 +=09 + On 8/22/06, Mark Lewis < mark.lewis@mir3.com + > wrote:=20 + + Well, at least on my test machines running +gnome-terminal, my pgbench=20 + runs tend to get throttled by gnome-terminal's lousy +performance to no + more than 300 tps or so. Running with 2>/dev/null to +throw away all the + detailed logging gives me 2-3x improvement in scores. +Caveat: in my=20 + case the db is on the local machine, so who knows what +all the + interactions are. + =09 + Also, when you initialized the pgbench db what scaling +factor did you + use? And does running pgbench with -v improve +performance at all?=20 + =09 + -- Mark + =09 + On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: + > Joshua, + > + > Here is + > + > shared_buffers =3D 80000 + > fsync =3D on + > max_fsm_pages =3D 350000 + > max_connections =3D 1000=20 + > work_mem =3D 65536 + > effective_cache_size =3D 610000 + > random_page_cost =3D 3 + > + > Here is pgbench I used: + > + > pgbench -c 10 -t 10000 -d HQDB + > + > Thanks + > + > Marty=20 + > + > -----Original Message----- + > From: Joshua D. Drake [mailto:jd@commandprompt.com] + > Sent: Monday, August 21, 2006 6:09 PM + > To: Marty Jia + > Cc: pgsql-performance@postgresql.org + > Subject: Re: [PERFORM] How to get higher tps + > + > Marty Jia wrote: + > > I'm exhausted to try all performance tuning ideas, +like following=20 + > > parameters + > > + > > shared_buffers + > > fsync + > > max_fsm_pages + > > max_connections + > > shared_buffers + > > work_mem + > > max_fsm_pages + > > effective_cache_size + > > random_page_cost + > > + > > I believe all above have right size and values, but +I just can not get + > + > > higher tps more than 300 testd by pgbench=20 + > + > What values did you use? + > + > > + > > Here is our hardware + > > + > > + > > Dual Intel Xeon 2.8GHz + > > 6GB RAM + > > Linux 2.4 kernel + > > RedHat Enterprise Linux AS 3=20 + > > 200GB for PGDATA on 3Par, ext3 + > > 50GB for WAL on 3Par, ext3 + > > + > > With PostgreSql 8.1.4 + > > + > > We don't have i/o bottle neck. + > + > Are you sure? What does iostat say during a pgbench? +What parameters are=20 + > you passing to pgbench? + > + > Well in theory, upgrading to 2.6 kernel will help as +well as making your + > WAL ext2 instead of ext3. + > + > > Whatelse I can try to better tps? Someone told me I +can should get tps=20 + > + > > over 1500, it is hard to believe. + > + > 1500? Hmmm... I don't know about that, I can get +470tps or so on my + > measily dual core 3800 with 2gig of ram though. + > + > Joshua D. Drake=20 + > + > + > > + > > Thanks + > > + > > Marty + > > + > > ---------------------------(end of + > > broadcast)--------------------------- + > > TIP 2: Don't 'kill -9' the postmaster=20 + > > + > + > + =09 + ---------------------------(end of +broadcast)--------------------------- + TIP 1: if posting/reading through Usenet, please send an +appropriate + subscribe-nomail command to +majordomo@postgresql.org so that your + message can get through to the mailing list +cleanly + =09 + + + + +------_=_NextPart_001_01C6C602.25222CB8 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + + + +
Here is iostat when running = +pgbench:
+
 
+
avg-cpu:  %user   = +%nice   =20 +%sys %iowait  =20 +%idle
         =20 +26.17    0.00    8.25  =20 +23.17   42.42
+
 
+
Device:         &nb= +sp; =20 +tps   Blk_read/s   Blk_wrtn/s  =20 +Blk_read  =20 +Blk_wrtn
sda         &nbs= +p;    =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda1          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda2          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda3          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda4          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda5          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda6          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sda7          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb1          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb2          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb3          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb4          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb5          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb6          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdb7          &nbs= +p;  =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdc           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdd           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sde           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdf           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdg           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdh           = +;   =20 +0.00        =20 +0.00        =20 +0.00         =20 +0         =20 +0
sdi           = +;  =20 +40.33        =20 +0.00      =20 +413.33         =20 +0      =20 +1240
sdj          &n= +bsp;  =20 +34.33        =20 +0.00      =20 +394.67         =20 +0      =20 +1184
sdk          &n= +bsp;  =20 +36.00        =20 +0.00      =20 +410.67         =20 +0      =20 +1232
sdl          &n= +bsp;  =20 +37.00        =20 +0.00      =20 +429.33         =20 +0      =20 +1288
sdm          &n= +bsp; =20 +375.00        =20 +0.00     =20 +3120.00         =20 +0      =20 +9360
sdn          &n= +bsp; =20 +378.33        =20 +0.00     =20 +3120.00         =20 +0       9360

+
+
+From: Alex Turner = +[mailto:armtuk@gmail.com]=20 +
Sent: Tuesday, August 22, 2006 11:27 AM
To: Mark=20 +Lewis
Cc: Marty Jia; Joshua D. Drake;=20 +pgsql-performance@postgresql.org; DBAs; Rich Wilson; Ernest=20 +Wurzbach
Subject: Re: [PERFORM] How to get higher=20 +tps

+
Oh - and it's usefull to know if you are CPU bound, or IO=20 +bound.  Check top or vmstat to get an idea of = +that

Alex

+
On 8/22/06, Alex=20 +Turner < = +armtuk@gmail.com>=20 +wrote: +
+
First things first, run a bonnie++ benchmark, and post the = +numbers. =20 + That will give a good indication of raw IO performance, and is often = +the first=20 + inidication of problems separate from the DB.  We have seen = +pretty bad=20 + performance from SANs in the past.  How many FC lines do you have = +running=20 + to your server, remember each line is limited to about 200MB/sec, to = +get good=20 + throughput, you will need multiple connections.

When you run = +pgbench,=20 + run a iostat also and see what the numbers say.
+

Alex.
+


+
On 8/22/06, Mark=20 + Lewis < = +mark.lewis@mir3.com>=20 + wrote: +
Well,=20 + at least on my test machines running gnome-terminal, my pgbench = +
runs=20 + tend to get throttled by gnome-terminal's lousy performance to = +no
more=20 + than 300 tps or so.  Running with 2>/dev/null to throw = +away all=20 + the
detailed logging gives me 2-3x improvement in=20 + scores.  Caveat: in my
case the db is on the local = +machine, so=20 + who knows what all the
interactions are.

Also, when you=20 + initialized the pgbench db what scaling factor did=20 + you
use?  And does running pgbench with -v improve = +performance=20 + at all?

-- Mark

On Tue, 2006-08-22 at 09:19 -0400, = +Marty Jia=20 + wrote:
> Joshua,
>
> Here is
>
>=20 + shared_buffers =3D 80000
> fsync =3D on
> max_fsm_pages = +=3D=20 + 350000
> max_connections =3D 1000
> work_mem =3D = +65536
>=20 + effective_cache_size =3D 610000
> random_page_cost =3D = +3
>
>=20 + Here is pgbench I used:
>
> pgbench -c 10 -t 10000 -d=20 + HQDB
>
> Thanks
>
> Marty
>
>=20 + -----Original Message-----
> From: Joshua D. Drake [mailto:jd@commandprompt.com]
> Sent: Monday, = +August 21,=20 + 2006 6:09 PM
> To: Marty Jia
> Cc: pgsql-performance@postgresql.org
> = +Subject: Re:=20 + [PERFORM] How to get higher tps
>
> Marty Jia = +wrote:
>=20 + > I'm exhausted to try all performance tuning ideas, like = +following=20 +
> > parameters
> >
> > = +shared_buffers
>=20 + > fsync
> > max_fsm_pages
> > = +max_connections
>=20 + > shared_buffers
> > work_mem
> > = +max_fsm_pages
>=20 + > effective_cache_size
> > random_page_cost
> = +>
>=20 + > I believe all above have right size and values, but I just can = +not=20 + get
>
> > higher tps more than 300 testd by pgbench=20 +
>
> What values did you use?
>
> = +>
> >=20 + Here is our hardware
> >
> >
> > Dual = +Intel Xeon=20 + 2.8GHz
> > 6GB RAM
> > Linux 2.4 kernel
> = +>=20 + RedHat Enterprise Linux AS 3
> > 200GB for PGDATA on 3Par, = + + ext3
> > 50GB for WAL on 3Par, ext3
> >
> = +> With=20 + PostgreSql 8.1.4
> >
> > We don't have i/o bottle=20 + neck.
>
> Are you sure? What does iostat say during a = +pgbench?=20 + What parameters are
> you passing to pgbench?
>
> = +Well in=20 + theory, upgrading to 2.6 kernel will help as well as making = +your
> WAL=20 + ext2 instead of ext3.
>
> > Whatelse I can try to = +better tps?=20 + Someone told me I can should get tps
>
> > over = +1500, it is=20 + hard to believe.
>
> 1500? Hmmm... I don't know about = +that, I=20 + can get 470tps or so on my
> measily dual core 3800 with 2gig = +of ram=20 + though.
>
> Joshua D. Drake
>
>
>=20 + >
> > Thanks
> >
> > Marty
>=20 + >
> > ---------------------------(end of
> >=20 + broadcast)---------------------------
> > TIP 2: Don't = +'kill -9'=20 + the postmaster
>=20 + >
>
>

---------------------------(end of=20 + broadcast)---------------------------
TIP 1: if posting/reading = +through=20 + Usenet, please send an = +appropriate
      =20 + subscribe-nomail command to majordomo@postgresql.org so that=20 + your
       message can get through = +to the=20 + mailing list=20 +cleanly


+ +------_=_NextPart_001_01C6C602.25222CB8-- + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:47:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 024EF9FB1CF + for ; + Tue, 22 Aug 2006 12:47:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 47367-01 for + ; + Tue, 22 Aug 2006 15:47:31 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 315139FB1CB + for ; + Tue, 22 Aug 2006 12:47:31 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from elasmtp-dupuy.atl.sa.earthlink.net + (elasmtp-dupuy.atl.sa.earthlink.net [209.86.89.62]) + by svr4.postgresql.org (Postfix) with ESMTP id A79475AF028 + for ; + Tue, 22 Aug 2006 15:47:30 +0000 (GMT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; + d=earthlink.net; + b=AVNyAdYId7tHOiyHloxqqnxijYrUd/iHVzdP8tD7lT8dw0+Po7r81KY8LRAys/P4; + h=Received:Message-Id:X-Mailer:Date:To:From:Subject:Cc:In-Reply-To:References:Mime-Version:Content-Type:X-ELNK-Trace:X-Originating-IP; +Received: from [71.243.17.205] (helo=rpeace101.earthlink.net) + by elasmtp-dupuy.atl.sa.earthlink.net with asmtp (TLSv1:AES256-SHA:256) + (Exim 4.34) id 1GFYTP-0008EI-GC; Tue, 22 Aug 2006 11:47:27 -0400 +Message-Id: <7.0.1.0.2.20060822111857.038f6838@earthlink.net> +X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 +Date: Tue, 22 Aug 2006 11:47:13 -0400 +To: "Marty Jia" +From: Ron +Subject: Re: How to get higher tps +Cc: +In-Reply-To: <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeve + s.ask.info> +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E3074@SITE3MAIL04.jeeves.ask.info> + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E30D4@SITE3MAIL04.jeeves.ask.info> +Mime-Version: 1.0 +Content-Type: text/plain; charset="us-ascii"; format=flowed +X-ELNK-Trace: + acd68a6551193be5d780f4a490ca69563f9fea00a6dd62bc864184ac8529e37e12682a7551dfbb04350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c +X-Originating-IP: 71.243.17.205 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/345 +X-Sequence-Number: 20530 + +At 04:45 PM 8/21/2006, Marty Jia wrote: +>I'm exhausted to try all performance tuning ideas, like following +>parameters +> +>shared_buffers +>fsync +>max_fsm_pages +>max_connections +>shared_buffers +>work_mem +>max_fsm_pages +>effective_cache_size +>random_page_cost + +All of this comes =after= the Get the Correct HW (1) & OS (2) +steps. You are putting the cart before the horse. + +>I believe all above have right size and values, but I just can not get +>higher tps more than 300 testd by pgbench + +300tps on what HW? and under what pattern of IO load? +300tps of OLTP on a small number of non-Raptor 10K rpm HD's may +actually be decent performance. +300tps on a 24 HD RAID 10 based on Raptors or 15Krpm HDs and working +through a HW RAID controller w/ >= 1GB of BB cache is likely to be poor. + +>Here is our hardware +> +> +>Dual Intel Xeon 2.8GHz +>6GB RAM + +Modest CPU and RAM for a DB server now-a-days. In particular, the +more DB you can keep in RAM the better. +And you have said nothing about the most importance HW when talking +about tps: What Does Your HD Subsystem Look Like? +. + +>Linux 2.4 kernel +>RedHat Enterprise Linux AS 3 +Upgrade to a 2.6 based kernel and examine your RHEL-AS3 install with +a close eye to trimming the fat you do not need from it. Cent-OS ot +Ca-Os may be better distro choices. + + +>200GB for PGDATA on 3Par, ext3 +>50GB for WAL on 3Par, ext3 +Put WAL on ext2. Experiment with ext3, jfs, reiserfs, and XFS for pgdata. + +Take a =close= look at the exact HW specs of your 3par.to make sure +that you are not attempting the impossible with that HW. +"3par" is marketing fluff. We need HD specs and RAID subsystem config data. + +>With PostgreSql 8.1.4 +> +>We don't have i/o bottle neck. +Prove it. Where are the numbers that back up your assertion and how +did you get them? + + +>Whatelse I can try to better tps? Someone told me I can should get tps +>over 1500, it is hard to believe. +Did they claim your exact HW could get 1500tps? Your exact HW+OS+pg +version+app SW? Some subset of those 4 variables? +Performance claims are easy to make. =Valid= performance claims are +tougher since they have to be much more constrained and descriptive. + + +Ron + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 12:55:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 66C659FB1CB + for ; + Tue, 22 Aug 2006 12:55:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 45520-05 for + ; + Tue, 22 Aug 2006 15:55:13 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id C09219FA69A + for ; + Tue, 22 Aug 2006 12:55:13 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 11:57:13 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E32B3@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <7.0.1.0.2.20060822111857.038f6838@earthlink.net> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbGApGoln5Loh9oQ3Ol8hkW2JJEXwAAM6OA +From: "Marty Jia" +To: "Ron" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/346 +X-Sequence-Number: 20531 + +Ron + +Here is our hardware + +Dual Intel Xeon 2.8GHz +6GB RAM +Linux 2.4 kernel +RedHat Enterprise Linux AS 3 +200GB for PGDATA on 3Par, ext3 +50GB for WAL on 3Par, ext3 + +RAID 10, using 3Par virtual volume technology across ~200 physical FC +disks. 4 virtual disks for PGDATA, striped with LVM into one volume, 2 +virtual disks for WAL, also striped. SAN attached with Qlogic SAN +surfer multipathing to load balance each LUN on two 2GBs paths. HBAs +are Qlogic 2340's. 16GB host cache on 3Par. + +shared_buffers =3D 80000 +max_fsm_pages =3D 350000 +max_connections =3D 1000 +work_mem =3D 65536 +effective_cache_size =3D 610000 +random_page_cost =3D 3 + +Thanks +=20 + +-----Original Message----- +From: Ron [mailto:rjpeace@earthlink.net]=20 +Sent: Tuesday, August 22, 2006 11:47 AM +To: Marty Jia +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] How to get higher tps + +At 04:45 PM 8/21/2006, Marty Jia wrote: +>I'm exhausted to try all performance tuning ideas, like following=20 +>parameters +> +>shared_buffers +>fsync +>max_fsm_pages +>max_connections +>shared_buffers +>work_mem +>max_fsm_pages +>effective_cache_size +>random_page_cost + +All of this comes =3Dafter=3D the Get the Correct HW (1) & OS (2) steps. +You are putting the cart before the horse. + +>I believe all above have right size and values, but I just can not get=20 +>higher tps more than 300 testd by pgbench + +300tps on what HW? and under what pattern of IO load? +300tps of OLTP on a small number of non-Raptor 10K rpm HD's may actually +be decent performance. +300tps on a 24 HD RAID 10 based on Raptors or 15Krpm HDs and working +through a HW RAID controller w/ >=3D 1GB of BB cache is likely to be = +poor. + +>Here is our hardware +> +> +>Dual Intel Xeon 2.8GHz +>6GB RAM + +Modest CPU and RAM for a DB server now-a-days. In particular, the=20 +more DB you can keep in RAM the better. +And you have said nothing about the most importance HW when talking +about tps: What Does Your HD Subsystem Look Like? +. + +>Linux 2.4 kernel +>RedHat Enterprise Linux AS 3 +Upgrade to a 2.6 based kernel and examine your RHEL-AS3 install with a +close eye to trimming the fat you do not need from it. Cent-OS ot Ca-Os +may be better distro choices. + + +>200GB for PGDATA on 3Par, ext3 +>50GB for WAL on 3Par, ext3 +Put WAL on ext2. Experiment with ext3, jfs, reiserfs, and XFS for +pgdata. + +Take a =3Dclose=3D look at the exact HW specs of your 3par.to make sure = +that +you are not attempting the impossible with that HW. +"3par" is marketing fluff. We need HD specs and RAID subsystem config +data. + +>With PostgreSql 8.1.4 +> +>We don't have i/o bottle neck. +Prove it. Where are the numbers that back up your assertion and how did +you get them? + + +>Whatelse I can try to better tps? Someone told me I can should get tps +>over 1500, it is hard to believe. +Did they claim your exact HW could get 1500tps? Your exact HW+OS+pg=20 +version+app SW? Some subset of those 4 variables? +Performance claims are easy to make. =3DValid=3D performance claims are = + +tougher since they have to be much more constrained and descriptive. + + +Ron + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 13:16:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3F9BE9FB364 + for ; + Tue, 22 Aug 2006 13:16:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 66900-01 for + ; + Tue, 22 Aug 2006 16:15:59 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 2CADE9FB337 + for ; + Tue, 22 Aug 2006 13:15:58 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7MGFkwu009509 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Tue, 22 Aug 2006 09:15:47 -0700 +Message-ID: <44EB2DB0.60707@commandprompt.com> +Date: Tue, 22 Aug 2006 09:15:44 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Marty Jia +CC: Alex Turner , Mark Lewis , + pgsql-performance@postgresql.org, DBAs , + Rich Wilson , Ernest Wurzbach +Subject: Re: How to get higher tps +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E32A7@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E32A7@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 22 Aug 2006 09:15:52 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/347 +X-Sequence-Number: 20532 + +Marty Jia wrote: +> Here is iostat when running pgbench: +> +> avg-cpu: %user %nice %sys %iowait %idle +> 26.17 0.00 8.25 23.17 42.42 + +You are are a little io bound and fairly cpu bound. I would be curious +if your performance goes down if you increase the number of connections +you are using. + +Joshua D. Drake + + +> +> Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +> sda 0.00 0.00 0.00 0 0 +> sda1 0.00 0.00 0.00 0 0 +> sda2 0.00 0.00 0.00 0 0 +> sda3 0.00 0.00 0.00 0 0 +> sda4 0.00 0.00 0.00 0 0 +> sda5 0.00 0.00 0.00 0 0 +> sda6 0.00 0.00 0.00 0 0 +> sda7 0.00 0.00 0.00 0 0 +> sdb 0.00 0.00 0.00 0 0 +> sdb1 0.00 0.00 0.00 0 0 +> sdb2 0.00 0.00 0.00 0 0 +> sdb3 0.00 0.00 0.00 0 0 +> sdb4 0.00 0.00 0.00 0 0 +> sdb5 0.00 0.00 0.00 0 0 +> sdb6 0.00 0.00 0.00 0 0 +> sdb7 0.00 0.00 0.00 0 0 +> sdc 0.00 0.00 0.00 0 0 +> sdd 0.00 0.00 0.00 0 0 +> sde 0.00 0.00 0.00 0 0 +> sdf 0.00 0.00 0.00 0 0 +> sdg 0.00 0.00 0.00 0 0 +> sdh 0.00 0.00 0.00 0 0 +> sdi 40.33 0.00 413.33 0 1240 +> sdj 34.33 0.00 394.67 0 1184 +> sdk 36.00 0.00 410.67 0 1232 +> sdl 37.00 0.00 429.33 0 1288 +> sdm 375.00 0.00 3120.00 0 9360 +> sdn 378.33 0.00 3120.00 0 9360 +> +> ________________________________ +> +> From: Alex Turner [mailto:armtuk@gmail.com] +> Sent: Tuesday, August 22, 2006 11:27 AM +> To: Mark Lewis +> Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; DBAs; +> Rich Wilson; Ernest Wurzbach +> Subject: Re: [PERFORM] How to get higher tps +> +> +> Oh - and it's usefull to know if you are CPU bound, or IO bound. Check +> top or vmstat to get an idea of that +> +> Alex +> +> +> On 8/22/06, Alex Turner < armtuk@gmail.com > +> wrote: +> +> First things first, run a bonnie++ benchmark, and post the +> numbers. That will give a good indication of raw IO performance, and is +> often the first inidication of problems separate from the DB. We have +> seen pretty bad performance from SANs in the past. How many FC lines do +> you have running to your server, remember each line is limited to about +> 200MB/sec, to get good throughput, you will need multiple connections. +> +> When you run pgbench, run a iostat also and see what the numbers +> say. +> +> +> Alex. +> +> +> +> On 8/22/06, Mark Lewis < mark.lewis@mir3.com +> > wrote: +> +> Well, at least on my test machines running +> gnome-terminal, my pgbench +> runs tend to get throttled by gnome-terminal's lousy +> performance to no +> more than 300 tps or so. Running with 2>/dev/null to +> throw away all the +> detailed logging gives me 2-3x improvement in scores. +> Caveat: in my +> case the db is on the local machine, so who knows what +> all the +> interactions are. +> +> Also, when you initialized the pgbench db what scaling +> factor did you +> use? And does running pgbench with -v improve +> performance at all? +> +> -- Mark +> +> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> > Joshua, +> > +> > Here is +> > +> > shared_buffers = 80000 +> > fsync = on +> > max_fsm_pages = 350000 +> > max_connections = 1000 +> > work_mem = 65536 +> > effective_cache_size = 610000 +> > random_page_cost = 3 +> > +> > Here is pgbench I used: +> > +> > pgbench -c 10 -t 10000 -d HQDB +> > +> > Thanks +> > +> > Marty +> > +> > -----Original Message----- +> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +> > Sent: Monday, August 21, 2006 6:09 PM +> > To: Marty Jia +> > Cc: pgsql-performance@postgresql.org +> > Subject: Re: [PERFORM] How to get higher tps +> > +> > Marty Jia wrote: +> > > I'm exhausted to try all performance tuning ideas, +> like following +> > > parameters +> > > +> > > shared_buffers +> > > fsync +> > > max_fsm_pages +> > > max_connections +> > > shared_buffers +> > > work_mem +> > > max_fsm_pages +> > > effective_cache_size +> > > random_page_cost +> > > +> > > I believe all above have right size and values, but +> I just can not get +> > +> > > higher tps more than 300 testd by pgbench +> > +> > What values did you use? +> > +> > > +> > > Here is our hardware +> > > +> > > +> > > Dual Intel Xeon 2.8GHz +> > > 6GB RAM +> > > Linux 2.4 kernel +> > > RedHat Enterprise Linux AS 3 +> > > 200GB for PGDATA on 3Par, ext3 +> > > 50GB for WAL on 3Par, ext3 +> > > +> > > With PostgreSql 8.1.4 +> > > +> > > We don't have i/o bottle neck. +> > +> > Are you sure? What does iostat say during a pgbench? +> What parameters are +> > you passing to pgbench? +> > +> > Well in theory, upgrading to 2.6 kernel will help as +> well as making your +> > WAL ext2 instead of ext3. +> > +> > > Whatelse I can try to better tps? Someone told me I +> can should get tps +> > +> > > over 1500, it is hard to believe. +> > +> > 1500? Hmmm... I don't know about that, I can get +> 470tps or so on my +> > measily dual core 3800 with 2gig of ram though. +> > +> > Joshua D. Drake +> > +> > +> > > +> > > Thanks +> > > +> > > Marty +> > > +> > > ---------------------------(end of +> > > broadcast)--------------------------- +> > > TIP 2: Don't 'kill -9' the postmaster +> > > +> > +> > +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an +> appropriate +> subscribe-nomail command to +> majordomo@postgresql.org so that your +> message can get through to the mailing list +> cleanly +> +> +> +> +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 14:23:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C73F89FB274 + for ; + Tue, 22 Aug 2006 14:23:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 96239-10 for + ; + Tue, 22 Aug 2006 17:23:04 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) + by postgresql.org (Postfix) with SMTP id 3114E9FA50F + for ; + Tue, 22 Aug 2006 14:23:03 -0300 (ADT) +Received: (qmail invoked by alias); 22 Aug 2006 17:23:02 -0000 +Received: from reverse-213-146-112-9.cust.kamp-dsl.de (EHLO salaam.bg8net) + [213.146.112.9] + by mail.gmx.net (mp036) with SMTP; 22 Aug 2006 19:23:02 +0200 +X-Authenticated: #5277147 +Received: from localhost (localhost [127.0.0.1]) + by salaam.bg8net (Postfix) with ESMTP id 84EC342F9E + for ; + Tue, 22 Aug 2006 19:23:01 +0200 (CEST) +From: Ulrich Habel +Reply-To: espero7757@gmx.net +To: pgsql-performance@postgresql.org +Subject: query planner: automatic rescribe of LIKE to BETWEEN ? +Date: Tue, 22 Aug 2006 19:22:59 +0200 +User-Agent: KMail/1.9.3 +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +Message-Id: <200608221922.59734.espero7757@gmx.net> +X-Y-GMX-Trusted: 0 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/348 +X-Sequence-Number: 20533 + +Hello all, +had an idea of optimizing a query that may work generally. + +In case a 'column' is indexed, following two alterations could be done +I think: + +A) + + select ... where column ~ '^Foo' --> Seq Scan + +into that: + + select ... where column BETWEEN 'Foo' AND 'FooZ' --> Index Scan + +of course 'Z' should be the last possible character internally used of the +DBMS. + +That would work as long as there is no in-case-sensitive search being done. + + +another rescribtion: + +B) + + select ... where column ~ '^Foo$' --> Seq Scan + +into that: + + select ... where column = 'Foo' --> Bitmap Heap Scan + +That speeds up things, too. + + + +That would also apply to 'LIKE' and 'SIMILAR TO' operations, I think. + +Is there any idea to make the "Query Planner" more intelligent to do these +convertions automatically? + +Anythings speeks against this hack? + +Regards + Uli Habel + +From pgsql-performance-owner@postgresql.org Tue Aug 22 14:46:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 14F949FB274 + for ; + Tue, 22 Aug 2006 14:46:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 10734-02 for + ; + Tue, 22 Aug 2006 14:46:02 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 20E5D9FA5FB + for ; + Tue, 22 Aug 2006 14:46:01 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7MHjxB8011580; + Tue, 22 Aug 2006 10:46:00 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 2E147C2DC58; Tue, 22 Aug 2006 13:45:39 -0400 (CLT) +Date: Tue, 22 Aug 2006 13:45:39 -0400 +From: Alvaro Herrera +To: Ulrich Habel +Cc: pgsql-performance@postgresql.org +Subject: Re: query planner: automatic rescribe of LIKE to BETWEEN ? +Message-ID: <20060822174539.GD25475@alvh.no-ip.org> +Mail-Followup-To: Ulrich Habel , + pgsql-performance@postgresql.org +References: <200608221922.59734.espero7757@gmx.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <200608221922.59734.espero7757@gmx.net> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 22 Aug 2006 10:46:00 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.423 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/349 +X-Sequence-Number: 20534 + +Ulrich Habel wrote: +> Hello all, +> had an idea of optimizing a query that may work generally. +> +> In case a 'column' is indexed, following two alterations could be done +> I think: +> +> A) +> +> select ... where column ~ '^Foo' --> Seq Scan + +This is not true. You can make this query use an index if you create it +with opclass varchar_pattern_ops or text_pattern_ops, as appropiate. + +Thus you don't need any hack here. + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +PostgreSQL Replication, Consulting, Custom Development, 24x7 support + +From pgsql-performance-owner@postgresql.org Tue Aug 22 15:33:34 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id EBD109FB37B + for ; + Tue, 22 Aug 2006 15:33:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 23191-02 for + ; + Tue, 22 Aug 2006 18:33:13 +0000 (UTC) +X-Greylist: delayed 00:22:18.440623 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 955C59FB392 + for ; + Tue, 22 Aug 2006 15:33:13 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from morework.geizhals.at (home.geizhals.at [213.229.14.34]) + by svr4.postgresql.org (Postfix) with ESMTP id ECC1F5AF03C + for ; + Tue, 22 Aug 2006 18:10:53 +0000 (GMT) +Received: from localhost (morework [127.0.0.1]) + by morework.geizhals.at (Postfix) with ESMTP id C57B3DECD2 + for ; + Tue, 22 Aug 2006 20:10:49 +0200 (CEST) +Received: from [172.16.42.138] (unknown [172.16.42.138]) + by morework.geizhals.at (Postfix) with ESMTP + for ; + Tue, 22 Aug 2006 20:10:47 +0200 (CEST) +Message-ID: <44EB48A9.7030704@geizhals.at> +Date: Tue, 22 Aug 2006 20:10:49 +0200 +From: Marinos Yannikos +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: VACUUM FULL needed sometimes to prevent transaction ID wraparound? +Content-Type: text/plain; charset=ISO-8859-15; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new-20030616-p10 at geizhals.at +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/351 +X-Sequence-Number: 20536 + +Hello, + +we're looking into the reason why we are getting warnings about +transaction ID wraparound despite a daily "vaccumdb -qaz". Someone is +claiming that VACUUM without FULL cannot reassign XIDs properly when +max_fsm_pages was set too low (it says so here too, but this is rather +old: http://www.varlena.com/GeneralBits/Tidbits/perf.html#maxfsmp). Is +this true, or do we have a different issue here? We're using 8.1.3 with +a database generated on 8.1.3 (i.e. not migrated from 7.x or anything +like that). + +Thanks, + Marinos + +From pgsql-performance-owner@postgresql.org Tue Aug 22 15:21:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id E9CCC9FA2AD + for ; + Tue, 22 Aug 2006 15:21:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 18959-04 for + ; + Tue, 22 Aug 2006 18:21:24 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.185]) + by postgresql.org (Postfix) with ESMTP id 9263C9FB300 + for ; + Tue, 22 Aug 2006 15:21:24 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id p77so148131nfc + for ; + Tue, 22 Aug 2006 11:21:23 -0700 (PDT) +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=WUilhXfpuLvCc66V3+IPtLheTsw9PB59Teme+0mhoMI8T9xjR5OrsnpNjYloM/4mT0hfA5fPwzQyxG1R6OqslPUhhRmlgOWCUXiTL+X1FvGzVYa79czy+lC5fTHxdL69iaYTEw4cXcpRrpESV1Iud9prYqy49JpTm0K+TyBPOVY= +Received: by 10.66.252.4 with SMTP id z4mr4555771ugh; + Tue, 22 Aug 2006 11:21:23 -0700 (PDT) +Received: by 10.67.28.18 with HTTP; Tue, 22 Aug 2006 11:21:23 -0700 (PDT) +Message-ID: <4e96c6600608221121p2afc603bx90fcf879aab47d96@mail.gmail.com> +Date: Tue, 22 Aug 2006 20:21:23 +0200 +From: "Thomas Samson" +To: "Ulrich Habel" , pgsql-performance@postgresql.org +Subject: Re: query planner: automatic rescribe of LIKE to BETWEEN ? +In-Reply-To: <20060822174539.GD25475@alvh.no-ip.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <200608221922.59734.espero7757@gmx.net> + <20060822174539.GD25475@alvh.no-ip.org> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/350 +X-Sequence-Number: 20535 + +On 8/22/06, Alvaro Herrera wrote: +> Ulrich Habel wrote: +> > Hello all, +> > had an idea of optimizing a query that may work generally. +> > +> > In case a 'column' is indexed, following two alterations could be done +> > I think: +> > +> > A) +> > +> > select ... where column ~ '^Foo' --> Seq Scan +> +> This is not true. You can make this query use an index if you create it +> with opclass varchar_pattern_ops or text_pattern_ops, as appropiate. +> +> Thus you don't need any hack here. +> + +And in the case of more general expression, like: + select ... where column ~ 'something'; + +Is there a way to optimise this ? (in the case where 'something' is not +a word, but a part of a word) + +-- +Thomas SAMSON + +From pgsql-performance-owner@postgresql.org Tue Aug 22 15:50:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 542C19FB300 + for ; + Tue, 22 Aug 2006 15:50:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 28179-01 for + ; + Tue, 22 Aug 2006 18:50:39 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id B60C89FA50F + for ; + Tue, 22 Aug 2006 15:50:37 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7MIoWu8012978; + Tue, 22 Aug 2006 11:50:33 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 53A01C2DC58; Tue, 22 Aug 2006 14:49:57 -0400 (CLT) +Date: Tue, 22 Aug 2006 14:49:57 -0400 +From: Alvaro Herrera +To: Thomas Samson +Cc: Ulrich Habel , pgsql-performance@postgresql.org +Subject: Re: query planner: automatic rescribe of LIKE to BETWEEN ? +Message-ID: <20060822184957.GE25475@alvh.no-ip.org> +Mail-Followup-To: Thomas Samson , + Ulrich Habel , pgsql-performance@postgresql.org +References: <200608221922.59734.espero7757@gmx.net> + <20060822174539.GD25475@alvh.no-ip.org> + <4e96c6600608221121p2afc603bx90fcf879aab47d96@mail.gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <4e96c6600608221121p2afc603bx90fcf879aab47d96@mail.gmail.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 22 Aug 2006 11:50:33 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/352 +X-Sequence-Number: 20537 + +Thomas Samson wrote: +> On 8/22/06, Alvaro Herrera wrote: +> >Ulrich Habel wrote: +> >> Hello all, +> >> had an idea of optimizing a query that may work generally. +> >> +> >> In case a 'column' is indexed, following two alterations could be done +> >> I think: +> >> +> >> A) +> >> +> >> select ... where column ~ '^Foo' --> Seq Scan +> > +> >This is not true. You can make this query use an index if you create it +> >with opclass varchar_pattern_ops or text_pattern_ops, as appropiate. +> > +> >Thus you don't need any hack here. +> > +> +> And in the case of more general expression, like: +> select ... where column ~ 'something'; +> +> Is there a way to optimise this ? (in the case where 'something' is not +> a word, but a part of a word) + +Not sure. I'd try tsearch2 or pg_trgm (or pg_tgrm, whatever it's +called). It's trigram indexing. + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +PostgreSQL Replication, Consulting, Custom Development, 24x7 support + +From pgsql-performance-owner@postgresql.org Tue Aug 22 16:20:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 574569FA4D9 + for ; + Tue, 22 Aug 2006 16:20:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 18176-04 for + ; + Tue, 22 Aug 2006 16:20:18 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id DD7DA9FB25D + for ; + Tue, 22 Aug 2006 16:20:17 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7MJKFFD013763; + Tue, 22 Aug 2006 12:20:15 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 3FA3FC2DC58; Tue, 22 Aug 2006 15:19:53 -0400 (CLT) +Date: Tue, 22 Aug 2006 15:19:53 -0400 +From: Alvaro Herrera +To: Marinos Yannikos +Cc: pgsql-performance@postgresql.org +Subject: Re: VACUUM FULL needed sometimes to prevent transaction ID + wraparound? +Message-ID: <20060822191952.GG25475@alvh.no-ip.org> +Mail-Followup-To: Marinos Yannikos , + pgsql-performance@postgresql.org +References: <44EB48A9.7030704@geizhals.at> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44EB48A9.7030704@geizhals.at> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 22 Aug 2006 12:20:16 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.414 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/353 +X-Sequence-Number: 20538 + +Marinos Yannikos wrote: +> Hello, +> +> we're looking into the reason why we are getting warnings about +> transaction ID wraparound despite a daily "vaccumdb -qaz". Someone is +> claiming that VACUUM without FULL cannot reassign XIDs properly when +> max_fsm_pages was set too low (it says so here too, but this is rather +> old: http://www.varlena.com/GeneralBits/Tidbits/perf.html#maxfsmp). Is +> this true, or do we have a different issue here? We're using 8.1.3 with +> a database generated on 8.1.3 (i.e. not migrated from 7.x or anything +> like that). + +It's not true. Having shortage of FSM entries will make you lose space, +but it will be able to recycle Xids anyway. + +I guess your problem is that you're not vacuuming all databases for some +reason. I'd advise to lose the -q and make sure you're not redirecting +to somewhere you can't read the log; the read the log and make sure +everything is going fine. + +What's the warning anyway? Does it say that wraparound point is +nearing, or does it merely say that it is on Xid and +you don't know how far that number actually is? + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Tue Aug 22 16:23:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 9B72F9FB300 + for ; + Tue, 22 Aug 2006 16:23:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 33914-05 for + ; + Tue, 22 Aug 2006 19:22:59 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 53E869FB275 + for ; + Tue, 22 Aug 2006 16:22:59 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from MAIL.corp.lumeta.com (h65-246-245-23.lumeta.com + [65.246.245.23]) + by svr4.postgresql.org (Postfix) with ESMTP id 812DB5AF8C6 + for ; + Tue, 22 Aug 2006 19:22:58 +0000 (GMT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 15:22:51 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104AC6@MAIL.corp.lumeta.com> +In-Reply-To: <44EB2DB0.60707@commandprompt.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbGBl1CFZlghdCVQiqjoKx+I4fwtwAF6o3g +From: "Bucky Jordan" +To: "Joshua D. Drake" , + "Marty Jia" +Cc: "Alex Turner" , "Mark Lewis" , + , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/354 +X-Sequence-Number: 20539 + +Marty, + +Here's pgbench results from a stock FreeBSD 6.1 amd64/PG 8.1.4 install +on a Dell Poweredge 2950 with 8gb ram, 2x3.0 dual-core woodcrest (4MB +cache/socket) with 6x300GB 10k SAS drives: + +pgbench -c 10 -t 10000 -d bench 2>/dev/null +pghost: pgport: (null) nclients: 10 nxacts: 10000 dbName: bench +`transaction type: TPC-B (sort of) +scaling factor: 20 +number of clients: 10 +number of transactions per client: 10000 +number of transactions actually processed: 100000/100000 +tps =3D 561.056729 (including connections establishing) +tps =3D 561.127760 (excluding connections establishing) + +Here's some iostat samples during the test: + tty mfid0 da0 cd0 +cpu + tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in +id + 6 77 16.01 1642 25.67 0.00 0 0.00 0.00 0 0.00 3 0 8 +2 87 + 8 157 17.48 3541 60.43 0.00 0 0.00 0.00 0 0.00 24 0 28 +4 43 + 5 673 17.66 2287 39.44 0.00 0 0.00 0.00 0 0.00 10 0 13 +2 75 + 6 2818 16.37 2733 43.68 0.00 0 0.00 0.00 0 0.00 17 0 23 +3 56 + 1 765 18.05 2401 42.32 0.00 0 0.00 0.00 0 0.00 15 0 17 +3 65 + +Note- the above was with no tuning to the kernel or postgresql.conf.=20 + +Now for my question- it seems that I've still got quite a bit of +headroom on the hardware I'm running the above tests on, since I know +the array will pump out > 200 MB/s (dd, bonnie++ numbers), and CPU +appears mostly idle. This would indicate I should be able to get some +significantly better numbers with postgresql.conf tweaks correct? + +I guess the other problem is ensuring that we're not testing RAM speeds, +since most of the data is probably in memory (BSD io buffers)? Although, +for the initial run, that doesn't seem to be the case, since subsequent +runs without rebuilding the benchmark db are slightly not believable +(i.e. 1,200 going up to >2,500 tps over 5 back-to-back runs). So, as +long as I re-initialize the benchdb before each run, it should be a +realistic test, right? + +Thanks, + +Bucky +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Joshua D. +Drake +Sent: Tuesday, August 22, 2006 12:16 PM +To: Marty Jia +Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + +Marty Jia wrote: +> Here is iostat when running pgbench: +> =20 +> avg-cpu: %user %nice %sys %iowait %idle +> 26.17 0.00 8.25 23.17 42.42 + +You are are a little io bound and fairly cpu bound. I would be curious=20 +if your performance goes down if you increase the number of connections=20 +you are using. + +Joshua D. Drake + + +> =20 +> Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +> sda 0.00 0.00 0.00 0 0 +> sda1 0.00 0.00 0.00 0 0 +> sda2 0.00 0.00 0.00 0 0 +> sda3 0.00 0.00 0.00 0 0 +> sda4 0.00 0.00 0.00 0 0 +> sda5 0.00 0.00 0.00 0 0 +> sda6 0.00 0.00 0.00 0 0 +> sda7 0.00 0.00 0.00 0 0 +> sdb 0.00 0.00 0.00 0 0 +> sdb1 0.00 0.00 0.00 0 0 +> sdb2 0.00 0.00 0.00 0 0 +> sdb3 0.00 0.00 0.00 0 0 +> sdb4 0.00 0.00 0.00 0 0 +> sdb5 0.00 0.00 0.00 0 0 +> sdb6 0.00 0.00 0.00 0 0 +> sdb7 0.00 0.00 0.00 0 0 +> sdc 0.00 0.00 0.00 0 0 +> sdd 0.00 0.00 0.00 0 0 +> sde 0.00 0.00 0.00 0 0 +> sdf 0.00 0.00 0.00 0 0 +> sdg 0.00 0.00 0.00 0 0 +> sdh 0.00 0.00 0.00 0 0 +> sdi 40.33 0.00 413.33 0 1240 +> sdj 34.33 0.00 394.67 0 1184 +> sdk 36.00 0.00 410.67 0 1232 +> sdl 37.00 0.00 429.33 0 1288 +> sdm 375.00 0.00 3120.00 0 9360 +> sdn 378.33 0.00 3120.00 0 9360 +>=20 +> ________________________________ +>=20 +> From: Alex Turner [mailto:armtuk@gmail.com]=20 +> Sent: Tuesday, August 22, 2006 11:27 AM +> To: Mark Lewis +> Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; +DBAs; +> Rich Wilson; Ernest Wurzbach +> Subject: Re: [PERFORM] How to get higher tps +>=20 +>=20 +> Oh - and it's usefull to know if you are CPU bound, or IO bound. +Check +> top or vmstat to get an idea of that +>=20 +> Alex +>=20 +>=20 +> On 8/22/06, Alex Turner < armtuk@gmail.com > +> wrote:=20 +>=20 +> First things first, run a bonnie++ benchmark, and post the +> numbers. That will give a good indication of raw IO performance, and +is +> often the first inidication of problems separate from the DB. We have +> seen pretty bad performance from SANs in the past. How many FC lines +do +> you have running to your server, remember each line is limited to +about +> 200MB/sec, to get good throughput, you will need multiple connections. + +> =09 +> When you run pgbench, run a iostat also and see what the numbers +> say. +> =09 +> =09 +> Alex. +> =09 +> =09 +> =09 +> On 8/22/06, Mark Lewis < mark.lewis@mir3.com +> > wrote:=20 +>=20 +> Well, at least on my test machines running +> gnome-terminal, my pgbench=20 +> runs tend to get throttled by gnome-terminal's lousy +> performance to no +> more than 300 tps or so. Running with 2>/dev/null to +> throw away all the +> detailed logging gives me 2-3x improvement in scores. +> Caveat: in my=20 +> case the db is on the local machine, so who knows what +> all the +> interactions are. +> =09 +> Also, when you initialized the pgbench db what scaling +> factor did you +> use? And does running pgbench with -v improve +> performance at all?=20 +> =09 +> -- Mark +> =09 +> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> > Joshua, +> > +> > Here is +> > +> > shared_buffers =3D 80000 +> > fsync =3D on +> > max_fsm_pages =3D 350000 +> > max_connections =3D 1000=20 +> > work_mem =3D 65536 +> > effective_cache_size =3D 610000 +> > random_page_cost =3D 3 +> > +> > Here is pgbench I used: +> > +> > pgbench -c 10 -t 10000 -d HQDB +> > +> > Thanks +> > +> > Marty=20 +> > +> > -----Original Message----- +> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +> > Sent: Monday, August 21, 2006 6:09 PM +> > To: Marty Jia +> > Cc: pgsql-performance@postgresql.org +> > Subject: Re: [PERFORM] How to get higher tps +> > +> > Marty Jia wrote: +> > > I'm exhausted to try all performance tuning ideas, +> like following=20 +> > > parameters +> > > +> > > shared_buffers +> > > fsync +> > > max_fsm_pages +> > > max_connections +> > > shared_buffers +> > > work_mem +> > > max_fsm_pages +> > > effective_cache_size +> > > random_page_cost +> > > +> > > I believe all above have right size and values, but +> I just can not get +> > +> > > higher tps more than 300 testd by pgbench=20 +> > +> > What values did you use? +> > +> > > +> > > Here is our hardware +> > > +> > > +> > > Dual Intel Xeon 2.8GHz +> > > 6GB RAM +> > > Linux 2.4 kernel +> > > RedHat Enterprise Linux AS 3=20 +> > > 200GB for PGDATA on 3Par, ext3 +> > > 50GB for WAL on 3Par, ext3 +> > > +> > > With PostgreSql 8.1.4 +> > > +> > > We don't have i/o bottle neck. +> > +> > Are you sure? What does iostat say during a pgbench? +> What parameters are=20 +> > you passing to pgbench? +> > +> > Well in theory, upgrading to 2.6 kernel will help as +> well as making your +> > WAL ext2 instead of ext3. +> > +> > > Whatelse I can try to better tps? Someone told me I +> can should get tps=20 +> > +> > > over 1500, it is hard to believe. +> > +> > 1500? Hmmm... I don't know about that, I can get +> 470tps or so on my +> > measily dual core 3800 with 2gig of ram though. +> > +> > Joshua D. Drake=20 +> > +> > +> > > +> > > Thanks +> > > +> > > Marty +> > > +> > > ---------------------------(end of +> > > broadcast)--------------------------- +> > > TIP 2: Don't 'kill -9' the postmaster=20 +> > > +> > +> > +> =09 +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an +> appropriate +> subscribe-nomail command to +> majordomo@postgresql.org so that your +> message can get through to the mailing list +> cleanly +> =09 +>=20 +>=20 +>=20 +>=20 + + +--=20 + + =3D=3D=3D The PostgreSQL Company: Command Prompt, Inc. =3D=3D=3D +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +---------------------------(end of broadcast)--------------------------- +TIP 4: Have you searched our list archives? + + http://archives.postgresql.org + +From pgsql-performance-owner@postgresql.org Tue Aug 22 16:28:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id DA37B9FB25D + for ; + Tue, 22 Aug 2006 16:28:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 30113-09 for + ; + Tue, 22 Aug 2006 19:28:18 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) + by postgresql.org (Postfix) with ESMTP id 7218A9FA4D9 + for ; + Tue, 22 Aug 2006 16:28:17 -0300 (ADT) +X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway +X-GR-Acctd: YES +Received: from [67.90.96.2] (HELO DaveEMachine) + by globalrelay.com (CommuniGate Pro SMTP 4.2.3) + with ESMTP id 101419003; Tue, 22 Aug 2006 12:28:16 -0700 +From: "Dave Dutcher" +To: "'Marinos Yannikos'" , +Subject: Re: VACUUM FULL needed sometimes to prevent transaction ID + wraparound? +Date: Tue, 22 Aug 2006 14:28:15 -0500 +Message-ID: <023601c6c621$1de0f3e0$8300a8c0@tridecap.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 +Importance: Normal +In-Reply-To: <44EB48A9.7030704@geizhals.at> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/355 +X-Sequence-Number: 20540 + +I would guess that you are not running vacuumdb as a user with permission to +vacuum the postgres or template1 databases. Try telling vacuumdb to log in +as postgres or whatever your superuser account is called. + + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of +> Marinos Yannikos +> Sent: Tuesday, August 22, 2006 1:11 PM +> To: pgsql-performance@postgresql.org +> Subject: [PERFORM] VACUUM FULL needed sometimes to prevent +> transaction ID wraparound? +> +> +> Hello, +> +> we're looking into the reason why we are getting warnings about +> transaction ID wraparound despite a daily "vaccumdb -qaz". Someone is +> claiming that VACUUM without FULL cannot reassign XIDs properly when +> max_fsm_pages was set too low (it says so here too, but this +> is rather +> old: +> http://www.varlena.com/GeneralBits/Tidbits/perf.html#maxfsmp). Is +> this true, or do we have a different issue here? We're using +> 8.1.3 with +> a database generated on 8.1.3 (i.e. not migrated from 7.x or anything +> like that). +> +> Thanks, +> Marinos +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 5: don't forget to increase your free space map settings +> + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 16:36:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4E1E99FB25D + for ; + Tue, 22 Aug 2006 16:36:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 39538-01 for + ; + Tue, 22 Aug 2006 19:35:41 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id 121CF9FA4D9 + for ; + Tue, 22 Aug 2006 16:35:40 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 15:37:40 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E33E4@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D4104AC6@MAIL.corp.lumeta.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbGBl1CFZlghdCVQiqjoKx+I4fwtwAF6o3gAADfN0A= +From: "Marty Jia" +To: "Bucky Jordan" , + "Joshua D. Drake" +Cc: "Alex Turner" , "Mark Lewis" , + , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/356 +X-Sequence-Number: 20541 + +Bucky + +My best result is around 380. I believe your hardware is more efficient, +because no matter how I change the conf parameters, no improvement can +be obtained. I even turned fsync off. + +What is your values for the following parameters? + +shared_buffers =3D 80000 +max_fsm_pages =3D 350000 +max_connections =3D 1000 +work_mem =3D 65536 +effective_cache_size =3D 610000 +random_page_cost =3D 3 + +Thanks +Marty + +-----Original Message----- +From: Bucky Jordan [mailto:bjordan@lumeta.com]=20 +Sent: Tuesday, August 22, 2006 3:23 PM +To: Joshua D. Drake; Marty Jia +Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: RE: [PERFORM] How to get higher tps + +Marty, + +Here's pgbench results from a stock FreeBSD 6.1 amd64/PG 8.1.4 install +on a Dell Poweredge 2950 with 8gb ram, 2x3.0 dual-core woodcrest (4MB +cache/socket) with 6x300GB 10k SAS drives: + +pgbench -c 10 -t 10000 -d bench 2>/dev/null +pghost: pgport: (null) nclients: 10 nxacts: 10000 dbName: bench +`transaction type: TPC-B (sort of) scaling factor: 20 number of clients: +10 number of transactions per client: 10000 number of transactions +actually processed: 100000/100000 tps =3D 561.056729 (including +connections establishing) tps =3D 561.127760 (excluding connections +establishing) + +Here's some iostat samples during the test: + tty mfid0 da0 cd0 +cpu + tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in +id + 6 77 16.01 1642 25.67 0.00 0 0.00 0.00 0 0.00 3 0 8 +2 87 + 8 157 17.48 3541 60.43 0.00 0 0.00 0.00 0 0.00 24 0 28 +4 43 + 5 673 17.66 2287 39.44 0.00 0 0.00 0.00 0 0.00 10 0 13 +2 75 + 6 2818 16.37 2733 43.68 0.00 0 0.00 0.00 0 0.00 17 0 23 +3 56 + 1 765 18.05 2401 42.32 0.00 0 0.00 0.00 0 0.00 15 0 17 +3 65 + +Note- the above was with no tuning to the kernel or postgresql.conf.=20 + +Now for my question- it seems that I've still got quite a bit of +headroom on the hardware I'm running the above tests on, since I know +the array will pump out > 200 MB/s (dd, bonnie++ numbers), and CPU +appears mostly idle. This would indicate I should be able to get some +significantly better numbers with postgresql.conf tweaks correct? + +I guess the other problem is ensuring that we're not testing RAM speeds, +since most of the data is probably in memory (BSD io buffers)? Although, +for the initial run, that doesn't seem to be the case, since subsequent +runs without rebuilding the benchmark db are slightly not believable +(i.e. 1,200 going up to >2,500 tps over 5 back-to-back runs). So, as +long as I re-initialize the benchdb before each run, it should be a +realistic test, right? + +Thanks, + +Bucky +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Joshua D. +Drake +Sent: Tuesday, August 22, 2006 12:16 PM +To: Marty Jia +Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + +Marty Jia wrote: +> Here is iostat when running pgbench: +> =20 +> avg-cpu: %user %nice %sys %iowait %idle +> 26.17 0.00 8.25 23.17 42.42 + +You are are a little io bound and fairly cpu bound. I would be curious +if your performance goes down if you increase the number of connections +you are using. + +Joshua D. Drake + + +> =20 +> Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +> sda 0.00 0.00 0.00 0 0 +> sda1 0.00 0.00 0.00 0 0 +> sda2 0.00 0.00 0.00 0 0 +> sda3 0.00 0.00 0.00 0 0 +> sda4 0.00 0.00 0.00 0 0 +> sda5 0.00 0.00 0.00 0 0 +> sda6 0.00 0.00 0.00 0 0 +> sda7 0.00 0.00 0.00 0 0 +> sdb 0.00 0.00 0.00 0 0 +> sdb1 0.00 0.00 0.00 0 0 +> sdb2 0.00 0.00 0.00 0 0 +> sdb3 0.00 0.00 0.00 0 0 +> sdb4 0.00 0.00 0.00 0 0 +> sdb5 0.00 0.00 0.00 0 0 +> sdb6 0.00 0.00 0.00 0 0 +> sdb7 0.00 0.00 0.00 0 0 +> sdc 0.00 0.00 0.00 0 0 +> sdd 0.00 0.00 0.00 0 0 +> sde 0.00 0.00 0.00 0 0 +> sdf 0.00 0.00 0.00 0 0 +> sdg 0.00 0.00 0.00 0 0 +> sdh 0.00 0.00 0.00 0 0 +> sdi 40.33 0.00 413.33 0 1240 +> sdj 34.33 0.00 394.67 0 1184 +> sdk 36.00 0.00 410.67 0 1232 +> sdl 37.00 0.00 429.33 0 1288 +> sdm 375.00 0.00 3120.00 0 9360 +> sdn 378.33 0.00 3120.00 0 9360 +>=20 +> ________________________________ +>=20 +> From: Alex Turner [mailto:armtuk@gmail.com] +> Sent: Tuesday, August 22, 2006 11:27 AM +> To: Mark Lewis +> Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; +DBAs; +> Rich Wilson; Ernest Wurzbach +> Subject: Re: [PERFORM] How to get higher tps +>=20 +>=20 +> Oh - and it's usefull to know if you are CPU bound, or IO bound. +Check +> top or vmstat to get an idea of that +>=20 +> Alex +>=20 +>=20 +> On 8/22/06, Alex Turner < armtuk@gmail.com > +> wrote:=20 +>=20 +> First things first, run a bonnie++ benchmark, and post the +numbers. =20 +> That will give a good indication of raw IO performance, and +is +> often the first inidication of problems separate from the DB. We have + +> seen pretty bad performance from SANs in the past. How many FC lines +do +> you have running to your server, remember each line is limited to +about +> 200MB/sec, to get good throughput, you will need multiple connections. + +> =09 +> When you run pgbench, run a iostat also and see what the numbers +say. +> =09 +> =09 +> Alex. +> =09 +> =09 +> =09 +> On 8/22/06, Mark Lewis < mark.lewis@mir3.com=20 +> > wrote: +>=20 +> Well, at least on my test machines running +gnome-terminal, my=20 +> pgbench +> runs tend to get throttled by gnome-terminal's lousy +performance to=20 +> no +> more than 300 tps or so. Running with 2>/dev/null to +throw away all=20 +> the +> detailed logging gives me 2-3x improvement in scores. +> Caveat: in my=20 +> case the db is on the local machine, so who knows what +all the +> interactions are. +> =09 +> Also, when you initialized the pgbench db what scaling +factor did=20 +> you +> use? And does running pgbench with -v improve +performance at all? +> =09 +> -- Mark +> =09 +> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> > Joshua, +> > +> > Here is +> > +> > shared_buffers =3D 80000 +> > fsync =3D on +> > max_fsm_pages =3D 350000 +> > max_connections =3D 1000=20 +> > work_mem =3D 65536 +> > effective_cache_size =3D 610000 +> > random_page_cost =3D 3 +> > +> > Here is pgbench I used: +> > +> > pgbench -c 10 -t 10000 -d HQDB +> > +> > Thanks +> > +> > Marty=20 +> > +> > -----Original Message----- +> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +> > Sent: Monday, August 21, 2006 6:09 PM +> > To: Marty Jia +> > Cc: pgsql-performance@postgresql.org +> > Subject: Re: [PERFORM] How to get higher tps +> > +> > Marty Jia wrote: +> > > I'm exhausted to try all performance tuning ideas, +like=20 +> following +> > > parameters +> > > +> > > shared_buffers +> > > fsync +> > > max_fsm_pages +> > > max_connections +> > > shared_buffers +> > > work_mem +> > > max_fsm_pages +> > > effective_cache_size +> > > random_page_cost +> > > +> > > I believe all above have right size and values, but +I just can=20 +> not get +> > +> > > higher tps more than 300 testd by pgbench=20 +> > +> > What values did you use? +> > +> > > +> > > Here is our hardware +> > > +> > > +> > > Dual Intel Xeon 2.8GHz +> > > 6GB RAM +> > > Linux 2.4 kernel +> > > RedHat Enterprise Linux AS 3=20 +> > > 200GB for PGDATA on 3Par, ext3 +> > > 50GB for WAL on 3Par, ext3 +> > > +> > > With PostgreSql 8.1.4 +> > > +> > > We don't have i/o bottle neck. +> > +> > Are you sure? What does iostat say during a pgbench? +> What parameters are=20 +> > you passing to pgbench? +> > +> > Well in theory, upgrading to 2.6 kernel will help as +well as=20 +> making your +> > WAL ext2 instead of ext3. +> > +> > > Whatelse I can try to better tps? Someone told me I +can should=20 +> get tps +> > +> > > over 1500, it is hard to believe. +> > +> > 1500? Hmmm... I don't know about that, I can get +470tps or so on=20 +> my +> > measily dual core 3800 with 2gig of ram though. +> > +> > Joshua D. Drake=20 +> > +> > +> > > +> > > Thanks +> > > +> > > Marty +> > > +> > > ---------------------------(end of +> > > broadcast)--------------------------- +> > > TIP 2: Don't 'kill -9' the postmaster=20 +> > > +> > +> > +> =09 +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an +appropriate +> subscribe-nomail command to +> majordomo@postgresql.org so that your +> message can get through to the mailing list +cleanly +> =09 +>=20 +>=20 +>=20 +>=20 + + +--=20 + + =3D=3D=3D The PostgreSQL Company: Command Prompt, Inc. =3D=3D=3D +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +---------------------------(end of broadcast)--------------------------- +TIP 4: Have you searched our list archives? + + http://archives.postgresql.org + +From pgsql-performance-owner@postgresql.org Tue Aug 22 16:39:09 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 355F29FB25D + for ; + Tue, 22 Aug 2006 16:39:09 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 33222-08 for + ; + Tue, 22 Aug 2006 19:38:49 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 639F99FA4D9 + for ; + Tue, 22 Aug 2006 16:38:49 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7MJcU2w014201 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Tue, 22 Aug 2006 12:38:31 -0700 +Message-ID: <44EB5D33.3030300@commandprompt.com> +Date: Tue, 22 Aug 2006 12:38:27 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Marty Jia +CC: Bucky Jordan , Alex Turner , + Mark Lewis , pgsql-performance@postgresql.org, + DBAs , Rich Wilson , + Ernest Wurzbach +Subject: Re: How to get higher tps +References: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E33E4@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E33E4@SITE3MAIL04.jeeves.ask.info> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 22 Aug 2006 12:38:37 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/357 +X-Sequence-Number: 20542 + +Marty Jia wrote: +> Bucky +> +> My best result is around 380. I believe your hardware is more efficient, +> because no matter how I change the conf parameters, no improvement can +> be obtained. I even turned fsync off. + +Do you stay constant if you use 40 clients versus 20? + +> +> What is your values for the following parameters? +> +> shared_buffers = 80000 +> max_fsm_pages = 350000 +> max_connections = 1000 +> work_mem = 65536 +> effective_cache_size = 610000 +> random_page_cost = 3 +> +> Thanks +> Marty +> +> -----Original Message----- +> From: Bucky Jordan [mailto:bjordan@lumeta.com] +> Sent: Tuesday, August 22, 2006 3:23 PM +> To: Joshua D. Drake; Marty Jia +> Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +> Rich Wilson; Ernest Wurzbach +> Subject: RE: [PERFORM] How to get higher tps +> +> Marty, +> +> Here's pgbench results from a stock FreeBSD 6.1 amd64/PG 8.1.4 install +> on a Dell Poweredge 2950 with 8gb ram, 2x3.0 dual-core woodcrest (4MB +> cache/socket) with 6x300GB 10k SAS drives: +> +> pgbench -c 10 -t 10000 -d bench 2>/dev/null +> pghost: pgport: (null) nclients: 10 nxacts: 10000 dbName: bench +> `transaction type: TPC-B (sort of) scaling factor: 20 number of clients: +> 10 number of transactions per client: 10000 number of transactions +> actually processed: 100000/100000 tps = 561.056729 (including +> connections establishing) tps = 561.127760 (excluding connections +> establishing) +> +> Here's some iostat samples during the test: +> tty mfid0 da0 cd0 +> cpu +> tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in +> id +> 6 77 16.01 1642 25.67 0.00 0 0.00 0.00 0 0.00 3 0 8 +> 2 87 +> 8 157 17.48 3541 60.43 0.00 0 0.00 0.00 0 0.00 24 0 28 +> 4 43 +> 5 673 17.66 2287 39.44 0.00 0 0.00 0.00 0 0.00 10 0 13 +> 2 75 +> 6 2818 16.37 2733 43.68 0.00 0 0.00 0.00 0 0.00 17 0 23 +> 3 56 +> 1 765 18.05 2401 42.32 0.00 0 0.00 0.00 0 0.00 15 0 17 +> 3 65 +> +> Note- the above was with no tuning to the kernel or postgresql.conf. +> +> Now for my question- it seems that I've still got quite a bit of +> headroom on the hardware I'm running the above tests on, since I know +> the array will pump out > 200 MB/s (dd, bonnie++ numbers), and CPU +> appears mostly idle. This would indicate I should be able to get some +> significantly better numbers with postgresql.conf tweaks correct? +> +> I guess the other problem is ensuring that we're not testing RAM speeds, +> since most of the data is probably in memory (BSD io buffers)? Although, +> for the initial run, that doesn't seem to be the case, since subsequent +> runs without rebuilding the benchmark db are slightly not believable +> (i.e. 1,200 going up to >2,500 tps over 5 back-to-back runs). So, as +> long as I re-initialize the benchdb before each run, it should be a +> realistic test, right? +> +> Thanks, +> +> Bucky +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Joshua D. +> Drake +> Sent: Tuesday, August 22, 2006 12:16 PM +> To: Marty Jia +> Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +> Rich Wilson; Ernest Wurzbach +> Subject: Re: [PERFORM] How to get higher tps +> +> Marty Jia wrote: +>> Here is iostat when running pgbench: +>> +>> avg-cpu: %user %nice %sys %iowait %idle +>> 26.17 0.00 8.25 23.17 42.42 +> +> You are are a little io bound and fairly cpu bound. I would be curious +> if your performance goes down if you increase the number of connections +> you are using. +> +> Joshua D. Drake +> +> +>> +>> Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +>> sda 0.00 0.00 0.00 0 0 +>> sda1 0.00 0.00 0.00 0 0 +>> sda2 0.00 0.00 0.00 0 0 +>> sda3 0.00 0.00 0.00 0 0 +>> sda4 0.00 0.00 0.00 0 0 +>> sda5 0.00 0.00 0.00 0 0 +>> sda6 0.00 0.00 0.00 0 0 +>> sda7 0.00 0.00 0.00 0 0 +>> sdb 0.00 0.00 0.00 0 0 +>> sdb1 0.00 0.00 0.00 0 0 +>> sdb2 0.00 0.00 0.00 0 0 +>> sdb3 0.00 0.00 0.00 0 0 +>> sdb4 0.00 0.00 0.00 0 0 +>> sdb5 0.00 0.00 0.00 0 0 +>> sdb6 0.00 0.00 0.00 0 0 +>> sdb7 0.00 0.00 0.00 0 0 +>> sdc 0.00 0.00 0.00 0 0 +>> sdd 0.00 0.00 0.00 0 0 +>> sde 0.00 0.00 0.00 0 0 +>> sdf 0.00 0.00 0.00 0 0 +>> sdg 0.00 0.00 0.00 0 0 +>> sdh 0.00 0.00 0.00 0 0 +>> sdi 40.33 0.00 413.33 0 1240 +>> sdj 34.33 0.00 394.67 0 1184 +>> sdk 36.00 0.00 410.67 0 1232 +>> sdl 37.00 0.00 429.33 0 1288 +>> sdm 375.00 0.00 3120.00 0 9360 +>> sdn 378.33 0.00 3120.00 0 9360 +>> +>> ________________________________ +>> +>> From: Alex Turner [mailto:armtuk@gmail.com] +>> Sent: Tuesday, August 22, 2006 11:27 AM +>> To: Mark Lewis +>> Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; +> DBAs; +>> Rich Wilson; Ernest Wurzbach +>> Subject: Re: [PERFORM] How to get higher tps +>> +>> +>> Oh - and it's usefull to know if you are CPU bound, or IO bound. +> Check +>> top or vmstat to get an idea of that +>> +>> Alex +>> +>> +>> On 8/22/06, Alex Turner < armtuk@gmail.com > +>> wrote: +>> +>> First things first, run a bonnie++ benchmark, and post the +> numbers. +>> That will give a good indication of raw IO performance, and +> is +>> often the first inidication of problems separate from the DB. We have +> +>> seen pretty bad performance from SANs in the past. How many FC lines +> do +>> you have running to your server, remember each line is limited to +> about +>> 200MB/sec, to get good throughput, you will need multiple connections. +> +>> +>> When you run pgbench, run a iostat also and see what the numbers +> say. +>> +>> +>> Alex. +>> +>> +>> +>> On 8/22/06, Mark Lewis < mark.lewis@mir3.com +>> > wrote: +>> +>> Well, at least on my test machines running +> gnome-terminal, my +>> pgbench +>> runs tend to get throttled by gnome-terminal's lousy +> performance to +>> no +>> more than 300 tps or so. Running with 2>/dev/null to +> throw away all +>> the +>> detailed logging gives me 2-3x improvement in scores. +>> Caveat: in my +>> case the db is on the local machine, so who knows what +> all the +>> interactions are. +>> +>> Also, when you initialized the pgbench db what scaling +> factor did +>> you +>> use? And does running pgbench with -v improve +> performance at all? +>> +>> -- Mark +>> +>> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +>> > Joshua, +>> > +>> > Here is +>> > +>> > shared_buffers = 80000 +>> > fsync = on +>> > max_fsm_pages = 350000 +>> > max_connections = 1000 +>> > work_mem = 65536 +>> > effective_cache_size = 610000 +>> > random_page_cost = 3 +>> > +>> > Here is pgbench I used: +>> > +>> > pgbench -c 10 -t 10000 -d HQDB +>> > +>> > Thanks +>> > +>> > Marty +>> > +>> > -----Original Message----- +>> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +>> > Sent: Monday, August 21, 2006 6:09 PM +>> > To: Marty Jia +>> > Cc: pgsql-performance@postgresql.org +>> > Subject: Re: [PERFORM] How to get higher tps +>> > +>> > Marty Jia wrote: +>> > > I'm exhausted to try all performance tuning ideas, +> like +>> following +>> > > parameters +>> > > +>> > > shared_buffers +>> > > fsync +>> > > max_fsm_pages +>> > > max_connections +>> > > shared_buffers +>> > > work_mem +>> > > max_fsm_pages +>> > > effective_cache_size +>> > > random_page_cost +>> > > +>> > > I believe all above have right size and values, but +> I just can +>> not get +>> > +>> > > higher tps more than 300 testd by pgbench +>> > +>> > What values did you use? +>> > +>> > > +>> > > Here is our hardware +>> > > +>> > > +>> > > Dual Intel Xeon 2.8GHz +>> > > 6GB RAM +>> > > Linux 2.4 kernel +>> > > RedHat Enterprise Linux AS 3 +>> > > 200GB for PGDATA on 3Par, ext3 +>> > > 50GB for WAL on 3Par, ext3 +>> > > +>> > > With PostgreSql 8.1.4 +>> > > +>> > > We don't have i/o bottle neck. +>> > +>> > Are you sure? What does iostat say during a pgbench? +>> What parameters are +>> > you passing to pgbench? +>> > +>> > Well in theory, upgrading to 2.6 kernel will help as +> well as +>> making your +>> > WAL ext2 instead of ext3. +>> > +>> > > Whatelse I can try to better tps? Someone told me I +> can should +>> get tps +>> > +>> > > over 1500, it is hard to believe. +>> > +>> > 1500? Hmmm... I don't know about that, I can get +> 470tps or so on +>> my +>> > measily dual core 3800 with 2gig of ram though. +>> > +>> > Joshua D. Drake +>> > +>> > +>> > > +>> > > Thanks +>> > > +>> > > Marty +>> > > +>> > > ---------------------------(end of +>> > > broadcast)--------------------------- +>> > > TIP 2: Don't 'kill -9' the postmaster +>> > > +>> > +>> > +>> +>> ---------------------------(end of +>> broadcast)--------------------------- +>> TIP 1: if posting/reading through Usenet, please send an +> appropriate +>> subscribe-nomail command to +>> majordomo@postgresql.org so that your +>> message can get through to the mailing list +> cleanly +>> +>> +>> +>> +>> +> +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 16:49:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 119549FA4E3 + for ; + Tue, 22 Aug 2006 16:49:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 18410-10 for + ; + Tue, 22 Aug 2006 16:49:09 -0300 (ADT) +X-Greylist: delayed 00:26:12.170898 by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-23.lumeta.com + [65.246.245.23]) + by postgresql.org (Postfix) with ESMTP id 6D2AB9FA430 + for ; + Tue, 22 Aug 2006 16:49:08 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 15:49:06 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104AC7@MAIL.corp.lumeta.com> +In-Reply-To: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E33E4@SITE3MAIL04.jeeves.ask.info> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbGBl1CFZlghdCVQiqjoKx+I4fwtwAF6o3gAADfN0AAAFuvgA== +From: "Bucky Jordan" +To: "Marty Jia" , + "Joshua D. Drake" +Cc: "Alex Turner" , "Mark Lewis" , + , "DBAs" , + "Rich Wilson" , "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.013 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/358 +X-Sequence-Number: 20543 + +As I mentioned, I haven't changed the defaults at all yet: +Fsync is still on...=20 + +shared_buffers =3D 1000 +max_fsm_pages =3D 20000 +max_connections =3D 40 +work_mem =3D 1024 +effective_cache_size =3D 1000 +random_page_cost =3D 4 + +I'm not sure how much the dual core woodcrests and faster memory are +helping my system. Your hardware should *theoretically* have better IO +performance, assuming you're actually making use of the 2x2GB/s FC +interfaces and external RAID. + +What do you get if you run the bench back-to-back without rebuilding the +test db? (Say pgbench -c 10 -t 10000 -d bench 2>/dev/null run 5 times in +a row)? Maybe that would put more stress on RAM/CPU? + +Seems to me your issue is with an underperforming IO subsystem- as +previously mentioned, you might want to check dd and bonnie++ (v 1.03) +numbers. + +time bash -c "(dd if=3D/dev/zero of=3Dbigfile count=3D125000 bs=3D8k && = +sync)" + +I get ~255 mb/s from the above. + +Bucky=20 + +-----Original Message----- +From: Marty Jia [mailto:mjia@ask.com]=20 +Sent: Tuesday, August 22, 2006 3:38 PM +To: Bucky Jordan; Joshua D. Drake +Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: RE: [PERFORM] How to get higher tps + +Bucky + +My best result is around 380. I believe your hardware is more efficient, +because no matter how I change the conf parameters, no improvement can +be obtained. I even turned fsync off. + +What is your values for the following parameters? + +shared_buffers =3D 80000 +max_fsm_pages =3D 350000 +max_connections =3D 1000 +work_mem =3D 65536 +effective_cache_size =3D 610000 +random_page_cost =3D 3 + +Thanks +Marty + +-----Original Message----- +From: Bucky Jordan [mailto:bjordan@lumeta.com]=20 +Sent: Tuesday, August 22, 2006 3:23 PM +To: Joshua D. Drake; Marty Jia +Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: RE: [PERFORM] How to get higher tps + +Marty, + +Here's pgbench results from a stock FreeBSD 6.1 amd64/PG 8.1.4 install +on a Dell Poweredge 2950 with 8gb ram, 2x3.0 dual-core woodcrest (4MB +cache/socket) with 6x300GB 10k SAS drives: + +pgbench -c 10 -t 10000 -d bench 2>/dev/null +pghost: pgport: (null) nclients: 10 nxacts: 10000 dbName: bench +`transaction type: TPC-B (sort of) scaling factor: 20 number of clients: +10 number of transactions per client: 10000 number of transactions +actually processed: 100000/100000 tps =3D 561.056729 (including +connections establishing) tps =3D 561.127760 (excluding connections +establishing) + +Here's some iostat samples during the test: + tty mfid0 da0 cd0 +cpu + tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in +id + 6 77 16.01 1642 25.67 0.00 0 0.00 0.00 0 0.00 3 0 8 +2 87 + 8 157 17.48 3541 60.43 0.00 0 0.00 0.00 0 0.00 24 0 28 +4 43 + 5 673 17.66 2287 39.44 0.00 0 0.00 0.00 0 0.00 10 0 13 +2 75 + 6 2818 16.37 2733 43.68 0.00 0 0.00 0.00 0 0.00 17 0 23 +3 56 + 1 765 18.05 2401 42.32 0.00 0 0.00 0.00 0 0.00 15 0 17 +3 65 + +Note- the above was with no tuning to the kernel or postgresql.conf.=20 + +Now for my question- it seems that I've still got quite a bit of +headroom on the hardware I'm running the above tests on, since I know +the array will pump out > 200 MB/s (dd, bonnie++ numbers), and CPU +appears mostly idle. This would indicate I should be able to get some +significantly better numbers with postgresql.conf tweaks correct? + +I guess the other problem is ensuring that we're not testing RAM speeds, +since most of the data is probably in memory (BSD io buffers)? Although, +for the initial run, that doesn't seem to be the case, since subsequent +runs without rebuilding the benchmark db are slightly not believable +(i.e. 1,200 going up to >2,500 tps over 5 back-to-back runs). So, as +long as I re-initialize the benchdb before each run, it should be a +realistic test, right? + +Thanks, + +Bucky +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Joshua D. +Drake +Sent: Tuesday, August 22, 2006 12:16 PM +To: Marty Jia +Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs; +Rich Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + +Marty Jia wrote: +> Here is iostat when running pgbench: +> =20 +> avg-cpu: %user %nice %sys %iowait %idle +> 26.17 0.00 8.25 23.17 42.42 + +You are are a little io bound and fairly cpu bound. I would be curious +if your performance goes down if you increase the number of connections +you are using. + +Joshua D. Drake + + +> =20 +> Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn +> sda 0.00 0.00 0.00 0 0 +> sda1 0.00 0.00 0.00 0 0 +> sda2 0.00 0.00 0.00 0 0 +> sda3 0.00 0.00 0.00 0 0 +> sda4 0.00 0.00 0.00 0 0 +> sda5 0.00 0.00 0.00 0 0 +> sda6 0.00 0.00 0.00 0 0 +> sda7 0.00 0.00 0.00 0 0 +> sdb 0.00 0.00 0.00 0 0 +> sdb1 0.00 0.00 0.00 0 0 +> sdb2 0.00 0.00 0.00 0 0 +> sdb3 0.00 0.00 0.00 0 0 +> sdb4 0.00 0.00 0.00 0 0 +> sdb5 0.00 0.00 0.00 0 0 +> sdb6 0.00 0.00 0.00 0 0 +> sdb7 0.00 0.00 0.00 0 0 +> sdc 0.00 0.00 0.00 0 0 +> sdd 0.00 0.00 0.00 0 0 +> sde 0.00 0.00 0.00 0 0 +> sdf 0.00 0.00 0.00 0 0 +> sdg 0.00 0.00 0.00 0 0 +> sdh 0.00 0.00 0.00 0 0 +> sdi 40.33 0.00 413.33 0 1240 +> sdj 34.33 0.00 394.67 0 1184 +> sdk 36.00 0.00 410.67 0 1232 +> sdl 37.00 0.00 429.33 0 1288 +> sdm 375.00 0.00 3120.00 0 9360 +> sdn 378.33 0.00 3120.00 0 9360 +>=20 +> ________________________________ +>=20 +> From: Alex Turner [mailto:armtuk@gmail.com] +> Sent: Tuesday, August 22, 2006 11:27 AM +> To: Mark Lewis +> Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; +DBAs; +> Rich Wilson; Ernest Wurzbach +> Subject: Re: [PERFORM] How to get higher tps +>=20 +>=20 +> Oh - and it's usefull to know if you are CPU bound, or IO bound. +Check +> top or vmstat to get an idea of that +>=20 +> Alex +>=20 +>=20 +> On 8/22/06, Alex Turner < armtuk@gmail.com > +> wrote:=20 +>=20 +> First things first, run a bonnie++ benchmark, and post the +numbers. =20 +> That will give a good indication of raw IO performance, and +is +> often the first inidication of problems separate from the DB. We have + +> seen pretty bad performance from SANs in the past. How many FC lines +do +> you have running to your server, remember each line is limited to +about +> 200MB/sec, to get good throughput, you will need multiple connections. + +> =09 +> When you run pgbench, run a iostat also and see what the numbers +say. +> =09 +> =09 +> Alex. +> =09 +> =09 +> =09 +> On 8/22/06, Mark Lewis < mark.lewis@mir3.com=20 +> > wrote: +>=20 +> Well, at least on my test machines running +gnome-terminal, my=20 +> pgbench +> runs tend to get throttled by gnome-terminal's lousy +performance to=20 +> no +> more than 300 tps or so. Running with 2>/dev/null to +throw away all=20 +> the +> detailed logging gives me 2-3x improvement in scores. +> Caveat: in my=20 +> case the db is on the local machine, so who knows what +all the +> interactions are. +> =09 +> Also, when you initialized the pgbench db what scaling +factor did=20 +> you +> use? And does running pgbench with -v improve +performance at all? +> =09 +> -- Mark +> =09 +> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +> > Joshua, +> > +> > Here is +> > +> > shared_buffers =3D 80000 +> > fsync =3D on +> > max_fsm_pages =3D 350000 +> > max_connections =3D 1000=20 +> > work_mem =3D 65536 +> > effective_cache_size =3D 610000 +> > random_page_cost =3D 3 +> > +> > Here is pgbench I used: +> > +> > pgbench -c 10 -t 10000 -d HQDB +> > +> > Thanks +> > +> > Marty=20 +> > +> > -----Original Message----- +> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +> > Sent: Monday, August 21, 2006 6:09 PM +> > To: Marty Jia +> > Cc: pgsql-performance@postgresql.org +> > Subject: Re: [PERFORM] How to get higher tps +> > +> > Marty Jia wrote: +> > > I'm exhausted to try all performance tuning ideas, +like=20 +> following +> > > parameters +> > > +> > > shared_buffers +> > > fsync +> > > max_fsm_pages +> > > max_connections +> > > shared_buffers +> > > work_mem +> > > max_fsm_pages +> > > effective_cache_size +> > > random_page_cost +> > > +> > > I believe all above have right size and values, but +I just can=20 +> not get +> > +> > > higher tps more than 300 testd by pgbench=20 +> > +> > What values did you use? +> > +> > > +> > > Here is our hardware +> > > +> > > +> > > Dual Intel Xeon 2.8GHz +> > > 6GB RAM +> > > Linux 2.4 kernel +> > > RedHat Enterprise Linux AS 3=20 +> > > 200GB for PGDATA on 3Par, ext3 +> > > 50GB for WAL on 3Par, ext3 +> > > +> > > With PostgreSql 8.1.4 +> > > +> > > We don't have i/o bottle neck. +> > +> > Are you sure? What does iostat say during a pgbench? +> What parameters are=20 +> > you passing to pgbench? +> > +> > Well in theory, upgrading to 2.6 kernel will help as +well as=20 +> making your +> > WAL ext2 instead of ext3. +> > +> > > Whatelse I can try to better tps? Someone told me I +can should=20 +> get tps +> > +> > > over 1500, it is hard to believe. +> > +> > 1500? Hmmm... I don't know about that, I can get +470tps or so on=20 +> my +> > measily dual core 3800 with 2gig of ram though. +> > +> > Joshua D. Drake=20 +> > +> > +> > > +> > > Thanks +> > > +> > > Marty +> > > +> > > ---------------------------(end of +> > > broadcast)--------------------------- +> > > TIP 2: Don't 'kill -9' the postmaster=20 +> > > +> > +> > +> =09 +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an +appropriate +> subscribe-nomail command to +> majordomo@postgresql.org so that your +> message can get through to the mailing list +cleanly +> =09 +>=20 +>=20 +>=20 +>=20 + + +--=20 + + =3D=3D=3D The PostgreSQL Company: Command Prompt, Inc. =3D=3D=3D +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +---------------------------(end of broadcast)--------------------------- +TIP 4: Have you searched our list archives? + + http://archives.postgresql.org + +From pgsql-performance-owner@postgresql.org Tue Aug 22 17:33:32 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DF39D9FB387 + for ; + Tue, 22 Aug 2006 17:33:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 21558-09 for + ; + Tue, 22 Aug 2006 17:33:16 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from SITE3MAIL04.jeeves.ask.info (site3mail04.jeeves.ask.info + [63.108.110.50]) + by postgresql.org (Postfix) with ESMTP id BAF7F9FB37B + for ; + Tue, 22 Aug 2006 17:33:15 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: How to get higher tps +Date: Tue, 22 Aug 2006 16:35:14 -0400 +Message-ID: + <0B9A8C89DCC3AB488A78A4DE0FECDA90019E3448@SITE3MAIL04.jeeves.ask.info> +In-Reply-To: <44EB5D33.3030300@commandprompt.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] How to get higher tps +Thread-Index: AcbGItuH8qCEcFPRRW2LNYiK+W/gRQAB2bJQ +From: "Marty Jia" +To: "Joshua D. Drake" +Cc: "Bucky Jordan" , "Alex Turner" , + "Mark Lewis" , , + "DBAs" , "Rich Wilson" , + "Ernest Wurzbach" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.086 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/359 +X-Sequence-Number: 20544 + +Here is, it's first time I got tps > 400 + +10 clients: + +[pgsql@prdhqdb2:/pgsql/database]pgbench -c 10 -t 10000 -v -d pgbench +2>/dev/null +pghost: pgport: (null) nclients: 10 nxacts: 10000 dbName: pgbench +transaction type: TPC-B (sort of) +scaling factor: 1 +number of clients: 10 +number of transactions per client: 10000 +number of transactions actually processed: 100000/100000 +tps =3D 413.022562 (including connections establishing) +tps =3D 413.125733 (excluding connections establishing) + +20 clients: + +[pgsql@prdhqdb2:/pgsql/database]pgbench -c 20 -t 10000 -v -d pgbench +2>/dev/null +pghost: pgport: (null) nclients: 20 nxacts: 10000 dbName: pgbench +transaction type: TPC-B (sort of) +scaling factor: 1 +number of clients: 20 +number of transactions per client: 10000 +number of transactions actually processed: 200000/200000 +tps =3D 220.759983 (including connections establishing) +tps =3D 220.790077 (excluding connections establishing) +=20 + +-----Original Message----- +From: Joshua D. Drake [mailto:jd@commandprompt.com]=20 +Sent: Tuesday, August 22, 2006 3:38 PM +To: Marty Jia +Cc: Bucky Jordan; Alex Turner; Mark Lewis; +pgsql-performance@postgresql.org; DBAs; Rich Wilson; Ernest Wurzbach +Subject: Re: [PERFORM] How to get higher tps + +Marty Jia wrote: +> Bucky +>=20 +> My best result is around 380. I believe your hardware is more=20 +> efficient, because no matter how I change the conf parameters, no=20 +> improvement can be obtained. I even turned fsync off. + +Do you stay constant if you use 40 clients versus 20? + +>=20 +> What is your values for the following parameters? +>=20 +> shared_buffers =3D 80000 +> max_fsm_pages =3D 350000 +> max_connections =3D 1000 +> work_mem =3D 65536 +> effective_cache_size =3D 610000 +> random_page_cost =3D 3 +>=20 +> Thanks +> Marty +>=20 +> -----Original Message----- +> From: Bucky Jordan [mailto:bjordan@lumeta.com] +> Sent: Tuesday, August 22, 2006 3:23 PM +> To: Joshua D. Drake; Marty Jia +> Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs;=20 +> Rich Wilson; Ernest Wurzbach +> Subject: RE: [PERFORM] How to get higher tps +>=20 +> Marty, +>=20 +> Here's pgbench results from a stock FreeBSD 6.1 amd64/PG 8.1.4 install + +> on a Dell Poweredge 2950 with 8gb ram, 2x3.0 dual-core woodcrest (4MB +> cache/socket) with 6x300GB 10k SAS drives: +>=20 +> pgbench -c 10 -t 10000 -d bench 2>/dev/null +> pghost: pgport: (null) nclients: 10 nxacts: 10000 dbName: bench=20 +> `transaction type: TPC-B (sort of) scaling factor: 20 number of +clients: +> 10 number of transactions per client: 10000 number of transactions=20 +> actually processed: 100000/100000 tps =3D 561.056729 (including=20 +> connections establishing) tps =3D 561.127760 (excluding connections +> establishing) +>=20 +> Here's some iostat samples during the test: +> tty mfid0 da0 cd0 +> cpu +> tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy +in +> id +> 6 77 16.01 1642 25.67 0.00 0 0.00 0.00 0 0.00 3 0 8 +> 2 87 +> 8 157 17.48 3541 60.43 0.00 0 0.00 0.00 0 0.00 24 0 28 +> 4 43 +> 5 673 17.66 2287 39.44 0.00 0 0.00 0.00 0 0.00 10 0 13 +> 2 75 +> 6 2818 16.37 2733 43.68 0.00 0 0.00 0.00 0 0.00 17 0 23 +> 3 56 +> 1 765 18.05 2401 42.32 0.00 0 0.00 0.00 0 0.00 15 0 17 +> 3 65 +>=20 +> Note- the above was with no tuning to the kernel or postgresql.conf.=20 +>=20 +> Now for my question- it seems that I've still got quite a bit of=20 +> headroom on the hardware I'm running the above tests on, since I know=20 +> the array will pump out > 200 MB/s (dd, bonnie++ numbers), and CPU=20 +> appears mostly idle. This would indicate I should be able to get some=20 +> significantly better numbers with postgresql.conf tweaks correct? +>=20 +> I guess the other problem is ensuring that we're not testing RAM=20 +> speeds, since most of the data is probably in memory (BSD io buffers)? + +> Although, for the initial run, that doesn't seem to be the case, since + +> subsequent runs without rebuilding the benchmark db are slightly not=20 +> believable (i.e. 1,200 going up to >2,500 tps over 5 back-to-back=20 +> runs). So, as long as I re-initialize the benchdb before each run, it=20 +> should be a realistic test, right? +>=20 +> Thanks, +>=20 +> Bucky +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Joshua D. +> Drake +> Sent: Tuesday, August 22, 2006 12:16 PM +> To: Marty Jia +> Cc: Alex Turner; Mark Lewis; pgsql-performance@postgresql.org; DBAs;=20 +> Rich Wilson; Ernest Wurzbach +> Subject: Re: [PERFORM] How to get higher tps +>=20 +> Marty Jia wrote: +>> Here is iostat when running pgbench: +>> =20 +>> avg-cpu: %user %nice %sys %iowait %idle +>> 26.17 0.00 8.25 23.17 42.42 +>=20 +> You are are a little io bound and fairly cpu bound. I would be curious + +> if your performance goes down if you increase the number of=20 +> connections you are using. +>=20 +> Joshua D. Drake +>=20 +>=20 +>> =20 +>> Device: tps Blk_read/s Blk_wrtn/s Blk_read +Blk_wrtn +>> sda 0.00 0.00 0.00 0 +0 +>> sda1 0.00 0.00 0.00 0 +0 +>> sda2 0.00 0.00 0.00 0 +0 +>> sda3 0.00 0.00 0.00 0 +0 +>> sda4 0.00 0.00 0.00 0 +0 +>> sda5 0.00 0.00 0.00 0 +0 +>> sda6 0.00 0.00 0.00 0 +0 +>> sda7 0.00 0.00 0.00 0 +0 +>> sdb 0.00 0.00 0.00 0 +0 +>> sdb1 0.00 0.00 0.00 0 +0 +>> sdb2 0.00 0.00 0.00 0 +0 +>> sdb3 0.00 0.00 0.00 0 +0 +>> sdb4 0.00 0.00 0.00 0 +0 +>> sdb5 0.00 0.00 0.00 0 +0 +>> sdb6 0.00 0.00 0.00 0 +0 +>> sdb7 0.00 0.00 0.00 0 +0 +>> sdc 0.00 0.00 0.00 0 +0 +>> sdd 0.00 0.00 0.00 0 +0 +>> sde 0.00 0.00 0.00 0 +0 +>> sdf 0.00 0.00 0.00 0 +0 +>> sdg 0.00 0.00 0.00 0 +0 +>> sdh 0.00 0.00 0.00 0 +0 +>> sdi 40.33 0.00 413.33 0 +1240 +>> sdj 34.33 0.00 394.67 0 +1184 +>> sdk 36.00 0.00 410.67 0 +1232 +>> sdl 37.00 0.00 429.33 0 +1288 +>> sdm 375.00 0.00 3120.00 0 +9360 +>> sdn 378.33 0.00 3120.00 0 +9360 +>> +>> ________________________________ +>> +>> From: Alex Turner [mailto:armtuk@gmail.com] +>> Sent: Tuesday, August 22, 2006 11:27 AM +>> To: Mark Lewis +>> Cc: Marty Jia; Joshua D. Drake; pgsql-performance@postgresql.org; +> DBAs; +>> Rich Wilson; Ernest Wurzbach +>> Subject: Re: [PERFORM] How to get higher tps +>> +>> +>> Oh - and it's usefull to know if you are CPU bound, or IO bound. +> Check +>> top or vmstat to get an idea of that +>> +>> Alex +>> +>> +>> On 8/22/06, Alex Turner < armtuk@gmail.com =20 +>> > +>> wrote:=20 +>> +>> First things first, run a bonnie++ benchmark, and post the +> numbers. =20 +>> That will give a good indication of raw IO performance, and +> is +>> often the first inidication of problems separate from the DB. We=20 +>> have +>=20 +>> seen pretty bad performance from SANs in the past. How many FC lines +> do +>> you have running to your server, remember each line is limited to +> about +>> 200MB/sec, to get good throughput, you will need multiple +connections. +>=20 +>> =09 +>> When you run pgbench, run a iostat also and see what the numbers +> say. +>> =09 +>> =09 +>> Alex. +>> =09 +>> =09 +>> =09 +>> On 8/22/06, Mark Lewis < mark.lewis@mir3.com=20 +>> > wrote: +>> +>> Well, at least on my test machines running +> gnome-terminal, my +>> pgbench +>> runs tend to get throttled by gnome-terminal's lousy +> performance to +>> no +>> more than 300 tps or so. Running with 2>/dev/null to +> throw away all +>> the +>> detailed logging gives me 2-3x improvement in scores. +>> Caveat: in my=20 +>> case the db is on the local machine, so who knows what +> all the +>> interactions are. +>> =09 +>> Also, when you initialized the pgbench db what scaling +> factor did +>> you +>> use? And does running pgbench with -v improve +> performance at all? +>> =09 +>> -- Mark +>> =09 +>> On Tue, 2006-08-22 at 09:19 -0400, Marty Jia wrote: +>> > Joshua, +>> > +>> > Here is +>> > +>> > shared_buffers =3D 80000 +>> > fsync =3D on +>> > max_fsm_pages =3D 350000 +>> > max_connections =3D 1000=20 +>> > work_mem =3D 65536 +>> > effective_cache_size =3D 610000 +>> > random_page_cost =3D 3 +>> > +>> > Here is pgbench I used: +>> > +>> > pgbench -c 10 -t 10000 -d HQDB +>> > +>> > Thanks +>> > +>> > Marty=20 +>> > +>> > -----Original Message----- +>> > From: Joshua D. Drake [mailto:jd@commandprompt.com] +>> > Sent: Monday, August 21, 2006 6:09 PM +>> > To: Marty Jia +>> > Cc: pgsql-performance@postgresql.org +>> > Subject: Re: [PERFORM] How to get higher tps +>> > +>> > Marty Jia wrote: +>> > > I'm exhausted to try all performance tuning ideas, +> like +>> following +>> > > parameters +>> > > +>> > > shared_buffers +>> > > fsync +>> > > max_fsm_pages +>> > > max_connections +>> > > shared_buffers +>> > > work_mem +>> > > max_fsm_pages +>> > > effective_cache_size +>> > > random_page_cost +>> > > +>> > > I believe all above have right size and values, but +> I just can +>> not get +>> > +>> > > higher tps more than 300 testd by pgbench=20 +>> > +>> > What values did you use? +>> > +>> > > +>> > > Here is our hardware +>> > > +>> > > +>> > > Dual Intel Xeon 2.8GHz +>> > > 6GB RAM +>> > > Linux 2.4 kernel +>> > > RedHat Enterprise Linux AS 3=20 +>> > > 200GB for PGDATA on 3Par, ext3 +>> > > 50GB for WAL on 3Par, ext3 +>> > > +>> > > With PostgreSql 8.1.4 +>> > > +>> > > We don't have i/o bottle neck. +>> > +>> > Are you sure? What does iostat say during a pgbench? +>> What parameters are=20 +>> > you passing to pgbench? +>> > +>> > Well in theory, upgrading to 2.6 kernel will help as +> well as +>> making your +>> > WAL ext2 instead of ext3. +>> > +>> > > Whatelse I can try to better tps? Someone told me I +> can should +>> get tps +>> > +>> > > over 1500, it is hard to believe. +>> > +>> > 1500? Hmmm... I don't know about that, I can get +> 470tps or so on +>> my +>> > measily dual core 3800 with 2gig of ram though. +>> > +>> > Joshua D. Drake=20 +>> > +>> > +>> > > +>> > > Thanks +>> > > +>> > > Marty +>> > > +>> > > ---------------------------(end of +>> > > broadcast)--------------------------- +>> > > TIP 2: Don't 'kill -9' the postmaster=20 +>> > > +>> > +>> > +>> =09 +>> ---------------------------(end of +>> broadcast)--------------------------- +>> TIP 1: if posting/reading through Usenet, please send an +> appropriate +>> subscribe-nomail command to +>> majordomo@postgresql.org so that your +>> message can get through to the mailing list +> cleanly +>> =09 +>> +>> +>> +>> +>=20 +>=20 + + +--=20 + + =3D=3D=3D The PostgreSQL Company: Command Prompt, Inc. =3D=3D=3D +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 17:59:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 988729FB37B + for ; + Tue, 22 Aug 2006 17:59:52 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28970-02 for + ; + Tue, 22 Aug 2006 17:59:41 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from xena.bway.net (xena.bway.net [216.220.96.26]) + by postgresql.org (Postfix) with ESMTP id 7A01D9FB38B + for ; + Tue, 22 Aug 2006 17:59:41 -0300 (ADT) +Received: (qmail 73938 invoked by uid 0); 22 Aug 2006 20:59:39 -0000 +Received: from unknown (HELO white.nat.fasttrackmonkey.com) + (spork@bway.net@216.220.116.154) + by smtp.bway.net with (DHE-RSA-AES256-SHA encrypted) SMTP; + 22 Aug 2006 20:59:39 -0000 +Date: Tue, 22 Aug 2006 16:59:38 -0400 (EDT) +From: Charles Sprickman +X-X-Sender: spork@white.nat.fasttrackmonkey.com +To: pgsql-performance@postgresql.org +Subject: Benchmarks +Message-ID: +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.101 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/360 +X-Sequence-Number: 20545 + +Hi all, + +I'm really glad to see all the test results people are posting here. In +fact, I used info from the archives to put together our first "big" +database host: + +-Tyan dual-core/dual-cpu mainboard ( +-One Opteron 270 2.0GHz (although our vendor gave us two for some reason) +-Chenbro 3U case (RM31212B) - OK, but not very well thought-out +-8 Seagate SATA drives (yes, we stuck with our vendor of choice, WD +Raptors may have been a better choice) +-3Ware 9550SX-12MI +-2GB RAM (we'll get more when we need it) + +So this thing is sitting next to my desk and I'd like to see just how this +compares to other hardware. We already know that it will blow away our +normal dual-xeon 1Us with just two U320 drives on Adaptec 2120s ZCR cards. +We also know that for what this box will be doing (mailing list archives +with msgs stored in Postgres) it's going to be more than enough for the +next few years... + +So what are people using to get a general feel for the bang/buck ratio? +I've toyed with Bonnie, IOZone and simple "dd" writes. I'd like to go a +little further and actually hit Postgres to see how the entire system +performs. My reasons are, in no particular order: + +-to learn something (general and pgsql tuning) +-to help guide future database server builds +-to take the benchmark data and share it somewhere + +The first one is obvious. Matching software to hardware is really hard +and there aren't too many people that can do it well. + +The second is a pretty big deal - we've been doing all 1U builds and +currently spread our load amongst individual db servers that also do the +web front end for mailing list management. This has worked OK, but we may +want to peel off the db section and start moving towards two large boxes +like this with one replicating the other as a backup. + +That last one is a stickler. I've seen so much data posted on this list, +is there any project in the works to collect this? It seems like some +RAID hardware just totally sucks (cough *Adaptec* cough). Having a site +that listed results for the more common benchmarks and sorting it out by +hardware would help reduce the number of people that get burned by buying +overpriced/underperforming RAID controllers/SANs. + +Any thoughts on all this? + +I'll be throwing in some quick stats on the box described above later +today... At first glance, the 3Ware controller is really looking like an +excellent value. + +Thanks, + +Charles + +From pgsql-performance-owner@postgresql.org Tue Aug 22 18:12:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id BF98C9FB255 + for ; + Tue, 22 Aug 2006 18:12:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 62877-07 for + ; + Tue, 22 Aug 2006 21:12:36 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 21A929FA4D9 + for ; + Tue, 22 Aug 2006 18:12:36 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7MLCXX5011770; + Tue, 22 Aug 2006 17:12:33 -0400 (EDT) +To: espero7757@gmx.net +cc: pgsql-performance@postgresql.org +Subject: Re: query planner: automatic rescribe of LIKE to BETWEEN ? +In-reply-to: <200608221922.59734.espero7757@gmx.net> +References: <200608221922.59734.espero7757@gmx.net> +Comments: In-reply-to Ulrich Habel + message dated "Tue, 22 Aug 2006 19:22:59 +0200" +Date: Tue, 22 Aug 2006 17:12:33 -0400 +Message-ID: <11769.1156281153@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/361 +X-Sequence-Number: 20546 + +Ulrich Habel writes: +> Anythings speeks against this hack? + +Only that it was done years ago. + +As Alvaro mentions, if you are using a non-C locale then you need +non-default index opclasses to get it to work. Non-C locales usually +have index sort orders that don't play nice with this conversion. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 22 18:34:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D1F5C9FB37B + for ; + Tue, 22 Aug 2006 18:34:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 42466-02 for + ; + Tue, 22 Aug 2006 18:34:12 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id E30209FA4D9 + for ; + Tue, 22 Aug 2006 18:34:11 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) id 1GFdss-0007fZ-JC + for pgsql-performance@postgresql.org; Tue, 22 Aug 2006 14:34:06 -0700 +Subject: PowerEdge 2950 questions +From: Jeff Davis +To: pgsql-performance@postgresql.org +Content-Type: text/plain; charset=UTF-8 +Date: Tue, 22 Aug 2006 14:34:08 -0700 +Message-Id: <1156282448.15743.88.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.272 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/362 +X-Sequence-Number: 20547 + +This question is related to the thread: +http://archives.postgresql.org/pgsql-performance/2006-08/msg00152.php +but I had some questions. + +I am looking at setting up two general-purpose database servers, +replicated with Slony. Each server I'm looking at has the following +specs: + +Dell PowerEdge 2950 +- 2 x Dual Core Intel=C2=AE Xeon=C2=AE 5130, 4MB Cache, 2.00GHz, 1333MHZ FS= +B +- 4GB RAM +- PERC 5/i, x6 Backplane, Integrated Controller Card (256MB battery- +backed cache) +- 6 x 73GB, SAS, 3.5-inch, 15K RPM Hard Drive arranged in RAID 10 + +These servers are reasonably priced and so they seem like a good choice +for the overall price, and the above thread indicated good performance. +However, I want to make sure that putting WAL in with PGDATA on the +RAID-10 is wise. And if there are any other suggestions that would be +great. Is the RAID controller good? Are the processors good for database +work or are Opterons significantly better? + +I may go for more storage as well (i.e. getting 300GB disks), but I am +still determining the potential need for storage. I can get more RAM at +a later date if necessary also. + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 18:56:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5F3999FB3A1 + for ; + Tue, 22 Aug 2006 18:56:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 88838-07 for + ; + Tue, 22 Aug 2006 21:56:15 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-23.lumeta.com + [65.246.245.23]) + by postgresql.org (Postfix) with ESMTP id A676C9FB25B + for ; + Tue, 22 Aug 2006 18:56:14 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: PowerEdge 2950 questions +Date: Tue, 22 Aug 2006 17:56:12 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> +In-Reply-To: <1156282448.15743.88.camel@dogma.v10.wvs> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] PowerEdge 2950 questions +Thread-Index: AcbGMsl+6StulaV6RHmLpLZZRXPvowAAFJ5w +From: "Bucky Jordan" +To: "Jeff Davis" , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/363 +X-Sequence-Number: 20548 + +Hi Jeff, + +My experience with the 2950 seemed to indicate that RAID10x6 disks did +not perform as well as RAID5x6. I believe I posted some numbers to +illustrate this in the post you mentioned.=20 + +If I remember correctly, the numbers were pretty close, but I was +expecting RAID10 to significantly beat RAID5. However, with 6 disks, +RAID5 starts performing a little better, and it also has good storage +utilization (i.e. you're only loosing 1 disk's worth of storage, so with +6 drives, you still have 83% - 5/6 - of your storage available, as +opposed to 50% with RAID10).=20 + +Keep in mind that with 6 disks, theoretically (your mileage may vary by +raid controller implementation) you have more fault tolerance with +RAID10 than with RAID5. + +Also, I don't think there's a lot of performance gain to going with the +15k drives over the 10k. Even dell only says a 10% boost. I've +benchmarked a single drive configuration, 10k vs 15k rpm, and yes, the +15k had substantially better seek times, but raw io isn't much +different, so again, it depends on your application's needs. + +Lastly, re your question on putting the WAL on the RAID10- I currently +have the box setup as RAID5x6 with the WAL and PGDATA all on the same +raidset. I haven't had the chance to do extensive tests, but from +previous readings, I gather that if you have write-back enabled on the +RAID, it should be ok (which it is in my case). + +As to how this compares with an Opteron system, if someone has some +pgbench (or other test) suggestions and a box to compare with, I'd be +happy to run the same on the 2950. (The 2950 is a 2-cpu dual core 3.0 +ghz box, 8GB ram with 6 disks, running FreeBSD 6.1 amd64 RELEASE if +you're interested in picking a "fair" opteron equivalent ;) + +Thanks, + +Bucky + + + + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Jeff Davis +Sent: Tuesday, August 22, 2006 5:34 PM +To: pgsql-performance@postgresql.org +Subject: [PERFORM] PowerEdge 2950 questions + +This question is related to the thread: +http://archives.postgresql.org/pgsql-performance/2006-08/msg00152.php +but I had some questions. + +I am looking at setting up two general-purpose database servers, +replicated with Slony. Each server I'm looking at has the following +specs: + +Dell PowerEdge 2950 +- 2 x Dual Core Intel(r) Xeon(r) 5130, 4MB Cache, 2.00GHz, 1333MHZ FSB +- 4GB RAM +- PERC 5/i, x6 Backplane, Integrated Controller Card (256MB battery- +backed cache) +- 6 x 73GB, SAS, 3.5-inch, 15K RPM Hard Drive arranged in RAID 10 + +These servers are reasonably priced and so they seem like a good choice +for the overall price, and the above thread indicated good performance. +However, I want to make sure that putting WAL in with PGDATA on the +RAID-10 is wise. And if there are any other suggestions that would be +great. Is the RAID controller good? Are the processors good for database +work or are Opterons significantly better? + +I may go for more storage as well (i.e. getting 300GB disks), but I am +still determining the potential need for storage. I can get more RAM at +a later date if necessary also. + +Regards, + Jeff Davis + + +---------------------------(end of broadcast)--------------------------- +TIP 6: explain analyze is your friend + +From pgsql-performance-owner@postgresql.org Tue Aug 22 19:00:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4D1929FB2AA + for ; + Tue, 22 Aug 2006 19:00:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 21648-01 for + ; + Tue, 22 Aug 2006 22:00:29 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id E38789FA15F + for ; + Tue, 22 Aug 2006 19:00:28 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) + id 1GFeIJ-0008No-N2; Tue, 22 Aug 2006 15:00:23 -0700 +Subject: Re: VACUUM FULL needed sometimes to prevent transaction +From: Jeff Davis +To: Marinos Yannikos +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44EB48A9.7030704@geizhals.at> +References: <44EB48A9.7030704@geizhals.at> +Content-Type: text/plain +Date: Tue, 22 Aug 2006 15:00:25 -0700 +Message-Id: <1156284025.15743.104.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/364 +X-Sequence-Number: 20549 + +On Tue, 2006-08-22 at 20:10 +0200, Marinos Yannikos wrote: +> Hello, +> +> we're looking into the reason why we are getting warnings about +> transaction ID wraparound despite a daily "vaccumdb -qaz". Someone is +> claiming that VACUUM without FULL cannot reassign XIDs properly when +> max_fsm_pages was set too low (it says so here too, but this is rather +> old: http://www.varlena.com/GeneralBits/Tidbits/perf.html#maxfsmp). Is +> this true, or do we have a different issue here? We're using 8.1.3 with +> a database generated on 8.1.3 (i.e. not migrated from 7.x or anything +> like that). + +Usually this is caused by either: +(1) You're not vacuuming as a superuser, so it's not able to vacuum +everything. +(2) You have a long-running transaction that never completed for some +strange reason. + +Hope this helps, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 19:23:27 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 495BE9FB1E7 + for ; + Tue, 22 Aug 2006 19:23:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 99146-09 for + ; + Tue, 22 Aug 2006 22:23:06 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id 30A8C9FA38D + for ; + Tue, 22 Aug 2006 19:23:05 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) + id 1GFee4-0000Ho-7z; Tue, 22 Aug 2006 15:22:52 -0700 +Subject: Re: PowerEdge 2950 questions +From: Jeff Davis +To: Bucky Jordan +Cc: pgsql-performance@postgresql.org +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> +Content-Type: text/plain +Date: Tue, 22 Aug 2006 15:22:54 -0700 +Message-Id: <1156285374.15743.118.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/365 +X-Sequence-Number: 20550 + +On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> Hi Jeff, +> +> My experience with the 2950 seemed to indicate that RAID10x6 disks did +> not perform as well as RAID5x6. I believe I posted some numbers to +> illustrate this in the post you mentioned. +> + +Very interesting. I always hear that people avoid RAID 5 on database +servers, but I suppose it always depends. Is the parity calculation +something that may increase commit latency vs. a RAID 10? That's +normally the explanation that I get. + +> If I remember correctly, the numbers were pretty close, but I was +> expecting RAID10 to significantly beat RAID5. However, with 6 disks, +> RAID5 starts performing a little better, and it also has good storage +> utilization (i.e. you're only loosing 1 disk's worth of storage, so with +> 6 drives, you still have 83% - 5/6 - of your storage available, as +> opposed to 50% with RAID10). + +Right, RAID 5 is certainly tempting since I get so much more storage. + +> Keep in mind that with 6 disks, theoretically (your mileage may vary by +> raid controller implementation) you have more fault tolerance with +> RAID10 than with RAID5. + +I'll also have the Slony system, so I think my degree of safety is still +quite high with RAID-5. + +> Also, I don't think there's a lot of performance gain to going with the +> 15k drives over the 10k. Even dell only says a 10% boost. I've +> benchmarked a single drive configuration, 10k vs 15k rpm, and yes, the +> 15k had substantially better seek times, but raw io isn't much +> different, so again, it depends on your application's needs. + +Do you think the seek time may affect transaction commit time though, +rather than just throughput? Or does it not make much difference since +we have writeback? + +> Lastly, re your question on putting the WAL on the RAID10- I currently +> have the box setup as RAID5x6 with the WAL and PGDATA all on the same +> raidset. I haven't had the chance to do extensive tests, but from +> previous readings, I gather that if you have write-back enabled on the +> RAID, it should be ok (which it is in my case). + +Ok, I won't worry about that then. + +> As to how this compares with an Opteron system, if someone has some +> pgbench (or other test) suggestions and a box to compare with, I'd be +> happy to run the same on the 2950. (The 2950 is a 2-cpu dual core 3.0 +> ghz box, 8GB ram with 6 disks, running FreeBSD 6.1 amd64 RELEASE if +> you're interested in picking a "fair" opteron equivalent ;) +> + +Based on your results, I think the Intels should be fine. Does each of +the cores have independent access to memory (therefore making memory +access more parallel)? + +Thanks very much for the information! + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Tue Aug 22 22:13:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 61EE79FB257 + for ; + Tue, 22 Aug 2006 22:13:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 30859-03 for + ; + Tue, 22 Aug 2006 22:13:10 -0300 (ADT) +X-Greylist: delayed 00:26:42.729457 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 518279FB253 + for ; + Tue, 22 Aug 2006 22:13:10 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mxca2.corp.netopia.com (mx-us-west.netopia.com + [65.206.239.221]) + by svr4.postgresql.org (Postfix) with ESMTP id 3302B5AF025 + for ; + Wed, 23 Aug 2006 00:46:26 +0000 (GMT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Query tuning +Date: Tue, 22 Aug 2006 17:46:22 -0700 +Message-ID: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Query tuning +Thread-Index: AcbGMtxexAaYHvwhQuGYQDO51Sk1+AAGJh1w +From: "Subbiah, Stalin" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.384 tagged_above=0 required=5 tests=SPF_SOFTFAIL +X-Spam-Level: * +X-Archive-Number: 200608/366 +X-Sequence-Number: 20551 + +Hello All, + +This query runs forever and ever. Nature of this table being lots of +inserts/deletes/query, I vacuum it every half hour to keep the holes +reusable and nightly once vacuum analyze to update the optimizer. We've +got index on eventtime only. Running it for current day uses index range +scan and it runs within acceptable time. Below is the explain of the +query. Is the order by sequencenum desc prevents from applying limit +optimization? + +explain SELECT * +FROM EVENTLOG=20 +WHERE EVENTTIME>'07/23/06 16:00:00'=20 +AND EVENTTIME<'08/22/06 16:00:00'=20 +AND (OBJDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 + OR OBJID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 + OR USERDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA')=20 +ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 0; +=20 +QUERY PLAN + +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------- + Limit (cost=3D15546930.29..15546931.54 rows=3D500 width=3D327) + -> Sort (cost=3D15546930.29..15581924.84 rows=3D13997819 = +width=3D327) + Sort Key: eventtime, sequencenum + -> Seq Scan on eventlog (cost=3D0.00..2332700.25 = +rows=3D13997819 +width=3D327) + Filter: ((eventtime > '2006-07-23 16:00:00'::timestamp +without time zone) AND (eventtime < '2006-08-22 16:00:00'::timestamp +without time zone) AND (((objdomainid)::text =3D +'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text =3D +'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text =3D +'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +(5 rows) + +Thanks, +Stalin +Pg version 8.0.1, suse 64bit. + +From pgsql-performance-owner@postgresql.org Tue Aug 22 22:17:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 211D29FB257 + for ; + Tue, 22 Aug 2006 22:17:40 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 21864-10 for + ; + Wed, 23 Aug 2006 01:17:23 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from moonunit2.moonview.localnet (wsip-70-167-125-69.sd.sd.cox.net + [70.167.125.69]) + by postgresql.org (Postfix) with ESMTP id DBB469FB253 + for ; + Tue, 22 Aug 2006 22:17:22 -0300 (ADT) +Received: from [192.168.0.3] (moonunit3.moonview.localnet [192.168.0.3]) + by moonunit2.moonview.localnet (8.13.1/8.13.1) with ESMTP id + k7N1L4PZ000906 + for ; Tue, 22 Aug 2006 18:21:05 -0700 +Message-ID: <44EBAC86.7070503@modgraph-usa.com> +Date: Tue, 22 Aug 2006 18:16:54 -0700 +From: "Craig A. James" +User-Agent: Thunderbird 1.5.0.5 (X11/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Moving a tablespace +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/367 +X-Sequence-Number: 20552 + +Suppose, hypothetically of course, someone lacked foresight, and put a tablespace somewhere with a dumb name, like "/disk2", instead of using a symbolic link with a more descriptive name. And then /disk2 needs to be renamed, say to "/postgres_data", and this (hypothetical) DBA realizes he has made a dumb mistake. + +Is there a way to move a tablespace to a new location without a dump/restore? I, er, this hypothetical guy, knows he can move it and put a symbolic link in for /disk2, but this is somewhat unsatisfactory since "/disk2" would have to exist forever. + +Thanks, +Craig + +From pgsql-performance-owner@postgresql.org Tue Aug 22 22:36:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id DBDF89FB2F1 + for ; + Tue, 22 Aug 2006 22:36:39 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 25859-09 for + ; + Wed, 23 Aug 2006 01:36:20 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) + by postgresql.org (Postfix) with ESMTP id 4234C9FB2B6 + for ; + Tue, 22 Aug 2006 22:36:19 -0300 (ADT) +Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) + by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k7N1a9lD029598 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); + Tue, 22 Aug 2006 19:36:11 -0600 (MDT) +Received: from winnie.fuhr.org (localhost [127.0.0.1]) + by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k7N1a8fu060147; + Tue, 22 Aug 2006 19:36:08 -0600 (MDT) + (envelope-from mfuhr@winnie.fuhr.org) +Received: (from mfuhr@localhost) + by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k7N1a8Ci060146; + Tue, 22 Aug 2006 19:36:08 -0600 (MDT) (envelope-from mfuhr) +Date: Tue, 22 Aug 2006 19:36:08 -0600 +From: Michael Fuhr +To: "Craig A. James" +Cc: pgsql-performance@postgresql.org +Subject: Re: Moving a tablespace +Message-ID: <20060823013608.GA60075@winnie.fuhr.org> +References: <44EBAC86.7070503@modgraph-usa.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44EBAC86.7070503@modgraph-usa.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY +X-Spam-Level: *** +X-Archive-Number: 200608/368 +X-Sequence-Number: 20553 + +On Tue, Aug 22, 2006 at 06:16:54PM -0700, Craig A. James wrote: +> Is there a way to move a tablespace to a new location without a +> dump/restore? I, er, this hypothetical guy, knows he can move it and put a +> symbolic link in for /disk2, but this is somewhat unsatisfactory since +> "/disk2" would have to exist forever. + +The last paragraph of the Tablespaces documentation might be helpful: + +http://www.postgresql.org/docs/8.1/interactive/manage-ag-tablespaces.html + +"The directory $PGDATA/pg_tblspc contains symbolic links that point +to each of the non-built-in tablespaces defined in the cluster. +Although not recommended, it is possible to adjust the tablespace +layout by hand by redefining these links. Two warnings: do not do +so while the postmaster is running; and after you restart the +postmaster, update the pg_tablespace catalog to show the new +locations. (If you do not, pg_dump will continue to show the old +tablespace locations.)" + +I just tested this and it appeared to work, but this hypothetical +DBA might want to wait for others to comment before proceeding. He +might also want to initdb and populate a test cluster and practice +the procedure before doing it for real. + +-- +Michael Fuhr + +From pgsql-performance-owner@postgresql.org Tue Aug 22 22:37:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id ED3259FB2B6 + for ; + Tue, 22 Aug 2006 22:37:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 34136-02 for + ; + Wed, 23 Aug 2006 01:37:19 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.181]) + by postgresql.org (Postfix) with ESMTP id 7BEC29FB300 + for ; + Tue, 22 Aug 2006 22:37:19 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so3427839pyd + for ; + Tue, 22 Aug 2006 18:37:18 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=r8Y+ADdGjvIxwOtTFx9pNale0sVY7iB30m+4JOwrq7cq0XHWUipxq6DY825L09eQ8hHGOTRNxtsOG9zWapBzsAKSGvat7s7R2VePc+lUK7Ht3RebmXNn+tVQpXSjElNIb2dsndzZNslWRoflv6S+SnsAg/TpM0h3sB/2VUszORs= +Received: by 10.35.100.6 with SMTP id c6mr16762720pym; + Tue, 22 Aug 2006 18:37:17 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id 10sm1597232nzo.2006.08.22.18.37.16; + Tue, 22 Aug 2006 18:37:17 -0700 (PDT) +Message-ID: <44EBB149.5090205@gmail.com> +Date: Wed, 23 Aug 2006 11:37:13 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: "Subbiah, Stalin" +CC: pgsql-performance@postgresql.org +Subject: Re: Query tuning +References: +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/369 +X-Sequence-Number: 20554 + +Subbiah, Stalin wrote: +> Hello All, +> +> This query runs forever and ever. Nature of this table being lots of +> inserts/deletes/query, I vacuum it every half hour to keep the holes +> reusable and nightly once vacuum analyze to update the optimizer. We've +> got index on eventtime only. Running it for current day uses index range +> scan and it runs within acceptable time. Below is the explain of the +> query. Is the order by sequencenum desc prevents from applying limit +> optimization? +> +> explain SELECT * +> FROM EVENTLOG +> WHERE EVENTTIME>'07/23/06 16:00:00' +> AND EVENTTIME<'08/22/06 16:00:00' +> AND (OBJDOMAINID='tzRh39d0d91luNGT1weIUjLvFIcA' +> OR OBJID='tzRh39d0d91luNGT1weIUjLvFIcA' +> OR USERDOMAINID='tzRh39d0d91luNGT1weIUjLvFIcA') +> ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 0; +> +> QUERY PLAN +> +> ------------------------------------------------------------------------ +> ------------------------------------------------------------------------ +> ------------------------------------------------------------------------ +> ------------------------------------------------------------------------ +> ------------------------------------------------------------- +> Limit (cost=15546930.29..15546931.54 rows=500 width=327) +> -> Sort (cost=15546930.29..15581924.84 rows=13997819 width=327) +> Sort Key: eventtime, sequencenum +> -> Seq Scan on eventlog (cost=0.00..2332700.25 rows=13997819 +> width=327) +> Filter: ((eventtime > '2006-07-23 16:00:00'::timestamp +> without time zone) AND (eventtime < '2006-08-22 16:00:00'::timestamp +> without time zone) AND (((objdomainid)::text = +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text = +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text = +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> (5 rows) +> +> Thanks, +> Stalin +> Pg version 8.0.1, suse 64bit. + +Firstly you should update to 8.0.8 - because it's in the same stream you +won't need to do a dump/initdb/reload like a major version change, it +should be a simple upgrade. + +Can you send explain analyze instead of just explain? + +It sounds like you're not analyz'ing enough - if you're doing lots of +updates/deletes/inserts then the statistics postgresql uses to choose +whether to do an index scan or something else will quickly be outdated +and so it'll have to go back to a full table scan every time.. + +Can you set up autovacuum to handle that for you more regularly? + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Tue Aug 22 23:35:27 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 53C329FB300 + for ; + Tue, 22 Aug 2006 23:35:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 36491-10 for + ; + Wed, 23 Aug 2006 02:35:11 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id AA94F9FB2B6 + for ; + Tue, 22 Aug 2006 23:35:11 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7N2YxPK014079; + Tue, 22 Aug 2006 22:34:59 -0400 (EDT) +To: Michael Fuhr +cc: "Craig A. James" , + pgsql-performance@postgresql.org +Subject: Re: Moving a tablespace +In-reply-to: <20060823013608.GA60075@winnie.fuhr.org> +References: <44EBAC86.7070503@modgraph-usa.com> + <20060823013608.GA60075@winnie.fuhr.org> +Comments: In-reply-to Michael Fuhr + message dated "Tue, 22 Aug 2006 19:36:08 -0600" +Date: Tue, 22 Aug 2006 22:34:59 -0400 +Message-ID: <14078.1156300499@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/370 +X-Sequence-Number: 20555 + +Michael Fuhr writes: +> On Tue, Aug 22, 2006 at 06:16:54PM -0700, Craig A. James wrote: +>> Is there a way to move a tablespace to a new location without a +>> dump/restore? + +> The last paragraph of the Tablespaces documentation might be helpful: +> http://www.postgresql.org/docs/8.1/interactive/manage-ag-tablespaces.html + +> I just tested this and it appeared to work, but this hypothetical +> DBA might want to wait for others to comment before proceeding. + +AFAIK it works fine. Shut down postmaster, move tablespace's directory +tree somewhere else, fix the symbolic link in $PGDATA/pg_tblspc, start +postmaster, update the pg_tablespace entry. There isn't anyplace else +in Postgres that knows where that link leads. But if you are running +a hot PITR backup, see the caveats in TFM about what will happen on the +backup machine. + +> He might also want to initdb and populate a test cluster and practice +> the procedure before doing it for real. + +"Always mount a scratch monkey" ... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Tue Aug 22 23:53:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 12F539FB30E + for ; + Tue, 22 Aug 2006 23:53:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 49380-02 for + ; + Wed, 23 Aug 2006 02:53:30 +0000 (UTC) +X-Greylist: delayed 02:07:03.160155 by SQLgrey- +Received: from mxca2.corp.netopia.com (mx-us-west.netopia.com + [65.206.239.221]) + by postgresql.org (Postfix) with ESMTP id EA2BD9FB300 + for ; + Tue, 22 Aug 2006 23:53:29 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Query tuning +Date: Tue, 22 Aug 2006 19:53:29 -0700 +Message-ID: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Query tuning +Thread-Index: AcbGVK4G5QFAg8kxQleHK1MnL+US8wACj4uQ +From: "Subbiah, Stalin" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/371 +X-Sequence-Number: 20556 + +Actually these servers will be upgraded to 8.1.4 in couple of months. + +Here you go with explain analyze. + +# explain analyze SELECT * +FROM EVENTLOG=20 +WHERE EVENTTIME>'07/23/06 16:00:00' AND EVENTTIME<'08/22/06 16:00:00'=20 +AND (OBJDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 + OR OBJID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 + OR USERDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA')=20 +ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 500; +=20 +QUERY PLAN + +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------- + Limit (cost=3D15583110.14..15583111.39 rows=3D500 width=3D327) (actual +time=3D427771.568..427772.904 rows=3D500 loops=3D1) + -> Sort (cost=3D15583108.89..15618188.88 rows=3D14031998 = +width=3D327) +(actual time=3D427770.504..427771.894 rows=3D1000 loops=3D1) + Sort Key: eventtime, sequencenum + -> Seq Scan on eventlog (cost=3D0.00..2334535.17 = +rows=3D14031998 +width=3D327) (actual time=3D10.370..190038.764 rows=3D7699388 loops=3D1) + Filter: ((eventtime > '2006-07-23 16:00:00'::timestamp +without time zone) AND (eventtime < '2006-08-22 16:00:00'::timestamp +without time zone) AND (((objdomainid)::text =3D +'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text =3D +'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text =3D +'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) + Total runtime: 437884.134 ms +(6 rows) + +-----Original Message----- +From: Chris [mailto:dmagick@gmail.com]=20 +Sent: Tuesday, August 22, 2006 6:37 PM +To: Subbiah, Stalin +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Query tuning + +Subbiah, Stalin wrote: +> Hello All, +>=20 +> This query runs forever and ever. Nature of this table being lots of=20 +> inserts/deletes/query, I vacuum it every half hour to keep the holes=20 +> reusable and nightly once vacuum analyze to update the optimizer.=20 +> We've got index on eventtime only. Running it for current day uses=20 +> index range scan and it runs within acceptable time. Below is the=20 +> explain of the query. Is the order by sequencenum desc prevents from=20 +> applying limit optimization? +>=20 +> explain SELECT * +> FROM EVENTLOG +> WHERE EVENTTIME>'07/23/06 16:00:00'=20 +> AND EVENTTIME<'08/22/06 16:00:00'=20 +> AND (OBJDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> OR OBJID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> OR USERDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA') +> ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 0; +> =20 +> QUERY PLAN +>=20 +> ---------------------------------------------------------------------- +> -- +> ---------------------------------------------------------------------- +> -- +> ---------------------------------------------------------------------- +> -- +> ---------------------------------------------------------------------- +> -- +> ------------------------------------------------------------- +> Limit (cost=3D15546930.29..15546931.54 rows=3D500 width=3D327) +> -> Sort (cost=3D15546930.29..15581924.84 rows=3D13997819 = +width=3D327) +> Sort Key: eventtime, sequencenum +> -> Seq Scan on eventlog (cost=3D0.00..2332700.25=20 +> rows=3D13997819 +> width=3D327) +> Filter: ((eventtime > '2006-07-23 16:00:00'::timestamp=20 +> without time zone) AND (eventtime < '2006-08-22 16:00:00'::timestamp=20 +> without time zone) AND (((objdomainid)::text =3D +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text =3D +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text =3D +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> (5 rows) +>=20 +> Thanks, +> Stalin +> Pg version 8.0.1, suse 64bit. + +Firstly you should update to 8.0.8 - because it's in the same stream you +won't need to do a dump/initdb/reload like a major version change, it +should be a simple upgrade. + +Can you send explain analyze instead of just explain? + +It sounds like you're not analyz'ing enough - if you're doing lots of +updates/deletes/inserts then the statistics postgresql uses to choose +whether to do an index scan or something else will quickly be outdated +and so it'll have to go back to a full table scan every time.. + +Can you set up autovacuum to handle that for you more regularly? + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Wed Aug 23 00:05:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C17439FB30E + for ; + Wed, 23 Aug 2006 00:05:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 36132-05 for + ; + Wed, 23 Aug 2006 00:05:40 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.182]) + by postgresql.org (Postfix) with ESMTP id DF9F79FB2B6 + for ; + Wed, 23 Aug 2006 00:05:39 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so3457428pyd + for ; + Tue, 22 Aug 2006 20:05:39 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=DDxfWwZzPHuWLB1YbxzMJlTzSdBbhODYpstdl8kzIRNxVcLHcqjeVh11sY4BUjKuX85XLW+ms7j1gnTPDULXIPu6aoTwSbEYNg8kHrLN4I0FMr35huibaryE6w7/aN/MIiqwmpS7IS6tJQ11LlCvJd5sKE64B4VyRzSmk44cZYM= +Received: by 10.35.98.6 with SMTP id a6mr16835559pym; + Tue, 22 Aug 2006 20:05:38 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id 7sm6939131nzo.2006.08.22.20.05.37; + Tue, 22 Aug 2006 20:05:38 -0700 (PDT) +Message-ID: <44EBC5FE.9020404@gmail.com> +Date: Wed, 23 Aug 2006 13:05:34 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: "Subbiah, Stalin" +CC: pgsql-performance@postgresql.org +Subject: Re: Query tuning +References: +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.49 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/372 +X-Sequence-Number: 20557 + +Subbiah, Stalin wrote: +> Actually these servers will be upgraded to 8.1.4 in couple of months. + +even so, you could get some bad data in there. +http://www.postgresql.org/docs/8.0/static/release.html . Go through the +old release notes and you'll find various race conditions, crashes etc. + +> Here you go with explain analyze. +> +> # explain analyze SELECT * +> FROM EVENTLOG +> WHERE EVENTTIME>'07/23/06 16:00:00' AND EVENTTIME<'08/22/06 16:00:00' +> AND (OBJDOMAINID='tzRh39d0d91luNGT1weIUjLvFIcA' +> OR OBJID='tzRh39d0d91luNGT1weIUjLvFIcA' +> OR USERDOMAINID='tzRh39d0d91luNGT1weIUjLvFIcA') +> ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 500; +> +> QUERY PLAN +> +> ------------------------------------------------------------------------ +> ------------------------------------------------------------------------ +> ------------------------------------------------------------------------ +> ------------------------------------------------------------------------ +> ------------------------------------------------------------- +> Limit (cost=15583110.14..15583111.39 rows=500 width=327) (actual +> time=427771.568..427772.904 rows=500 loops=1) +> -> Sort (cost=15583108.89..15618188.88 rows=14031998 width=327) +> (actual time=427770.504..427771.894 rows=1000 loops=1) +> Sort Key: eventtime, sequencenum +> -> Seq Scan on eventlog (cost=0.00..2334535.17 rows=14031998 +> width=327) (actual time=10.370..190038.764 rows=7699388 loops=1) +> Filter: ((eventtime > '2006-07-23 16:00:00'::timestamp +> without time zone) AND (eventtime < '2006-08-22 16:00:00'::timestamp +> without time zone) AND (((objdomainid)::text = +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text = +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text = +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> Total runtime: 437884.134 ms +> (6 rows) + +If you analyze the table then run this again what plan does it come back +with? + +I can't read explain output properly but I suspect (and I'm sure I'll be +corrected if need be) that the sort step is way out of whack and so is +the seq scan because the stats aren't up to date enough. + +Do you have an index on objdomainid, objid and userdomainid (one index +per field) ? I wonder if that will help much. + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Wed Aug 23 00:32:59 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4799B9FB30E + for ; + Wed, 23 Aug 2006 00:32:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 57519-06 for + ; + Wed, 23 Aug 2006 03:32:35 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.180]) + by postgresql.org (Postfix) with ESMTP id 460029FB2B6 + for ; + Wed, 23 Aug 2006 00:32:35 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so3466242pyd + for ; + Tue, 22 Aug 2006 20:32:34 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; + b=ZWk0V/MBcyAl4oqyp1awEYXLSDp78AMf9xnY0s4SiVwBDRtyziIJ94MJHGQxq9hw0wV6w+E4ZPCvkOzFEYgOVKYdiStl/rZ5ATKwVbl3ToblBz+5vuz1wH832lBJNjIeXm7csi9yJDLLxPYdyretm9TE1YS9f5dwSM8o4UFjt2I= +Received: by 10.35.38.17 with SMTP id q17mr16930618pyj; + Tue, 22 Aug 2006 20:32:02 -0700 (PDT) +Received: from ?10.1.1.22? ( [203.217.18.65]) + by mx.gmail.com with ESMTP id 36sm5080nza.2006.08.22.20.32.00; + Tue, 22 Aug 2006 20:32:02 -0700 (PDT) +Message-ID: <44EBCC2D.5050206@gmail.com> +Date: Wed, 23 Aug 2006 13:31:57 +1000 +From: Chris +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Dan Langille +CC: pgsql-performance@postgresql.org +Subject: Re: Forcing index usage without 'enable_hashjoin = FALSE' +References: <44EA9190.5306.162A8DE9@dan.langille.org> +In-Reply-To: <44EA9190.5306.162A8DE9@dan.langille.org> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/373 +X-Sequence-Number: 20558 + +Dan Langille wrote: +> I'm using PostgreSQL 8.1.4 and I'm trying to force the planner to use +> an index. With the index, I get executions times of 0.5 seconds. +> Without, it's closer to 2.5 seconds. +> +> Compare these two sets of results (also provided at +> http://rafb.net/paste/results/ywcOZP66.html +> should it appear poorly formatted below): +> +> freshports.org=# \i test2.sql +> +> QUERY PLAN +> ---------------------------------------------------------------------- +> ---------------------------------------------------------------------- +> - +> Merge Join (cost=24030.39..24091.43 rows=3028 width=206) (actual +> time=301.301..355.261 rows=3149 loops=1) +> Merge Cond: ("outer".id = "inner".category_id) +> -> Sort (cost=11.17..11.41 rows=97 width=4) (actual +> time=0.954..1.300 rows=95 loops=1) +> Sort Key: c.id +> -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +> width=4) (actual time=0.092..0.517 rows=97 loops=1) +> -> Sort (cost=24019.22..24026.79 rows=3028 width=206) (actual +> time=300.317..314.114 rows=3149 loops=1) +> Sort Key: p.category_id +> -> Nested Loop (cost=0.00..23844.14 rows=3028 width=206) +> (actual time=0.082..264.459 rows=3149 loops=1) +> -> Seq Scan on ports p (cost=0.00..6141.11 rows=3028 +> width=206) (actual time=0.026..133.575 rows=3149 loops=1) +> Filter: (status = 'D'::bpchar) +> -> Index Scan using element_pkey on element e +> (cost=0.00..5.83 rows=1 width=4) (actual time=0.022..0.026 rows=1 +> loops=3149) +> Index Cond: ("outer".element_id = e.id) +> Total runtime: 369.869 ms +> (13 rows) +> +> freshports.org=# set enable_hashjoin = true; +> SET +> freshports.org=# \i test2.sql +> QUERY PLAN +> ---------------------------------------------------------------------- +> ---------------------------------------------------------- +> Hash Join (cost=6156.90..13541.14 rows=3028 width=206) (actual +> time=154.741..2334.366 rows=3149 loops=1) +> Hash Cond: ("outer".category_id = "inner".id) +> -> Hash Join (cost=6148.68..13472.36 rows=3028 width=206) +> (actual time=153.801..2288.792 rows=3149 loops=1) +> Hash Cond: ("outer".id = "inner".element_id) +> -> Seq Scan on element e (cost=0.00..4766.70 rows=252670 +> width=4) (actual time=0.022..1062.626 rows=252670 loops=1) +> -> Hash (cost=6141.11..6141.11 rows=3028 width=206) +> (actual time=151.105..151.105 rows=3149 loops=1) +> -> Seq Scan on ports p (cost=0.00..6141.11 rows=3028 +> width=206) (actual time=0.027..131.072 rows=3149 loops=1) +> Filter: (status = 'D'::bpchar) +> -> Hash (cost=7.97..7.97 rows=97 width=4) (actual +> time=0.885..0.885 rows=97 loops=1) +> -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +> width=4) (actual time=0.076..0.476 rows=97 loops=1) +> Total runtime: 2346.877 ms +> (11 rows) +> +> freshports.org=# +> +> Without leaving "enable_hashjoin = false", can you suggest a way to +> force the index usage? +> +> FYI, the query is: +> +> explain analyse +> SELECT P.id, +> P.category_id, +> P.version as version, +> P.revision as revision, +> P.element_id, +> P.maintainer, +> P.short_description, +> to_char(P.date_added - SystemTimeAdjust(), 'DD Mon YYYY +> HH24:MI:SS') as date_added, +> P.last_commit_id as last_change_log_id, +> P.package_exists, +> P.extract_suffix, +> P.homepage, +> P.status, +> P.broken, +> P.forbidden, +> P.ignore, +> P.restricted, +> P.deprecated, +> P.no_cdrom, +> P.expiration_date, +> P.latest_link +> FROM categories C, ports P JOIN element E on P.element_id = E.id +> WHERE P.status = 'D' +> AND P.category_id = C.id; +> + +I doubt it would make a difference but if you: + +... +FROM categories C JOIN ports P on P.category_id=C.id JOIN element E on +P.element_id = E.id +WHERE P.status = 'D'; + +does it change anything? + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Wed Aug 23 09:50:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 638459FB209 + for ; + Wed, 23 Aug 2006 09:50:49 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 79937-10 for + ; + Wed, 23 Aug 2006 09:50:36 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id C24DD9FB25F + for ; + Wed, 23 Aug 2006 09:50:36 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com + (80-219-241-140.dclient.hispeed.ch [80.219.241.140]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 6F590656BE + for ; + Wed, 23 Aug 2006 14:52:36 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 44E6218589FA9 + for ; + Wed, 23 Aug 2006 14:50:55 +0200 (CEST) +Message-ID: <44EC4F2E.1010304@logix-tt.com> +Date: Wed, 23 Aug 2006 14:50:54 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: VACUUM FULL needed sometimes to prevent transaction +References: <44EB48A9.7030704@geizhals.at> + <1156284025.15743.104.camel@dogma.v10.wvs> +In-Reply-To: <1156284025.15743.104.camel@dogma.v10.wvs> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/374 +X-Sequence-Number: 20559 + +Hi, Jeff & all, + +Jeff Davis wrote: + + +> (2) You have a long-running transaction that never completed for some +> strange reason. + +I just asked myself whether a 2-phase-commit transaction that was +prepared, but never committed, can block vacuuming and TID recycling. + +Markus + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Wed Aug 23 10:24:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 610049FB209 + for ; + Wed, 23 Aug 2006 10:24:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 34081-08 for + ; + Wed, 23 Aug 2006 13:23:59 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from webmail.enterprisedb.com (edb04.managed.contegix.com + [63.246.7.176]) by postgresql.org (Postfix) with ESMTP id A1D919FB25F + for ; + Wed, 23 Aug 2006 10:23:59 -0300 (ADT) +Received: from [192.168.0.20] (unknown [62.232.55.118]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by webmail.enterprisedb.com (Postfix) with ESMTP id 95ECDA24A8D; + Wed, 23 Aug 2006 08:23:57 -0500 (CDT) +Message-ID: <44EC56F5.50704@enterprisedb.com> +Date: Wed, 23 Aug 2006 14:24:05 +0100 +From: Heikki Linnakangas +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Markus Schaber , + pgsql-performance@postgresql.org +Subject: Re: VACUUM FULL needed sometimes to prevent transaction +References: <44EB48A9.7030704@geizhals.at> + <1156284025.15743.104.camel@dogma.v10.wvs> + <44EC4F2E.1010304@logix-tt.com> +In-Reply-To: <44EC4F2E.1010304@logix-tt.com> +Content-Type: text/plain; charset=ISO-8859-15; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.951 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/375 +X-Sequence-Number: 20560 + +Markus Schaber wrote: +> I just asked myself whether a 2-phase-commit transaction that was +> prepared, but never committed, can block vacuuming and TID recycling. +> + +Yes. + +-- + Heikki Linnakangas + EnterpriseDB http://www.enterprisedb.com + + +From pgsql-performance-owner@postgresql.org Wed Aug 23 15:02:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 221FC9FB282 + for ; + Wed, 23 Aug 2006 15:02:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 25034-06 for + ; + Wed, 23 Aug 2006 18:02:39 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mxca2.corp.netopia.com (mx-us-west.netopia.com + [65.206.239.221]) + by postgresql.org (Postfix) with ESMTP id BD96A9FB1F4 + for ; + Wed, 23 Aug 2006 15:02:38 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Query tuning +Date: Wed, 23 Aug 2006 11:02:35 -0700 +Message-ID: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Query tuning +Thread-Index: AcbGYQWSAK4siVLFSauOjys2kaoL6wAeMdgQ +From: "Subbiah, Stalin" +To: "Chris" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/376 +X-Sequence-Number: 20561 + +I get the same plan after running vacuum analyze. Nope, I don't have +index on objdomainid, objid and userdomainid. Only eventime has it. + +-----Original Message----- +From: Chris [mailto:dmagick@gmail.com]=20 +Sent: Tuesday, August 22, 2006 8:06 PM +To: Subbiah, Stalin +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Query tuning + +Subbiah, Stalin wrote: +> Actually these servers will be upgraded to 8.1.4 in couple of months. + +even so, you could get some bad data in there. +http://www.postgresql.org/docs/8.0/static/release.html . Go through the +old release notes and you'll find various race conditions, crashes etc. + +> Here you go with explain analyze. +>=20 +> # explain analyze SELECT * +> FROM EVENTLOG +> WHERE EVENTTIME>'07/23/06 16:00:00' AND EVENTTIME<'08/22/06 16:00:00' + +> AND (OBJDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> OR OBJID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> OR USERDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA') +> ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 500; +> =20 +> QUERY PLAN +>=20 +> ---------------------------------------------------------------------- +> -- +> ---------------------------------------------------------------------- +> -- +> ---------------------------------------------------------------------- +> -- +> ---------------------------------------------------------------------- +> -- +> ------------------------------------------------------------- +> Limit (cost=3D15583110.14..15583111.39 rows=3D500 width=3D327) = +(actual +> time=3D427771.568..427772.904 rows=3D500 loops=3D1) +> -> Sort (cost=3D15583108.89..15618188.88 rows=3D14031998 = +width=3D327)=20 +> (actual time=3D427770.504..427771.894 rows=3D1000 loops=3D1) +> Sort Key: eventtime, sequencenum +> -> Seq Scan on eventlog (cost=3D0.00..2334535.17=20 +> rows=3D14031998 +> width=3D327) (actual time=3D10.370..190038.764 rows=3D7699388 = +loops=3D1) +> Filter: ((eventtime > '2006-07-23 16:00:00'::timestamp=20 +> without time zone) AND (eventtime < '2006-08-22 16:00:00'::timestamp=20 +> without time zone) AND (((objdomainid)::text =3D +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text =3D +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text =3D +> 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> Total runtime: 437884.134 ms +> (6 rows) + +If you analyze the table then run this again what plan does it come back +with? + +I can't read explain output properly but I suspect (and I'm sure I'll be +corrected if need be) that the sort step is way out of whack and so is +the seq scan because the stats aren't up to date enough. + +Do you have an index on objdomainid, objid and userdomainid (one index +per field) ? I wonder if that will help much. + +-- +Postgresql & php tutorials +http://www.designmagick.com/ + +From pgsql-performance-owner@postgresql.org Wed Aug 23 19:23:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A157B9FB285 + for ; + Wed, 23 Aug 2006 19:23:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 06334-07 for + ; + Wed, 23 Aug 2006 22:23:08 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id E192E9FA4D1 + for ; + Wed, 23 Aug 2006 19:23:07 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) id 1GG17m-00070V-Gu + for pgsql-performance@postgresql.org; Wed, 23 Aug 2006 15:23:02 -0700 +Subject: Which benchmark to use for testing FS? +From: Jeff Davis +To: pgsql-performance@postgresql.org +Content-Type: text/plain +Date: Wed, 23 Aug 2006 15:23:03 -0700 +Message-Id: <1156371783.15743.157.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/377 +X-Sequence-Number: 20562 + +I am planning to test various filesystems on some new hardware I'm +getting. Is pgbench a good way to try out the filesystem? + +I'm currently planning to test some or all of: +Linux: ext2, ext3, XFS, JFS, reiser3, reiser4 +FreeBSD: UFS, UFS+SU + +So, I'm looking for a good way to test just the filesystem performance +through PostgreSQL (since database access is different than normal FS +activity). Would pgbench give me a good approximation? + +Also, do ext2 or UFS without soft updates run the risk of losing or +corrupting my data? + +I saw Chris Browne did some benchmarks back in 2003 and determined that +JFS was a good choice. However, I assume things have changed somewhat +since then. Does anyone have a pointer to some newer results? + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Wed Aug 23 20:20:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 037439FB1E6 + for ; + Wed, 23 Aug 2006 20:20:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 47200-05 for + ; + Wed, 23 Aug 2006 20:20:03 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) + by postgresql.org (Postfix) with ESMTP id 0654D9F9FB2 + for ; + Wed, 23 Aug 2006 20:20:02 -0300 (ADT) +X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway +X-GR-Acctd: YES +Received: from [67.90.96.2] (HELO DaveEMachine) + by globalrelay.com (CommuniGate Pro SMTP 4.2.3) + with ESMTP id 101567528; Wed, 23 Aug 2006 16:20:00 -0700 +From: "Dave Dutcher" +To: "'Subbiah, Stalin'" +Cc: +Subject: Re: Query tuning +Date: Wed, 23 Aug 2006 18:19:59 -0500 +Message-ID: <02a501c6c70a$a7ff61d0$8300a8c0@tridecap.com> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 +Importance: Normal +In-Reply-To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.252 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/378 +X-Sequence-Number: 20563 + +It seems to me that what would work best is an index scan backward on the +eventtime index. I don't see why that wouldn't work for you, maybe the +planner is just esitmating the seq scan and sort is faster for some reason. +What does EXPLAIN say if you use a small limit and offset like 10? Or what +does EXPLAIN say if you first run "set enable_seqscan=false;" (If you get +the same plan, then I wouldn't bother running EXPLAIN ANALYZE, but if you +get a different plan I would run EXPLAIN ANALYZE to see if the new plan is +any faster.) + + + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of +> Subbiah, Stalin +> Sent: Wednesday, August 23, 2006 1:03 PM +> To: Chris +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Query tuning +> +> +> I get the same plan after running vacuum analyze. Nope, I don't have +> index on objdomainid, objid and userdomainid. Only eventime has it. +> +> -----Original Message----- +> From: Chris [mailto:dmagick@gmail.com] +> Sent: Tuesday, August 22, 2006 8:06 PM +> To: Subbiah, Stalin +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Query tuning +> +> Subbiah, Stalin wrote: +> > Actually these servers will be upgraded to 8.1.4 in couple +> of months. +> +> even so, you could get some bad data in there. +> http://www.postgresql.org/docs/8.0/static/release.html . Go +> through the +> old release notes and you'll find various race conditions, +> crashes etc. +> +> > Here you go with explain analyze. +> > +> > # explain analyze SELECT * +> > FROM EVENTLOG +> > WHERE EVENTTIME>'07/23/06 16:00:00' AND +> EVENTTIME<'08/22/06 16:00:00' +> +> > AND (OBJDOMAINID='tzRh39d0d91luNGT1weIUjLvFIcA' +> > OR OBJID='tzRh39d0d91luNGT1weIUjLvFIcA' +> > OR USERDOMAINID='tzRh39d0d91luNGT1weIUjLvFIcA') +> > ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 500; +> > +> > QUERY PLAN +> > +> > +> ---------------------------------------------------------------------- +> > -- +> > +> ---------------------------------------------------------------------- +> > -- +> > +> ---------------------------------------------------------------------- +> > -- +> > +> ---------------------------------------------------------------------- +> > -- +> > ------------------------------------------------------------- +> > Limit (cost=15583110.14..15583111.39 rows=500 width=327) (actual +> > time=427771.568..427772.904 rows=500 loops=1) +> > -> Sort (cost=15583108.89..15618188.88 rows=14031998 +> width=327) +> > (actual time=427770.504..427771.894 rows=1000 loops=1) +> > Sort Key: eventtime, sequencenum +> > -> Seq Scan on eventlog (cost=0.00..2334535.17 +> > rows=14031998 +> > width=327) (actual time=10.370..190038.764 rows=7699388 loops=1) +> > Filter: ((eventtime > '2006-07-23 +> 16:00:00'::timestamp +> > without time zone) AND (eventtime < '2006-08-22 +> 16:00:00'::timestamp +> > without time zone) AND (((objdomainid)::text = +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text = +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text = +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> > Total runtime: 437884.134 ms +> > (6 rows) +> +> If you analyze the table then run this again what plan does +> it come back +> with? +> +> I can't read explain output properly but I suspect (and I'm +> sure I'll be +> corrected if need be) that the sort step is way out of whack and so is +> the seq scan because the stats aren't up to date enough. +> +> Do you have an index on objdomainid, objid and userdomainid (one index +> per field) ? I wonder if that will help much. +> +> -- +> Postgresql & php tutorials +> http://www.designmagick.com/ +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +> +> http://www.postgresql.org/docs/faq +> + + +From pgsql-performance-owner@postgresql.org Wed Aug 23 22:51:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6A4C19FB200 + for ; + Wed, 23 Aug 2006 22:51:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 08647-01 for + ; + Wed, 23 Aug 2006 22:51:19 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from vms040pub.verizon.net (vms040pub.verizon.net [206.46.252.40]) + by postgresql.org (Postfix) with ESMTP id 1B6069FB1F0 + for ; + Wed, 23 Aug 2006 22:51:19 -0300 (ADT) +Received: from osgiliath.mathom.us ([72.66.19.85]) + by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 + (built Sep + 9 2005)) with ESMTPA id <0J4H00IVCBT0DQQ4@vms040.mailsrvcs.net> for + pgsql-performance@postgresql.org; Wed, 23 Aug 2006 20:51:00 -0500 (CDT) +Received: from localhost (localhost [127.0.0.1]) + by osgiliath.mathom.us (Postfix) with ESMTP id 9ECCC6F9E3 for + ; + Wed, 23 Aug 2006 21:50:58 -0400 (EDT) +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 UGjjjOikGCwJ for ; Wed, + 23 Aug 2006 21:50:57 -0400 (EDT) +Received: by osgiliath.mathom.us (Postfix, from userid 1000) + id 2955E6FDA7; Wed, 23 Aug 2006 21:50:57 -0400 (EDT) +Date: Wed, 23 Aug 2006 21:50:56 -0400 +From: Michael Stone +Subject: Re: Which benchmark to use for testing FS? +In-reply-to: <1156371783.15743.157.camel@dogma.v10.wvs> +To: pgsql-performance@postgresql.org +Mail-followup-to: pgsql-performance@postgresql.org +Message-id: <20060824015054.GE2900@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: <1156371783.15743.157.camel@dogma.v10.wvs> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.674 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/379 +X-Sequence-Number: 20564 + +On Wed, Aug 23, 2006 at 03:23:03PM -0700, Jeff Davis wrote: +>Also, do ext2 or UFS without soft updates run the risk of losing or +>corrupting my data? + +I suggest you check the list archives; there's a lot of stuff about +filesystems and disk configuration in there. + +Mike Stone + +From pgsql-performance-owner@postgresql.org Wed Aug 23 23:11:51 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5038D9FA3D7 + for ; + Wed, 23 Aug 2006 23:11:50 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 51088-10 for + ; + Thu, 24 Aug 2006 02:11:30 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 76B309FB1F0 + for ; + Wed, 23 Aug 2006 23:11:30 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from havoc.unixathome.org (havoc.unixathome.org [66.154.98.130]) + by svr4.postgresql.org (Postfix) with ESMTP id 492DA5AF032 + for ; + Thu, 24 Aug 2006 02:11:25 +0000 (GMT) +Received: from localhost (localhost [127.0.0.1]) + by havoc.unixathome.org (Postfix) with ESMTP id 987B056431; + Wed, 23 Aug 2006 19:11:20 -0700 (PDT) +X-Virus-Scanned: by amavisd-new at unixathome.org +Received: from havoc.unixathome.org ([127.0.0.1]) + by localhost (havoc.unixathome.org [127.0.0.1]) (amavisd-new, + port 10024) + with ESMTP id lxCjxs-mg9By; Wed, 23 Aug 2006 19:11:18 -0700 (PDT) +Received: from bast.unixathome.org (bast.unixathome.org [70.26.229.230]) + by havoc.unixathome.org (Postfix) with ESMTP id 86C0A56428; + Wed, 23 Aug 2006 19:11:16 -0700 (PDT) +Received: from [10.55.0.99] (wocker.unixathome.org [10.55.0.99]) + by bast.unixathome.org (Postfix) with ESMTP id 10F27B822; + Wed, 23 Aug 2006 22:11:15 -0400 (EDT) +From: "Dan Langille" +To: Chris +Date: Wed, 23 Aug 2006 22:11:15 -0400 +MIME-Version: 1.0 +Subject: Re: Forcing index usage without 'enable_hashjoin = FALSE' +Cc: pgsql-performance@postgresql.org +Message-ID: <44ECD283.18248.1EF83D45@dan.langille.org> +In-reply-to: <44EBCC2D.5050206@gmail.com> +References: <44EA9190.5306.162A8DE9@dan.langille.org> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/380 +X-Sequence-Number: 20565 + +On 23 Aug 2006 at 13:31, Chris wrote: + +> Dan Langille wrote: +> > I'm using PostgreSQL 8.1.4 and I'm trying to force the planner to use +> > an index. With the index, I get executions times of 0.5 seconds. +> > Without, it's closer to 2.5 seconds. +> > +> > Compare these two sets of results (also provided at +> > http://rafb.net/paste/results/ywcOZP66.html +> > should it appear poorly formatted below): +> > +> > freshports.org=# \i test2.sql +> > +> > QUERY PLAN +> > ---------------------------------------------------------------------- +> > ---------------------------------------------------------------------- +> > - +> > Merge Join (cost=24030.39..24091.43 rows=3028 width=206) (actual +> > time=301.301..355.261 rows=3149 loops=1) +> > Merge Cond: ("outer".id = "inner".category_id) +> > -> Sort (cost=11.17..11.41 rows=97 width=4) (actual +> > time=0.954..1.300 rows=95 loops=1) +> > Sort Key: c.id +> > -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +> > width=4) (actual time=0.092..0.517 rows=97 loops=1) +> > -> Sort (cost=24019.22..24026.79 rows=3028 width=206) (actual +> > time=300.317..314.114 rows=3149 loops=1) +> > Sort Key: p.category_id +> > -> Nested Loop (cost=0.00..23844.14 rows=3028 width=206) +> > (actual time=0.082..264.459 rows=3149 loops=1) +> > -> Seq Scan on ports p (cost=0.00..6141.11 rows=3028 +> > width=206) (actual time=0.026..133.575 rows=3149 loops=1) +> > Filter: (status = 'D'::bpchar) +> > -> Index Scan using element_pkey on element e +> > (cost=0.00..5.83 rows=1 width=4) (actual time=0.022..0.026 rows=1 +> > loops=3149) +> > Index Cond: ("outer".element_id = e.id) +> > Total runtime: 369.869 ms +> > (13 rows) +> > +> > freshports.org=# set enable_hashjoin = true; +> > SET +> > freshports.org=# \i test2.sql +> > QUERY PLAN +> > ---------------------------------------------------------------------- +> > ---------------------------------------------------------- +> > Hash Join (cost=6156.90..13541.14 rows=3028 width=206) (actual +> > time=154.741..2334.366 rows=3149 loops=1) +> > Hash Cond: ("outer".category_id = "inner".id) +> > -> Hash Join (cost=6148.68..13472.36 rows=3028 width=206) +> > (actual time=153.801..2288.792 rows=3149 loops=1) +> > Hash Cond: ("outer".id = "inner".element_id) +> > -> Seq Scan on element e (cost=0.00..4766.70 rows=252670 +> > width=4) (actual time=0.022..1062.626 rows=252670 loops=1) +> > -> Hash (cost=6141.11..6141.11 rows=3028 width=206) +> > (actual time=151.105..151.105 rows=3149 loops=1) +> > -> Seq Scan on ports p (cost=0.00..6141.11 rows=3028 +> > width=206) (actual time=0.027..131.072 rows=3149 loops=1) +> > Filter: (status = 'D'::bpchar) +> > -> Hash (cost=7.97..7.97 rows=97 width=4) (actual +> > time=0.885..0.885 rows=97 loops=1) +> > -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +> > width=4) (actual time=0.076..0.476 rows=97 loops=1) +> > Total runtime: 2346.877 ms +> > (11 rows) +> > +> > freshports.org=# +> > +> > Without leaving "enable_hashjoin = false", can you suggest a way to +> > force the index usage? +> > +> > FYI, the query is: +> > +> > explain analyse +> > SELECT P.id, +> > P.category_id, +> > P.version as version, +> > P.revision as revision, +> > P.element_id, +> > P.maintainer, +> > P.short_description, +> > to_char(P.date_added - SystemTimeAdjust(), 'DD Mon YYYY +> > HH24:MI:SS') as date_added, +> > P.last_commit_id as last_change_log_id, +> > P.package_exists, +> > P.extract_suffix, +> > P.homepage, +> > P.status, +> > P.broken, +> > P.forbidden, +> > P.ignore, +> > P.restricted, +> > P.deprecated, +> > P.no_cdrom, +> > P.expiration_date, +> > P.latest_link +> > FROM categories C, ports P JOIN element E on P.element_id = E.id +> > WHERE P.status = 'D' +> > AND P.category_id = C.id; +> > +> +> I doubt it would make a difference but if you: +> +> ... +> FROM categories C JOIN ports P on P.category_id=C.id JOIN element E on +> P.element_id = E.id +> WHERE P.status = 'D'; +> +> does it change anything? + +Not really, no: + +freshports.org=# \i test3.sql + +QUERY PLAN +---------------------------------------------------------------------- +---------------------------------------------------------------------- +--- + Hash Join (cost=5344.62..12740.73 rows=3365 width=204) (actual +time=63.871..2164.880 rows=3149 loops=1) + Hash Cond: ("outer".category_id = "inner".id) + -> Hash Join (cost=5336.41..12665.22 rows=3365 width=204) +(actual time=62.918..2122.529 rows=3149 loops=1) + Hash Cond: ("outer".id = "inner".element_id) + -> Seq Scan on element e (cost=0.00..4767.58 rows=252758 +width=4) (actual time=0.019..1024.299 rows=252791 loops=1) + -> Hash (cost=5328.00..5328.00 rows=3365 width=204) +(actual time=60.228..60.228 rows=3149 loops=1) + -> Bitmap Heap Scan on ports p (cost=34.02..5328.00 +rows=3365 width=204) (actual time=1.900..41.316 rows=3149 loops=1) + Recheck Cond: (status = 'D'::bpchar) + -> Bitmap Index Scan on ports_deleted +(cost=0.00..34.02 rows=3365 width=0) (actual time=1.454..1.454 +rows=3149 loops=1) + Index Cond: (status = 'D'::bpchar) + -> Hash (cost=7.97..7.97 rows=97 width=4) (actual +time=0.890..0.890 rows=97 loops=1) + -> Seq Scan on categories c (cost=0.00..7.97 rows=97 +width=4) (actual time=0.074..0.497 rows=97 loops=1) + Total runtime: 2176.784 ms +(13 rows) + +freshports.org=# + + + +-- +Dan Langille : Software Developer looking for work +my resume: http://www.freebsddiary.org/dan_langille.php + + + +From pgsql-performance-owner@postgresql.org Wed Aug 23 23:30:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3C9499FB1D7 + for ; + Wed, 23 Aug 2006 23:30:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 09419-04 for + ; + Wed, 23 Aug 2006 23:30:23 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id DB5DF9FA3D7 + for ; + Wed, 23 Aug 2006 23:30:23 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7O2UGqx028099; + Wed, 23 Aug 2006 22:30:18 -0400 (EDT) +To: "Dan Langille" +cc: Chris , pgsql-performance@postgresql.org +Subject: Re: Forcing index usage without 'enable_hashjoin = FALSE' +In-reply-to: <44ECD283.18248.1EF83D45@dan.langille.org> +References: <44EA9190.5306.162A8DE9@dan.langille.org> + <44ECD283.18248.1EF83D45@dan.langille.org> +Comments: In-reply-to "Dan Langille" + message dated "Wed, 23 Aug 2006 22:11:15 -0400" +Date: Wed, 23 Aug 2006 22:30:16 -0400 +Message-ID: <28098.1156386616@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.15 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/381 +X-Sequence-Number: 20566 + +"Dan Langille" writes: +> Without leaving "enable_hashjoin = false", can you suggest a way to +> force the index usage? + +Have you tried reducing random_page_cost? + +FYI, 8.2 should be a bit better about this. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Wed Aug 23 23:43:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8C6BE9FB1D7 + for ; + Wed, 23 Aug 2006 23:43:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 10531-07 for + ; + Wed, 23 Aug 2006 23:43:00 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 188CD9FA3D7 + for ; + Wed, 23 Aug 2006 23:43:01 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from m21.unixathome.org (m21.unixathome.org [205.150.199.217]) + by svr4.postgresql.org (Postfix) with ESMTP id 1CD245AF89D + for ; + Thu, 24 Aug 2006 02:42:59 +0000 (GMT) +Received: from localhost (localhost [205.150.199.217]) + by m21.unixathome.org (Postfix) with ESMTP id E5FCCC383; + Wed, 23 Aug 2006 22:43:06 -0400 (EDT) +Received: from m21.unixathome.org ([205.150.199.217]) + by localhost (m21.unixathome.org [205.150.199.217]) (amavisd-new, + port 10024) + with ESMTP id 22929-06; Wed, 23 Aug 2006 22:43:01 -0400 (EDT) +Received: from bast.unixathome.org (bast.unixathome.org [70.26.229.230]) + by m21.unixathome.org (Postfix) with ESMTP id 79A2FBF58; + Wed, 23 Aug 2006 22:43:01 -0400 (EDT) +Received: from [10.55.0.99] (wocker.unixathome.org [10.55.0.99]) + by bast.unixathome.org (Postfix) with ESMTP id EA0DCB822; + Wed, 23 Aug 2006 22:42:49 -0400 (EDT) +From: "Dan Langille" +To: Tom Lane +Date: Wed, 23 Aug 2006 22:42:49 -0400 +MIME-Version: 1.0 +Subject: Re: Forcing index usage without 'enable_hashjoin = FALSE' +Cc: Chris , pgsql-performance@postgresql.org +Message-ID: <44ECD9E9.15840.1F152338@dan.langille.org> +In-reply-to: <28098.1156386616@sss.pgh.pa.us> +References: <44ECD283.18248.1EF83D45@dan.langille.org> +X-mailer: Pegasus Mail for Windows (4.31) +Content-type: text/plain; charset=US-ASCII +Content-transfer-encoding: 7BIT +Content-description: Mail message body +X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at unixathome.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/382 +X-Sequence-Number: 20567 + +On 23 Aug 2006 at 22:30, Tom Lane wrote: + +> "Dan Langille" writes: +> > Without leaving "enable_hashjoin = false", can you suggest a way to +> > force the index usage? +> +> Have you tried reducing random_page_cost? + +Yes. No effect. + +> FYI, 8.2 should be a bit better about this. + +Good. This query is not critical, but it would be nice. + +Thank you. + +-- +Dan Langille : Software Developer looking for work +my resume: http://www.freebsddiary.org/dan_langille.php + + + +From pgsql-admin-owner@postgresql.org Thu Aug 24 01:44:43 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 0A91B9FB3C5; + Thu, 24 Aug 2006 01:44:43 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 25516-08; Thu, 24 Aug 2006 04:44:23 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mxca2.corp.netopia.com (mx-us-west.netopia.com + [65.206.239.221]) + by postgresql.org (Postfix) with ESMTP id 034869FB37A; + Thu, 24 Aug 2006 01:44:22 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: [PERFORM] Query tuning +Date: Wed, 23 Aug 2006 21:44:20 -0700 +Message-ID: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Query tuning +Thread-Index: AcbHCqr+SYuxBW/KQFGLN6rhjCMMigALMnRw +From: "Subbiah, Stalin" +To: "Dave Dutcher" +Cc: , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/259 +X-Sequence-Number: 22802 + +Changing limit or offset to a small number doesn't have any change in +plans. Likewise enable_seqscan to false. They still take 8-10 mins to +runs.=20 + +-----Original Message----- +From: Dave Dutcher [mailto:dave@tridecap.com]=20 +Sent: Wednesday, August 23, 2006 4:20 PM +To: Subbiah, Stalin +Cc: pgsql-performance@postgresql.org +Subject: RE: [PERFORM] Query tuning + +It seems to me that what would work best is an index scan backward on +the eventtime index. I don't see why that wouldn't work for you, maybe +the planner is just esitmating the seq scan and sort is faster for some +reason. +What does EXPLAIN say if you use a small limit and offset like 10? Or +what does EXPLAIN say if you first run "set enable_seqscan=3Dfalse;" = +(If +you get the same plan, then I wouldn't bother running EXPLAIN ANALYZE, +but if you get a different plan I would run EXPLAIN ANALYZE to see if +the new plan is any faster.) + + + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Subbiah,=20 +> Stalin +> Sent: Wednesday, August 23, 2006 1:03 PM +> To: Chris +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Query tuning +>=20 +>=20 +> I get the same plan after running vacuum analyze. Nope, I don't have=20 +> index on objdomainid, objid and userdomainid. Only eventime has it. +>=20 +> -----Original Message----- +> From: Chris [mailto:dmagick@gmail.com] +> Sent: Tuesday, August 22, 2006 8:06 PM +> To: Subbiah, Stalin +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Query tuning +>=20 +> Subbiah, Stalin wrote: +> > Actually these servers will be upgraded to 8.1.4 in couple +> of months. +>=20 +> even so, you could get some bad data in there. +> http://www.postgresql.org/docs/8.0/static/release.html . Go through=20 +> the old release notes and you'll find various race conditions, crashes + +> etc. +>=20 +> > Here you go with explain analyze. +> >=20 +> > # explain analyze SELECT * +> > FROM EVENTLOG +> > WHERE EVENTTIME>'07/23/06 16:00:00' AND +> EVENTTIME<'08/22/06 16:00:00' +>=20 +> > AND (OBJDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> > OR OBJID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> > OR USERDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA') +> > ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 500; +> > =20 +> > QUERY PLAN +> >=20 +> >=20 +> ---------------------------------------------------------------------- +> > -- +> >=20 +> ---------------------------------------------------------------------- +> > -- +> >=20 +> ---------------------------------------------------------------------- +> > -- +> >=20 +> ---------------------------------------------------------------------- +> > -- +> > ------------------------------------------------------------- +> > Limit (cost=3D15583110.14..15583111.39 rows=3D500 width=3D327) = +(actual +> > time=3D427771.568..427772.904 rows=3D500 loops=3D1) +> > -> Sort (cost=3D15583108.89..15618188.88 rows=3D14031998 +> width=3D327) +> > (actual time=3D427770.504..427771.894 rows=3D1000 loops=3D1) +> > Sort Key: eventtime, sequencenum +> > -> Seq Scan on eventlog (cost=3D0.00..2334535.17 +> > rows=3D14031998 +> > width=3D327) (actual time=3D10.370..190038.764 rows=3D7699388 = +loops=3D1) +> > Filter: ((eventtime > '2006-07-23 +> 16:00:00'::timestamp +> > without time zone) AND (eventtime < '2006-08-22 +> 16:00:00'::timestamp +> > without time zone) AND (((objdomainid)::text =3D +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text =3D +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text =3D +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> > Total runtime: 437884.134 ms +> > (6 rows) +>=20 +> If you analyze the table then run this again what plan does it come=20 +> back with? +>=20 +> I can't read explain output properly but I suspect (and I'm sure I'll=20 +> be corrected if need be) that the sort step is way out of whack and so + +> is the seq scan because the stats aren't up to date enough. +>=20 +> Do you have an index on objdomainid, objid and userdomainid (one index + +> per field) ? I wonder if that will help much. +>=20 +> -- +> Postgresql & php tutorials +> http://www.designmagick.com/ +>=20 +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +>=20 +> http://www.postgresql.org/docs/faq +>=20 + + +From pgsql-admin-owner@postgresql.org Thu Aug 24 03:06:51 2006 +X-Original-To: pgsql-admin-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4B4AC9FB1BE; + Thu, 24 Aug 2006 03:06:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 41853-07; Thu, 24 Aug 2006 06:06:33 +0000 (UTC) +X-Greylist: delayed 00:33:16.238022 by SQLgrey- +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 4E8E09FB3DD; + Thu, 24 Aug 2006 03:06:33 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mail.siglercompanies.com (sig-gw.isunet.net [63.175.165.221]) + by svr4.postgresql.org (Postfix) with ESMTP id B593B5AF03D; + Thu, 24 Aug 2006 05:33:15 +0000 (GMT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: [PERFORM] Query tuning +Date: Thu, 24 Aug 2006 00:30:56 -0500 +Message-ID: <261CF9EEB14F5442894AB6DDA93AA6F438B910@mail.siglercompanies.com> +In-Reply-To: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [ADMIN] [PERFORM] Query tuning +Thread-Index: AcbHCqr+SYuxBW/KQFGLN6rhjCMMigALMnRwAAGer/A= +From: "Jason Minion" +To: "Subbiah, Stalin" , + "Dave Dutcher" +Cc: , +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=4.266 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SARE_MILLIONSOF, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: **** +X-Archive-Number: 200608/260 +X-Sequence-Number: 22803 + +=20 +You really need to index the three fields you are restricting with your +select query (OBJDOMAINID, OBJID and USERDOMAINID). Depending on whether +or not you have other queries that filter for one of the three fields +but not the others, you might want to have separate indexes across each +of the fields. Also, if those types are not CHAR/VARCHAR/TEXT/similar, +try casting your values to the types for those fields (ie, +OBJDOMAINID=3D'somethinghere'::WVARCHAR, and should be much less = +necessary +with pgsql v8+). Since you don't have indexes on those fields, the only +thing the query planner can do is a full table scan and for each record +check the field values. With indexes it will be able to filter by those +values first and then sort the remaining values. On the other hand, if +most of your records have the same values for your filter fields (ie +only a handful of values dispersed amongst millions of rows) then you +may be back to the seq scan. + +Jason Minion +jason.minion@sigler.com + +-----Original Message----- +From: pgsql-admin-owner@postgresql.org +[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Subbiah, Stalin +Sent: Wednesday, August 23, 2006 11:44 PM +To: Dave Dutcher +Cc: pgsql-performance@postgresql.org; pgsql-admin@postgresql.org +Subject: Re: [ADMIN] [PERFORM] Query tuning + +Changing limit or offset to a small number doesn't have any change in +plans. Likewise enable_seqscan to false. They still take 8-10 mins to +runs.=20 + +-----Original Message----- +From: Dave Dutcher [mailto:dave@tridecap.com] +Sent: Wednesday, August 23, 2006 4:20 PM +To: Subbiah, Stalin +Cc: pgsql-performance@postgresql.org +Subject: RE: [PERFORM] Query tuning + +It seems to me that what would work best is an index scan backward on +the eventtime index. I don't see why that wouldn't work for you, maybe +the planner is just esitmating the seq scan and sort is faster for some +reason. +What does EXPLAIN say if you use a small limit and offset like 10? Or +what does EXPLAIN say if you first run "set enable_seqscan=3Dfalse;" = +(If +you get the same plan, then I wouldn't bother running EXPLAIN ANALYZE, +but if you get a different plan I would run EXPLAIN ANALYZE to see if +the new plan is any faster.) + + + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Subbiah,=20 +> Stalin +> Sent: Wednesday, August 23, 2006 1:03 PM +> To: Chris +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Query tuning +>=20 +>=20 +> I get the same plan after running vacuum analyze. Nope, I don't have=20 +> index on objdomainid, objid and userdomainid. Only eventime has it. +>=20 +> -----Original Message----- +> From: Chris [mailto:dmagick@gmail.com] +> Sent: Tuesday, August 22, 2006 8:06 PM +> To: Subbiah, Stalin +> Cc: pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] Query tuning +>=20 +> Subbiah, Stalin wrote: +> > Actually these servers will be upgraded to 8.1.4 in couple +> of months. +>=20 +> even so, you could get some bad data in there. +> http://www.postgresql.org/docs/8.0/static/release.html . Go through=20 +> the old release notes and you'll find various race conditions, crashes + +> etc. +>=20 +> > Here you go with explain analyze. +> >=20 +> > # explain analyze SELECT * +> > FROM EVENTLOG +> > WHERE EVENTTIME>'07/23/06 16:00:00' AND +> EVENTTIME<'08/22/06 16:00:00' +>=20 +> > AND (OBJDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> > OR OBJID=3D'tzRh39d0d91luNGT1weIUjLvFIcA'=20 +> > OR USERDOMAINID=3D'tzRh39d0d91luNGT1weIUjLvFIcA') +> > ORDER BY EVENTTIME DESC, SEQUENCENUM DESC LIMIT 500 OFFSET 500; +> > =20 +> > QUERY PLAN +> >=20 +> >=20 +> ---------------------------------------------------------------------- +> > -- +> >=20 +> ---------------------------------------------------------------------- +> > -- +> >=20 +> ---------------------------------------------------------------------- +> > -- +> >=20 +> ---------------------------------------------------------------------- +> > -- +> > ------------------------------------------------------------- +> > Limit (cost=3D15583110.14..15583111.39 rows=3D500 width=3D327) = +(actual +> > time=3D427771.568..427772.904 rows=3D500 loops=3D1) +> > -> Sort (cost=3D15583108.89..15618188.88 rows=3D14031998 +> width=3D327) +> > (actual time=3D427770.504..427771.894 rows=3D1000 loops=3D1) +> > Sort Key: eventtime, sequencenum +> > -> Seq Scan on eventlog (cost=3D0.00..2334535.17 +> > rows=3D14031998 +> > width=3D327) (actual time=3D10.370..190038.764 rows=3D7699388 = +loops=3D1) +> > Filter: ((eventtime > '2006-07-23 +> 16:00:00'::timestamp +> > without time zone) AND (eventtime < '2006-08-22 +> 16:00:00'::timestamp +> > without time zone) AND (((objdomainid)::text =3D +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((objid)::text =3D +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text) OR ((userdomainid)::text =3D +> > 'tzRh39d0d91luNGT1weIUjLvFIcA'::text))) +> > Total runtime: 437884.134 ms +> > (6 rows) +>=20 +> If you analyze the table then run this again what plan does it come=20 +> back with? +>=20 +> I can't read explain output properly but I suspect (and I'm sure I'll=20 +> be corrected if need be) that the sort step is way out of whack and so + +> is the seq scan because the stats aren't up to date enough. +>=20 +> Do you have an index on objdomainid, objid and userdomainid (one index + +> per field) ? I wonder if that will help much. +>=20 +> -- +> Postgresql & php tutorials +> http://www.designmagick.com/ +>=20 +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 3: Have you checked our extensive FAQ? +>=20 +> http://www.postgresql.org/docs/faq +>=20 + + +---------------------------(end of broadcast)--------------------------- +TIP 5: don't forget to increase your free space map settings + +From pgsql-performance-owner@postgresql.org Thu Aug 24 06:26:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 703569FB3EF + for ; + Thu, 24 Aug 2006 06:26:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 49911-01 for + ; + Thu, 24 Aug 2006 06:26:31 -0300 (ADT) +X-Greylist: delayed 00:24:54.736081 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id B01C09FB3E9 + for ; + Thu, 24 Aug 2006 06:26:31 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from seuppms101.eu.companyb.com (ns.personalchemistry.com + [212.209.214.5]) + by svr4.postgresql.org (Postfix) with ESMTP id 12CE35AF884 + for ; + Thu, 24 Aug 2006 09:01:34 +0000 (GMT) +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Is this way of testing a bad idea? +Date: Thu, 24 Aug 2006 11:04:28 +0200 +Message-ID: + +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: Is this way of testing a bad idea? +Thread-Index: AcbHXE4Z0pov8jB6SYWgo6yrOmAiFA== +From: "Fredrik Israelsson" +To: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/384 +X-Sequence-Number: 20569 + +I am evaluating PostgreSQL as a candiate to cooperate with a java +application. + +Performance test set up: +Only one table in the database schema. +The tables contains a bytea column plus some other columns. +The PostgreSQL server runs on Linux. + +Test execution: +The java application connects throught TCP/IP (jdbc) and performs 50000 +inserts. + +Result: +Monitoring the processes using top reveals that the total amount of +memory used slowly increases during the test. When reaching insert +number 40000, or somewhere around that, memory is exhausted, and the the +systems begins to swap. Each of the postmaster processes seem to use a +constant amount of memory, but the total memory usage increases all the +same. + +Questions: +Is this way of testing the performance a bad idea? Actual database usage +will be a mixture of inserts and queries. Maybe the test should behave +like that instead, but I wanted to keep things simple. +Why is the memory usage slowly increasing during the whole test? +Is there a way of keeping PostgreSQL from exhausting memory during the +test? I have looked for some fitting parameters to used, but I am +probably to much of a novice to understand which to choose. + +Thanks in advance, +Fredrik Israelsson + +From pgsql-performance-owner@postgresql.org Thu Aug 24 09:51:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 9C9199FB224 + for ; + Thu, 24 Aug 2006 09:51:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 64844-06 for + ; + Thu, 24 Aug 2006 09:51:25 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id DA0D09FA64B + for ; + Thu, 24 Aug 2006 09:51:23 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7OCpGiE003116; + Thu, 24 Aug 2006 08:51:16 -0400 (EDT) +To: "Fredrik Israelsson" +cc: pgsql-performance@postgresql.org +Subject: Re: Is this way of testing a bad idea? +In-reply-to: + +References: + +Comments: In-reply-to "Fredrik Israelsson" + message dated "Thu, 24 Aug 2006 11:04:28 +0200" +Date: Thu, 24 Aug 2006 08:51:16 -0400 +Message-ID: <3115.1156423876@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.149 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/385 +X-Sequence-Number: 20570 + +"Fredrik Israelsson" writes: +> Monitoring the processes using top reveals that the total amount of +> memory used slowly increases during the test. When reaching insert +> number 40000, or somewhere around that, memory is exhausted, and the the +> systems begins to swap. Each of the postmaster processes seem to use a +> constant amount of memory, but the total memory usage increases all the +> same. + +That statement is basically nonsense. If there is a memory leak then +you should be able to pin it on some specific process. + +What's your test case exactly, and what's your basis for asserting that +the system starts to swap? We've seen people fooled by the fact that +some versions of ps report a process's total memory size as including +whatever pages of Postgres' shared memory area the process has actually +chanced to touch. So as a backend randomly happens to use different +shared buffers its reported memory size grows ... but there's no actual +leak, and no reason why the system would start to swap. (Unless maybe +you've set an unreasonably high shared_buffers setting?) + +Another theory is that you're watching free memory go to zero because +the kernel is filling free memory with copies of disk pages. This is +not a leak either. Zero free memory is the normal, expected state of +a Unix system that's been up for any length of time. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 24 10:21:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 365769FB1CD + for ; + Thu, 24 Aug 2006 10:21:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 67476-02 for + ; + Thu, 24 Aug 2006 10:21:29 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.202]) + by postgresql.org (Postfix) with ESMTP id AA47C9FB1CA + for ; + Thu, 24 Aug 2006 10:21:29 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so311614nzn + for ; + Thu, 24 Aug 2006 06:21:28 -0700 (PDT) +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=gGRoKpBP6uH4879lWmDcgieg6FlcUDEpxRQI0cp0rB/HsN06/Tu9r3uyGrgxJ/+YkrArY+0y/OguSYs/ulbtkjQUHncbBJYgtKyX1r9uscK0gog++kgTVJ86oC8U7kvWYkww9a7ygqweZVPSbq4US041b21SMI4pwmS5WcX1WFg= +Received: by 10.65.126.4 with SMTP id d4mr2099279qbn; + Thu, 24 Aug 2006 06:21:28 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Thu, 24 Aug 2006 06:21:27 -0700 (PDT) +Message-ID: +Date: Thu, 24 Aug 2006 09:21:27 -0400 +From: "Merlin Moncure" +To: "Jeff Davis" +Subject: Re: PowerEdge 2950 questions +Cc: "Bucky Jordan" , pgsql-performance@postgresql.org +In-Reply-To: <1156285374.15743.118.camel@dogma.v10.wvs> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.233 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/386 +X-Sequence-Number: 20571 + +On 8/22/06, Jeff Davis wrote: +> On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> Very interesting. I always hear that people avoid RAID 5 on database +> servers, but I suppose it always depends. Is the parity calculation +> something that may increase commit latency vs. a RAID 10? That's +> normally the explanation that I get. + +it's not the parity, it's the seeking. Raid 5 gives you great +sequential i/o but random is often not much better than a single +drive. Actually it's the '1' in raid 10 that plays the biggest role +in optimizing seeks on an ideal raid controller. Calculating parity +was boring 20 years ago as it inolves one of the fastest operations in +computing, namely xor. :) + +> > If I remember correctly, the numbers were pretty close, but I was +> > expecting RAID10 to significantly beat RAID5. However, with 6 disks, +> > RAID5 starts performing a little better, and it also has good storage +> > utilization (i.e. you're only loosing 1 disk's worth of storage, so with +> > 6 drives, you still have 83% - 5/6 - of your storage available, as +> > opposed to 50% with RAID10). + +with a 6 disk raid 5, you absolutely have a hot spare in the array. +an alternative is raid 6, which is two parity drives, however there is +not a lot of good data on how raid 6 performs (ideally should be +similar to raid 5). raid 5 is ideal for some things, for example +document storage or in databases where most of the activity takes +place in a small portion of the disks most of the time. + +> Right, RAID 5 is certainly tempting since I get so much more storage. +> +> > Keep in mind that with 6 disks, theoretically (your mileage may vary by +> > raid controller implementation) you have more fault tolerance with +> > RAID10 than with RAID5. +> +> I'll also have the Slony system, so I think my degree of safety is still +> quite high with RAID-5. +> +> > Also, I don't think there's a lot of performance gain to going with the +> > 15k drives over the 10k. Even dell only says a 10% boost. I've +> > benchmarked a single drive configuration, 10k vs 15k rpm, and yes, the +> > 15k had substantially better seek times, but raw io isn't much +> > different, so again, it depends on your application's needs. + +raw sequential i/o is actually not that important in many databases. +while the database tries to make data transfers sequential as much as +possbile (especially for writing), improved random performance often +translates directly into database performance, especially if your +database is big. + +> Do you think the seek time may affect transaction commit time though, +> rather than just throughput? Or does it not make much difference since +> we have writeback? +> +> > Lastly, re your question on putting the WAL on the RAID10- I currently +> > have the box setup as RAID5x6 with the WAL and PGDATA all on the same +> > raidset. I haven't had the chance to do extensive tests, but from +> > previous readings, I gather that if you have write-back enabled on the +> > RAID, it should be ok (which it is in my case). + +with 6 relatively small disks I think single raid 10 volume is the +best bet. however above 6 dedicated wal is usually worth considering. + since wal storage requirements are so small, it's becoming affordable +to look at solid state for the wal. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 24 10:40:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 85AA39FB1CA + for ; + Thu, 24 Aug 2006 10:40:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 67938-07 for + ; + Thu, 24 Aug 2006 10:40:22 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) + by postgresql.org (Postfix) with ESMTP id C74629FB218 + for ; + Thu, 24 Aug 2006 10:40:22 -0300 (ADT) +Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP + with MS-WebStorage 6.0.6249 +Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; + 24 Aug 2006 06:40:19 -0700 +Subject: Re: Is this way of testing a bad idea? +From: Mark Lewis +To: Fredrik Israelsson +Cc: pgsql-performance@postgresql.org +In-Reply-To: + +References: + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Organization: MIR3, Inc. +Date: Thu, 24 Aug 2006 06:40:19 -0700 +Message-Id: <1156426819.9657.227.camel@archimedes> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.2 (2.0.2-27) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.298 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/387 +X-Sequence-Number: 20572 + +> Monitoring the processes using top reveals that the total amount of +> memory used slowly increases during the test. When reaching insert +> number 40000, or somewhere around that, memory is exhausted, and the the +> systems begins to swap. Each of the postmaster processes seem to use a +> constant amount of memory, but the total memory usage increases all the +> same. + +So . . . . what's using the memory? It doesn't sound like PG is using +it, so is it your Java app? + +If it's the Java app, then it could be that your code isn't remembering +to do things like close statements, or perhaps the max heap size is set +too large for your hardware. With early RHEL3 kernels there was also a +quirky interaction with Sun's JVM where the system swaps itself to death +even when less than half the physical memory is in use. + +If its neither PG nor Java, then perhaps you're misinterpreting the +results of top. Remember that the "free" memory on a properly running +Unix box that's been running for a while should hover just a bit above +zero due to normal caching; read up on the 'free' command to see the +actual memory utilization. + +-- Mark + +From pgsql-performance-owner@postgresql.org Thu Aug 24 11:39:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 73C819FB2B9 + for ; + Thu, 24 Aug 2006 11:39:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 71181-08 for + ; + Thu, 24 Aug 2006 14:38:55 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-23.lumeta.com + [65.246.245.23]) + by postgresql.org (Postfix) with ESMTP id 14E6A9FB1CD + for ; + Thu, 24 Aug 2006 11:38:52 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Is this way of testing a bad idea? +Date: Thu, 24 Aug 2006 10:38:47 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104B04@MAIL.corp.lumeta.com> +In-Reply-To: <1156426819.9657.227.camel@archimedes> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Is this way of testing a bad idea? +Thread-Index: AcbHgucUHI0NZi7HSC2sb0rjvPu1yAABuAdA +From: "Bucky Jordan" +To: "Mark Lewis" , + "Fredrik Israelsson" +Cc: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/388 +X-Sequence-Number: 20573 + +Also, as Tom stated, defining your test cases is a good idea before you +start benchmarking. Our application has a load data phase, then a +query/active use phase. So, we benchmark both (data loads, and then +transactions) since they're quite different workloads, and there's +different ways to optimize for each. + +For bulk loads, I would look into either batching several inserts into +one transaction or the copy command. Do some testing here to figure out +what works best for your hardware/setup (for example, we usually batch +several thousand inserts together for a pretty dramatic increase in +performance). There's usually a sweet spot in there depending on how +your WAL is configured and other concurrent activity. + +Also, when testing bulk loads, be careful to setup a realistic test. If +your application requires foreign keys and indexes, these can +significantly slow down bulk inserts. There's several optimizations- +check the mailing lists and the manual. + +And lastly, when you're loading tons of data, as previously pointed out, +the normal state of the system is to be heavily utilized (in fact, I +would think this is ideal since you know you're making full use of your +hardware). + +HTH, + +Bucky + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Mark Lewis +Sent: Thursday, August 24, 2006 9:40 AM +To: Fredrik Israelsson +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Is this way of testing a bad idea? + +> Monitoring the processes using top reveals that the total amount of +> memory used slowly increases during the test. When reaching insert +> number 40000, or somewhere around that, memory is exhausted, and the +the +> systems begins to swap. Each of the postmaster processes seem to use a +> constant amount of memory, but the total memory usage increases all +the +> same. + +So . . . . what's using the memory? It doesn't sound like PG is using +it, so is it your Java app? + +If it's the Java app, then it could be that your code isn't remembering +to do things like close statements, or perhaps the max heap size is set +too large for your hardware. With early RHEL3 kernels there was also a +quirky interaction with Sun's JVM where the system swaps itself to death +even when less than half the physical memory is in use. + +If its neither PG nor Java, then perhaps you're misinterpreting the +results of top. Remember that the "free" memory on a properly running +Unix box that's been running for a while should hover just a bit above +zero due to normal caching; read up on the 'free' command to see the +actual memory utilization. + +-- Mark + +---------------------------(end of broadcast)--------------------------- +TIP 5: don't forget to increase your free space map settings + +From pgsql-performance-owner@postgresql.org Thu Aug 24 13:05:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 955239FB336 + for ; + Thu, 24 Aug 2006 13:05:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 22821-08 for + ; + Thu, 24 Aug 2006 16:05:08 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id 755459FB312 + for ; + Thu, 24 Aug 2006 13:05:07 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) + id 1GGHhY-00048J-EY; Thu, 24 Aug 2006 09:05:04 -0700 +Subject: Re: Which benchmark to use for testing FS? +From: Jeff Davis +To: Michael Stone +Cc: pgsql-performance@postgresql.org +In-Reply-To: <20060824015054.GE2900@mathom.us> +References: <1156371783.15743.157.camel@dogma.v10.wvs> + <20060824015054.GE2900@mathom.us> +Content-Type: text/plain +Date: Thu, 24 Aug 2006 09:05:05 -0700 +Message-Id: <1156435505.15743.171.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/389 +X-Sequence-Number: 20574 + +On Wed, 2006-08-23 at 21:50 -0400, Michael Stone wrote: +> On Wed, Aug 23, 2006 at 03:23:03PM -0700, Jeff Davis wrote: +> >Also, do ext2 or UFS without soft updates run the risk of losing or +> >corrupting my data? +> +> I suggest you check the list archives; there's a lot of stuff about +> filesystems and disk configuration in there. +> + +I spent a while looking in the list archives, but the list archives have +been misbehaving lately (you click on a search result and the message +that appears doesn't have the same subject as the one you clicked on). +They may have fixed that (they are aware of the problem, according to +pgsql-www). Also, the messages I was able to find were mostly from a +long time ago. + +If you have a pointer to a particularly useful thread please let me +know. + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Thu Aug 24 13:25:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8DE9D9FB35E + for ; + Thu, 24 Aug 2006 13:25:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 66525-04 for + ; + Thu, 24 Aug 2006 16:25:08 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id 1407C9FB361 + for ; + Thu, 24 Aug 2006 13:25:07 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) + id 1GGI0k-0004RT-3d; Thu, 24 Aug 2006 09:24:54 -0700 +Subject: Re: PowerEdge 2950 questions +From: Jeff Davis +To: Merlin Moncure +Cc: Bucky Jordan , pgsql-performance@postgresql.org +In-Reply-To: +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> + +Content-Type: text/plain +Date: Thu, 24 Aug 2006 09:24:50 -0700 +Message-Id: <1156436690.15743.181.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/390 +X-Sequence-Number: 20575 + +On Thu, 2006-08-24 at 09:21 -0400, Merlin Moncure wrote: +> On 8/22/06, Jeff Davis wrote: +> > On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> > Very interesting. I always hear that people avoid RAID 5 on database +> > servers, but I suppose it always depends. Is the parity calculation +> > something that may increase commit latency vs. a RAID 10? That's +> > normally the explanation that I get. +> +> it's not the parity, it's the seeking. Raid 5 gives you great +> sequential i/o but random is often not much better than a single +> drive. Actually it's the '1' in raid 10 that plays the biggest role +> in optimizing seeks on an ideal raid controller. Calculating parity +> was boring 20 years ago as it inolves one of the fastest operations in +> computing, namely xor. :) +> + +Here's the explanation I got: If you do a write on RAID 5 to something +that is not in the RAID controllers cache, it needs to do a read first +in order to properly recalculate the parity for the write. + +However, I'm sure they try to avoid this by leaving the write in the +battery-backed cache until it's more convenient to do the read, or maybe +until the rest of the stripe is written in which case it doesn't need to +do the read. I am not sure the actual end effect. + +> > > Lastly, re your question on putting the WAL on the RAID10- I currently +> > > have the box setup as RAID5x6 with the WAL and PGDATA all on the same +> > > raidset. I haven't had the chance to do extensive tests, but from +> > > previous readings, I gather that if you have write-back enabled on the +> > > RAID, it should be ok (which it is in my case). +> +> with 6 relatively small disks I think single raid 10 volume is the +> best bet. however above 6 dedicated wal is usually worth considering. +> since wal storage requirements are so small, it's becoming affordable +> to look at solid state for the wal. +> + +I've often wondered about that. To a certain degree, that's the same +effect as just having a bigger battery-backed cache, right? + +Regards, + Jeff Davis + + +From pgsql-performance-owner@postgresql.org Thu Aug 24 15:57:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8EA5B9FB24D + for ; + Thu, 24 Aug 2006 15:57:33 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 46314-02 for + ; + Thu, 24 Aug 2006 15:57:30 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.200]) + by postgresql.org (Postfix) with ESMTP id 598BD9FB1BF + for ; + Thu, 24 Aug 2006 15:57:30 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so389220nzn + for ; + Thu, 24 Aug 2006 11:57:29 -0700 (PDT) +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=N8FFV1d5wQBZJTKlD0ZBY9yEGZijsgAe+wwXB+r4YZVljPM1UL3s6/BlfpQ6fkss53gsYMmBpoUoPfLdt07xvuHP9fpp6SwP7LVgLpBchb39QATue/ahu0X0TJbcyWgbRMZtkjstQjJbw3IRgL/pYURBPLyBocl0xto5t2YqtaM= +Received: by 10.65.84.4 with SMTP id m4mr2629988qbl; + Thu, 24 Aug 2006 11:57:29 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Thu, 24 Aug 2006 11:57:29 -0700 (PDT) +Message-ID: +Date: Thu, 24 Aug 2006 14:57:29 -0400 +From: "Merlin Moncure" +To: "Jeff Davis" +Subject: Re: PowerEdge 2950 questions +Cc: "Bucky Jordan" , pgsql-performance@postgresql.org +In-Reply-To: <1156436690.15743.181.camel@dogma.v10.wvs> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> + + <1156436690.15743.181.camel@dogma.v10.wvs> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.327 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/391 +X-Sequence-Number: 20576 + +On 8/24/06, Jeff Davis wrote: +> On Thu, 2006-08-24 at 09:21 -0400, Merlin Moncure wrote: +> > On 8/22/06, Jeff Davis wrote: +> > > On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> > it's not the parity, it's the seeking. Raid 5 gives you great +> > sequential i/o but random is often not much better than a single +> > drive. Actually it's the '1' in raid 10 that plays the biggest role +> > in optimizing seeks on an ideal raid controller. Calculating parity +> > was boring 20 years ago as it inolves one of the fastest operations in +> > computing, namely xor. :) +> +> Here's the explanation I got: If you do a write on RAID 5 to something +> that is not in the RAID controllers cache, it needs to do a read first +> in order to properly recalculate the parity for the write. + +it's worse than that. if you need to read something that is not in +the o/s cache, all the disks except for one need to be sent to a +physical location in order to get the data. Thats the basic rule with +striping: it optimizes for sequential i/o in expense of random i/o. +There are some optimizations that can help, but not much. caching by +the controller can increase performance on writes because it can +optimize the movement across the disks by instituting a delay between +the write request and the actual write. + +raid 1 (or 1+x) is the opposite. It allows the drive heads to move +independantly on reads when combined with some smart algorithms. +writes however must involve all the disk heads however. Many +controllers do not to seem to optimze raid 1 properly although linux +software raid seems to. + +A 4 disk raid 1, for example, could deliver four times the seek +performance which would make it feel much faster than a 4 disk raid 0 +under certain conditions. + +> > with 6 relatively small disks I think single raid 10 volume is the +> > best bet. however above 6 dedicated wal is usually worth considering. +> > since wal storage requirements are so small, it's becoming affordable +> > to look at solid state for the wal. +> +> I've often wondered about that. To a certain degree, that's the same +> effect as just having a bigger battery-backed cache, right? + +yeah, if the cache was big enough to cover the volume. the wal is +also fairly sequenctial i/o though so I'm not sure this would help all +that much after thinking about it. would be an interesting test +though. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 24 16:27:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CFAED9FB24D + for ; + Thu, 24 Aug 2006 16:27:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 82268-03 for + ; + Thu, 24 Aug 2006 16:27:36 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.232]) + by postgresql.org (Postfix) with ESMTP id 930799FB1BF + for ; + Thu, 24 Aug 2006 16:27:35 -0300 (ADT) +Received: by wx-out-0506.google.com with SMTP id t13so604966wxc + for ; + Thu, 24 Aug 2006 12:27:34 -0700 (PDT) +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=rAVrfEBT+Dl2U/yssc0E+1cYEoVgFSoMOoPL7GiomgxeI0dVA9VHkJ9oqyj68RbF+21ssVynfkAJHyp9DlSKYySFQn0TBhpjaJeLkBifSomrzHw79VWMGMizes/g0NPsrE5Ept97BH8m7ZX03SdEkUH20EUr9S09kfhc9hvgryA= +Received: by 10.70.69.2 with SMTP id r2mr3042015wxa; + Thu, 24 Aug 2006 12:27:34 -0700 (PDT) +Received: by 10.70.38.5 with HTTP; Thu, 24 Aug 2006 12:27:33 -0700 (PDT) +Message-ID: +Date: Thu, 24 Aug 2006 21:27:34 +0200 +From: "Claus Guttesen" +To: "Jeff Davis" +Subject: Re: PowerEdge 2950 questions +Cc: pgsql-performance@postgresql.org +In-Reply-To: <1156282448.15743.88.camel@dogma.v10.wvs> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <1156282448.15743.88.camel@dogma.v10.wvs> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.634 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/392 +X-Sequence-Number: 20577 + +> I am looking at setting up two general-purpose database servers, +> replicated with Slony. Each server I'm looking at has the following +> specs: +> +> Dell PowerEdge 2950 +> - 2 x Dual Core Intel(r) Xeon(r) 5130, 4MB Cache, 2.00GHz, 1333MHZ FSB +> - 4GB RAM +> - PERC 5/i, x6 Backplane, Integrated Controller Card (256MB battery- +> backed cache) +> - 6 x 73GB, SAS, 3.5-inch, 15K RPM Hard Drive arranged in RAID 10 + +Has anyone done any performance-comparison cpu-wise between the above +mentioned cpu and an opteron 270/280? + +Alot of attention seems to be spent on the disks and the +raid-controller which is somewhat important by itself, but this has +been covered in numorous threads other places. + +regards +Claus + +From pgsql-performance-owner@postgresql.org Thu Aug 24 16:28:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 788239FB1BF + for ; + Thu, 24 Aug 2006 16:28:52 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 58953-05 for + ; + Thu, 24 Aug 2006 16:28:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) + by postgresql.org (Postfix) with ESMTP id DE53C9FB24D + for ; + Thu, 24 Aug 2006 16:28:46 -0300 (ADT) +Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP + with MS-WebStorage 6.0.6249 +Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; + 24 Aug 2006 12:28:42 -0700 +Subject: Re: PowerEdge 2950 questions +From: Mark Lewis +To: Merlin Moncure +Cc: Jeff Davis , Bucky Jordan , + pgsql-performance@postgresql.org +In-Reply-To: +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> + + <1156436690.15743.181.camel@dogma.v10.wvs> + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Organization: MIR3, Inc. +Date: Thu, 24 Aug 2006 12:28:42 -0700 +Message-Id: <1156447722.9657.255.camel@archimedes> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.2 (2.0.2-27) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.267 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/393 +X-Sequence-Number: 20578 + +> it's worse than that. if you need to read something that is not in +> the o/s cache, all the disks except for one need to be sent to a +> physical location in order to get the data. Thats the basic rule with +> striping: it optimizes for sequential i/o in expense of random i/o. +> There are some optimizations that can help, but not much. caching by +> the controller can increase performance on writes because it can +> optimize the movement across the disks by instituting a delay between +> the write request and the actual write. +> +> raid 1 (or 1+x) is the opposite. It allows the drive heads to move +> independantly on reads when combined with some smart algorithms. +> writes however must involve all the disk heads however. Many +> controllers do not to seem to optimze raid 1 properly although linux +> software raid seems to. +> +> A 4 disk raid 1, for example, could deliver four times the seek +> performance which would make it feel much faster than a 4 disk raid 0 +> under certain conditions. + +I understand random mid-sized seeks (seek to x and read 512k) being slow +on RAID5, but if the read size is small enough not to cross a stripe +boundary, this could be optimized to only one seek on one drive. Do +most controllers just not do this, or is there some other reason that +I'm not thinking of that would force all disks to seek? + +-- Mark + +From pgsql-performance-owner@postgresql.org Thu Aug 24 16:38:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id BF5EA9FB24D + for ; + Thu, 24 Aug 2006 16:38:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 48267-10 for + ; + Thu, 24 Aug 2006 16:38:35 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 20B6E9FB1BF + for ; + Thu, 24 Aug 2006 16:38:34 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Thu, 24 Aug 2006 19:38:29 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 24 Aug 2006 14:38:28 -0500 +Subject: Re: PowerEdge 2950 questions +From: Scott Marlowe +To: Merlin Moncure +Cc: Jeff Davis , Bucky Jordan , + pgsql-performance@postgresql.org +In-Reply-To: +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> + + <1156436690.15743.181.camel@dogma.v10.wvs> + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156448308.7223.71.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Thu, 24 Aug 2006 14:38:28 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.083 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/394 +X-Sequence-Number: 20579 + +On Thu, 2006-08-24 at 13:57, Merlin Moncure wrote: +> On 8/24/06, Jeff Davis wrote: +> > On Thu, 2006-08-24 at 09:21 -0400, Merlin Moncure wrote: +> > > On 8/22/06, Jeff Davis wrote: +> > > > On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> > > it's not the parity, it's the seeking. Raid 5 gives you great +> > > sequential i/o but random is often not much better than a single +> > > drive. Actually it's the '1' in raid 10 that plays the biggest role +> > > in optimizing seeks on an ideal raid controller. Calculating parity +> > > was boring 20 years ago as it inolves one of the fastest operations in +> > > computing, namely xor. :) +> > +> > Here's the explanation I got: If you do a write on RAID 5 to something +> > that is not in the RAID controllers cache, it needs to do a read first +> > in order to properly recalculate the parity for the write. +> +> it's worse than that. if you need to read something that is not in +> the o/s cache, all the disks except for one need to be sent to a +> physical location in order to get the data. + +Ummmm. No. Not in my experience. If you need to read something that's +significantly larger than your stripe size, then yes, you'd need to do +that. With typical RAID 5 stripe sizes of 64k to 256k, you could read 8 +to 32 PostgreSQL 8k blocks from a single disk before having to move the +heads on the next disk to get the next part of data. A RAID 5, being +read, acts much like a RAID 0 with n-1 disks. + +It's the writes that kill performance, since you've got to read two +disks and write two disks for every write, at a minimum. This is why +small RAID 5 arrays bottleneck so quickly. a 4 disk RAID 4 with two +writing threads is likely already starting to thrash. + +Or did you mean something else by that? + +From pgsql-performance-owner@postgresql.org Thu Aug 24 16:51:00 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 438A29FB24D + for ; + Thu, 24 Aug 2006 16:50:59 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 58325-09 for + ; + Thu, 24 Aug 2006 16:50:45 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from MAIL.corp.lumeta.com (h65-246-245-23.lumeta.com + [65.246.245.23]) + by postgresql.org (Postfix) with ESMTP id BB6DE9FB1FE + for ; + Thu, 24 Aug 2006 16:50:45 -0300 (ADT) +X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: PowerEdge 2950 questions +Date: Thu, 24 Aug 2006 15:50:45 -0400 +Message-ID: <78ED28FACE63744386D68D8A9D1CF5D4104B1F@MAIL.corp.lumeta.com> +In-Reply-To: <1156448308.7223.71.camel@state.g2switchworks.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] PowerEdge 2950 questions +Thread-Index: AcbHtO+8x/TvQVeYRK2MReUf+ST0IQAAIasw +From: "Bucky Jordan" +To: "Scott Marlowe" , + "Merlin Moncure" +Cc: "Jeff Davis" , + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.318 tagged_above=0 required=5 tests=AWL, + SARE_BAYES_5x7 +X-Spam-Level: +X-Archive-Number: 200608/395 +X-Sequence-Number: 20580 + +Here's benchmarks of RAID5x4 vs RAID10x4 on a Dell Perc5/I with 300 GB +10k RPM SAS drives. I know these are bonnie 1.9 instead of the older +version, but maybe it might still make for useful analysis of RAID5 vs. +RAID10.=20 + +Also, unfortunately I don't have the exact numbers, but RAID10x6 +performed really poorly on the sequential IO (dd) tests- worse than the +4 disk RAID5, something around 120 MB/s. I'm currently running the +system as a RAID5x6, but would like to go back and do some further +testing if I get the chance to tear the box down again. + +These tests were run on FreeBSD 6.1 amd64 RELEASE with UFS + soft +updates. For comparison, the dd for RAID5x6 was 255 MB/s so I think the +extra disks really help out with RAID5 write performance, as Scott +pointed out. (I'm using a 128k stripe size with a 256MB writeback +cache). + +Personally, I'm not yet convinced that RAID10 offers dramatically better +performance than RAID5 for 6 disks (at least on the Dell PERC +controller), and available storgae is a significant factor for my +particular application. But I do feel the need to do more testing, so +any suggestions are appreciated. (and yes, I'll be using bonnie 1.03 in +the future, along with pgbench). + +------ RAID5x4=20 +# /usr/local/sbin/bonnie++ -d bonnie -s 1000:8k -u root +Version 1.93c ------Sequential Output------ --Sequential Input- +--Random- +Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 1000M 587 99 158889 30 127859 32 1005 99 824399 99 ++++++ +++ +Latency 14216us 181ms 48765us 56241us 1687us +47997us +Version 1.93c ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ ++++++ +++ +Latency 40365us 25us 35us 20030us 36us +52us +1.93c,1.93c,beast.corp.lumeta.com,1,1155204369,1000M,,587,99,158889,30,1 +27859,32,1005,99,824399,99,+++++,+++,16,,,,,+++++,+++,+++++,+++,+++++,++ ++,+++++,+++,+++++,+++,+++++,+++,14216us,181ms,48765us,56241us,1687us,479 +97us,40365us,25us,35us,20030us,36us,52us + +# time bash -c "(dd if=3D/dev/zero of=3Dbigfile count=3D125000 bs=3D8k = +&& sync)" +125000+0 records in +125000+0 records out +1024000000 bytes transferred in 6.375067 secs (160625763 bytes/sec) +0.037u 1.669s 0:06.42 26.3% 29+211k 30+7861io 0pf+0w + +------ RAID10 x 4 +bash-2.05b$ bonnie++ -d bonnie -s 1000:8k +Version 1.93c ------Sequential Output------ --Sequential Input- +--Random- +Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- +--Seeks-- +Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP +/sec %CP + 1000M 585 99 21705 4 28560 9 1004 99 812997 98 5436 +454 +Latency 14181us 81364us 50256us 57720us 1671us +1059ms +Version 1.93c ------Sequential Create------ --------Random +Create-------- + -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- + files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP +/sec %CP + 16 4712 10 +++++ +++ +++++ +++ 4674 10 +++++ +++ ++++++ +++ +Latency 807ms 21us 36us 804ms 110us +36us +1.93c,1.93c,beast.corp.lumeta.com,1,1155207445,1000M,,585,99,21705,4,285 +60,9,1004,99,812997,98,5436,454,16,,,,,4712,10,+++++,+++,+++++,+++,4674, +10,+++++,+++,+++++,+++,14181us,81364us,50256us,57720us,1671us,1059ms,807 +ms,21us,36us,804ms,110us,36us + +bash-2.05b$ time bash -c "(dd if=3D/dev/zero of=3Dbigfile count=3D125000 = +bs=3D8k +&& sync)" +125000+0 records in +125000+0 records out +1024000000 bytes transferred in 45.565848 secs (22472971 bytes/sec) + +- Bucky + +-----Original Message----- +From: Scott Marlowe [mailto:smarlowe@g2switchworks.com]=20 +Sent: Thursday, August 24, 2006 3:38 PM +To: Merlin Moncure +Cc: Jeff Davis; Bucky Jordan; pgsql-performance@postgresql.org +Subject: Re: [PERFORM] PowerEdge 2950 questions + +On Thu, 2006-08-24 at 13:57, Merlin Moncure wrote: +> On 8/24/06, Jeff Davis wrote: +> > On Thu, 2006-08-24 at 09:21 -0400, Merlin Moncure wrote: +> > > On 8/22/06, Jeff Davis wrote: +> > > > On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> > > it's not the parity, it's the seeking. Raid 5 gives you great +> > > sequential i/o but random is often not much better than a single +> > > drive. Actually it's the '1' in raid 10 that plays the biggest +role +> > > in optimizing seeks on an ideal raid controller. Calculating +parity +> > > was boring 20 years ago as it inolves one of the fastest +operations in +> > > computing, namely xor. :) +> > +> > Here's the explanation I got: If you do a write on RAID 5 to +something +> > that is not in the RAID controllers cache, it needs to do a read +first +> > in order to properly recalculate the parity for the write. +>=20 +> it's worse than that. if you need to read something that is not in +> the o/s cache, all the disks except for one need to be sent to a +> physical location in order to get the data.=20 + +Ummmm. No. Not in my experience. If you need to read something that's +significantly larger than your stripe size, then yes, you'd need to do +that. With typical RAID 5 stripe sizes of 64k to 256k, you could read 8 +to 32 PostgreSQL 8k blocks from a single disk before having to move the +heads on the next disk to get the next part of data. A RAID 5, being +read, acts much like a RAID 0 with n-1 disks. + +It's the writes that kill performance, since you've got to read two +disks and write two disks for every write, at a minimum. This is why +small RAID 5 arrays bottleneck so quickly. a 4 disk RAID 4 with two +writing threads is likely already starting to thrash. + +Or did you mean something else by that? + +From pgsql-performance-owner@postgresql.org Thu Aug 24 17:04:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D7EFD9FB25B + for ; + Thu, 24 Aug 2006 17:04:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 33809-05 for + ; + Thu, 24 Aug 2006 20:03:42 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.195]) + by postgresql.org (Postfix) with ESMTP id C805D9FB24D + for ; + Thu, 24 Aug 2006 17:03:41 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so402998nzn + for ; + Thu, 24 Aug 2006 13:03:40 -0700 (PDT) +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=Us0y7m2V/sAxOsNV20nVmKIj8IAT9U4SU5hfDgPGuvodVvIfwrceT+jZ87bx/80yKlJDR6FbsFqGc954KI7kJENueZqqNmoDe9PtHgvppQUIY0mf/KpzQLvB1pzBu6HycDZP9HyneJMdPY44kdaWjTz8l8XqfGEFmTUTUPJ1X9Q= +Received: by 10.64.204.3 with SMTP id b3mr2709853qbg; + Thu, 24 Aug 2006 13:03:39 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Thu, 24 Aug 2006 13:03:39 -0700 (PDT) +Message-ID: +Date: Thu, 24 Aug 2006 16:03:39 -0400 +From: "Merlin Moncure" +To: "Scott Marlowe" +Subject: Re: PowerEdge 2950 questions +Cc: "Jeff Davis" , "Bucky Jordan" , + pgsql-performance@postgresql.org +In-Reply-To: <1156448308.7223.71.camel@state.g2switchworks.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> + + <1156436690.15743.181.camel@dogma.v10.wvs> + + <1156448308.7223.71.camel@state.g2switchworks.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/396 +X-Sequence-Number: 20581 + +On 8/24/06, Scott Marlowe wrote: +> On Thu, 2006-08-24 at 13:57, Merlin Moncure wrote: +> > On 8/24/06, Jeff Davis wrote: +> > > On Thu, 2006-08-24 at 09:21 -0400, Merlin Moncure wrote: +> > > > On 8/22/06, Jeff Davis wrote: +> > > > > On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> > > > it's not the parity, it's the seeking. Raid 5 gives you great +> > > > sequential i/o but random is often not much better than a single +> > > > drive. Actually it's the '1' in raid 10 that plays the biggest role +> > > > in optimizing seeks on an ideal raid controller. Calculating parity +> > > > was boring 20 years ago as it inolves one of the fastest operations in +> > > > computing, namely xor. :) +> > > +> > > Here's the explanation I got: If you do a write on RAID 5 to something +> > > that is not in the RAID controllers cache, it needs to do a read first +> > > in order to properly recalculate the parity for the write. +> > +> > it's worse than that. if you need to read something that is not in +> > the o/s cache, all the disks except for one need to be sent to a +> > physical location in order to get the data. +> +> Ummmm. No. Not in my experience. If you need to read something that's +> significantly larger than your stripe size, then yes, you'd need to do +> that. With typical RAID 5 stripe sizes of 64k to 256k, you could read 8 +> to 32 PostgreSQL 8k blocks from a single disk before having to move the +> heads on the next disk to get the next part of data. A RAID 5, being +> read, acts much like a RAID 0 with n-1 disks. + +i just don't see raid 5 benchmarks backing that up. i know how it is +supposed to work on paper, but all of the raid 5 systems I work with +deliver lousy seek performance. here is an example from the mysql +folks: +http://peter-zaitsev.livejournal.com/14415.html +and another: +http://storageadvisors.adaptec.com/2005/10/13/raid-5-pining-for-the-fjords/ + +also, with raid 5 you are squeezed on both ends, too few disks and you +have an efficiency problem. too many disks and you start to get +concerned about mtbf and raid rebuild times. + +> It's the writes that kill performance, since you've got to read two +> disks and write two disks for every write, at a minimum. This is why +> small RAID 5 arrays bottleneck so quickly. a 4 disk RAID 4 with two +> writing threads is likely already starting to thrash. +> +> Or did you mean something else by that? + +well, that's correct, my point was that a 4 disk raid 1 can deliver +more seeks, not necessarily that it is better. as you say writes +would kill performance. raid 10 seems to be a good compromise. so is +raid 6 possibly, although i dont see a lot performance data on that. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 24 17:22:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id CCE489FB25B + for ; + Thu, 24 Aug 2006 17:22:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 12764-07 for + ; + Thu, 24 Aug 2006 17:22:23 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 37FDE9FB24D + for ; + Thu, 24 Aug 2006 17:22:22 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Thu, 24 Aug 2006 20:22:21 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 24 Aug 2006 15:22:21 -0500 +Subject: Re: PowerEdge 2950 questions +From: Scott Marlowe +To: Merlin Moncure +Cc: Jeff Davis , Bucky Jordan , + pgsql-performance@postgresql.org +In-Reply-To: +References: <78ED28FACE63744386D68D8A9D1CF5D4104ACF@MAIL.corp.lumeta.com> + <1156285374.15743.118.camel@dogma.v10.wvs> + + <1156436690.15743.181.camel@dogma.v10.wvs> + + <1156448308.7223.71.camel@state.g2switchworks.com> + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156450941.7223.83.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Thu, 24 Aug 2006 15:22:21 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.082 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/397 +X-Sequence-Number: 20582 + +On Thu, 2006-08-24 at 15:03, Merlin Moncure wrote: +> On 8/24/06, Scott Marlowe wrote: +> > On Thu, 2006-08-24 at 13:57, Merlin Moncure wrote: +> > > On 8/24/06, Jeff Davis wrote: +> > > > On Thu, 2006-08-24 at 09:21 -0400, Merlin Moncure wrote: +> > > > > On 8/22/06, Jeff Davis wrote: +> > > > > > On Tue, 2006-08-22 at 17:56 -0400, Bucky Jordan wrote: +> > > > > it's not the parity, it's the seeking. Raid 5 gives you great +> > > > > sequential i/o but random is often not much better than a single +> > > > > drive. Actually it's the '1' in raid 10 that plays the biggest role +> > > > > in optimizing seeks on an ideal raid controller. Calculating parity +> > > > > was boring 20 years ago as it inolves one of the fastest operations in +> > > > > computing, namely xor. :) +> > > > +> > > > Here's the explanation I got: If you do a write on RAID 5 to something +> > > > that is not in the RAID controllers cache, it needs to do a read first +> > > > in order to properly recalculate the parity for the write. +> > > +> > > it's worse than that. if you need to read something that is not in +> > > the o/s cache, all the disks except for one need to be sent to a +> > > physical location in order to get the data. +> > +> > Ummmm. No. Not in my experience. If you need to read something that's +> > significantly larger than your stripe size, then yes, you'd need to do +> > that. With typical RAID 5 stripe sizes of 64k to 256k, you could read 8 +> > to 32 PostgreSQL 8k blocks from a single disk before having to move the +> > heads on the next disk to get the next part of data. A RAID 5, being +> > read, acts much like a RAID 0 with n-1 disks. +> +> i just don't see raid 5 benchmarks backing that up. i know how it is +> supposed to work on paper, but all of the raid 5 systems I work with +> deliver lousy seek performance. here is an example from the mysql +> folks: +> http://peter-zaitsev.livejournal.com/14415.html +> and another: +> http://storageadvisors.adaptec.com/2005/10/13/raid-5-pining-for-the-fjords/ + +Well, I've seen VERY good numbers out or RAID 5 arrays. As long as I +wasn't writing to them. :) + +Trust me though, I'm no huge fan of RAID 5. + +> > It's the writes that kill performance, since you've got to read two +> > disks and write two disks for every write, at a minimum. This is why +> > small RAID 5 arrays bottleneck so quickly. a 4 disk RAID 4 with two +> > writing threads is likely already starting to thrash. +> > +> > Or did you mean something else by that? +> +> well, that's correct, my point was that a 4 disk raid 1 can deliver +> more seeks, not necessarily that it is better. as you say writes +> would kill performance. raid 10 seems to be a good compromise. so is +> raid 6 possibly, although i dont see a lot performance data on that. + +Yeah, I think RAID 10, in this modern day of large, inexpensive hard +drives, is the way to go for most transactional / heavily written +systems. + +I'm not sure RAID-6 is worth the effort. For smaller arrays (4 to 6), +you've got about as many "extra" drives as in RAID 1+0. And that old +read twice write twice penalty becomes read twice (or is that thrice???) +and write thrice. So, you'd chew up your iface bandwidth quicker. +Although in SAS / SATA I guess that part's not a big deal, the data has +to be moved around somewhere on the card / in the controller chips, so +it's still a problem somewhere waiting to happen in terms of bandwidth. + +From pgsql-performance-owner@postgresql.org Thu Aug 24 17:29:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DB6ED9FB384 + for ; + Thu, 24 Aug 2006 17:29:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 21457-06 for + ; + Thu, 24 Aug 2006 17:29:26 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.194]) + by postgresql.org (Postfix) with ESMTP id 153969FB25B + for ; + Thu, 24 Aug 2006 17:29:25 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so408576nzn + for ; + Thu, 24 Aug 2006 13:29:24 -0700 (PDT) +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=MQq9mc2b5tR6Yuj9hF8eoiFZzUeMfimk2L2Sb82btOoMbefbHY+hPU3Msppy0WTK+3keGqF3xOEli5htIoJwUgT76vjAic8EraKZZHSg5VnDQH46WXpFvGl+91il3TvNtm7w6qQfDqiyiT4/n2XmME+ZMVSGfr6O/kcEX14DRek= +Received: by 10.65.73.16 with SMTP id a16mr2752654qbl; + Thu, 24 Aug 2006 13:29:24 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Thu, 24 Aug 2006 13:29:24 -0700 (PDT) +Message-ID: +Date: Thu, 24 Aug 2006 16:29:24 -0400 +From: "Merlin Moncure" +To: "Bucky Jordan" +Subject: Re: PowerEdge 2950 questions +Cc: "Scott Marlowe" , + "Jeff Davis" , pgsql-performance@postgresql.org +In-Reply-To: <78ED28FACE63744386D68D8A9D1CF5D4104B1F@MAIL.corp.lumeta.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <1156448308.7223.71.camel@state.g2switchworks.com> + <78ED28FACE63744386D68D8A9D1CF5D4104B1F@MAIL.corp.lumeta.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.324 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/398 +X-Sequence-Number: 20583 + +On 8/24/06, Bucky Jordan wrote: +> Here's benchmarks of RAID5x4 vs RAID10x4 on a Dell Perc5/I with 300 GB +> 10k RPM SAS drives. I know these are bonnie 1.9 instead of the older +> version, but maybe it might still make for useful analysis of RAID5 vs. +> RAID10. + +> ------ RAID5x4 +i dont see the seeks here, am i missing something? + +[raid 10 dd] +> 1024000000 bytes transferred in 45.565848 secs (22472971 bytes/sec) + +ouch. this is a problem with the controller. it should be higher than +this but the raid 5 should edge it out regardless. try configuring +the hardware as a jbod and doing the raid 10 in software. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 24 17:48:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4ACCE9FB28E + for ; + Thu, 24 Aug 2006 17:48:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 71373-02 for + ; + Thu, 24 Aug 2006 20:47:57 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.203]) + by postgresql.org (Postfix) with ESMTP id EA15C9FB25B + for ; + Thu, 24 Aug 2006 17:47:56 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so412142nzn + for ; + Thu, 24 Aug 2006 13:47:55 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; + b=fITYjgYPcgn0tLHlRnZVjLvnbEFpf3rDWSsyGEGL7wtfmpAxmGuVk1GjVqohsFfavGQfyI9mQiNr3ZACsTeCT8hzPO3bx20i4X5PwHDxXOb08xtHCIBLr4VOjwINM2uDAUy6lDGHCuLR/N79BbhmM1MypNofnCeCsWsYCfvmm2k= +Received: by 10.64.193.8 with SMTP id q8mr2787519qbf; + Thu, 24 Aug 2006 13:47:55 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Thu, 24 Aug 2006 13:47:55 -0700 (PDT) +Message-ID: +Date: Thu, 24 Aug 2006 16:47:55 -0400 +From: "Merlin Moncure" +To: "PGSQL Performance" +Subject: adtx +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 + tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/399 +X-Sequence-Number: 20584 + +We recently here picked up a adtx san and are having good results with +it. It's pretty flexible, having dual 4gb fc controllers and also dual +sas controllers do you can run it as attached sas or fc. Both have +their advantages and unfortuantely I didn't have time to do much +benchmarking becuase we had to get the unit into production pretty +quickly. + +With both controllers running (we did dual 7 drive raid 5 + hot spare) +we were able to push about 550 mb/sec onto the unit using a dual +ported qlogic fc hba. This was on 750g sata disks :) you can also put +sas drives in it for more of a db oriented box. The seeks were good +but not great, about 400 on each side, but I have a feeling this could +be optmiized playing with various software/hardware raid strategies +which we didn't have time to do (this is set up as a file server, not +a db server). + +At some point in the future we are gearing up a new database server +and I get to set it up one or two more as attached sas, which should +be interesting. + +While these are not brain-busting 'Luke Lonergan' realm numbers, it's +a very solid unit and comes cheap in my opinion. + +merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 24 20:44:38 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3C8DA9FB228 + for ; + Thu, 24 Aug 2006 20:44:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 51619-06 for + ; + Thu, 24 Aug 2006 23:44:17 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from natasha.counterpane.com (natasha.hq.counterpane.com + [208.162.171.162]) + by postgresql.org (Postfix) with SMTP id EF9639FB1C5 + for ; + Thu, 24 Aug 2006 20:44:13 -0300 (ADT) +Received: from kraken.hq.counterpane.com ([172.16.2.55]) by + natasha.counterpane.com; Thu, 24 Aug 2006 23:44:04 +0000 (UTC) +Received: From bluefish.counterpane.com ([172.16.2.51]) by kraken.cis.local + (WebShield SMTP v4.5 MR2); + id 1156463044573; Thu, 24 Aug 2006 16:44:04 -0700 +Received: from achilles.cis.local ([172.16.2.26]) + by bluefish.counterpane.com (PGP Universal service); + Thu, 24 Aug 2006 16:44:04 -0700 +X-PGP-Universal: processed; + by bluefish.counterpane.com on Thu, 24 Aug 2006 16:44:04 -0700 +Received: From ca-mail1.cis.local ([172.16.2.54]) by achilles.cis.local + (WebShield SMTP v4.5 MR2); + id 1156463039849; Thu, 24 Aug 2006 16:43:59 -0700 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----_=_NextPart_001_01C6C7D7.2C0EADEE" +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Subject: select max(column) from parent table very slow +Date: Thu, 24 Aug 2006 16:43:53 -0700 +Message-ID: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: select max(column) from parent table very slow +Thread-Index: AcbH1yhNNjFiQ3zqQzGNtQORuI70Lw== +From: "Sriram Dandapani" +To: "Pgsql-Performance \(E-mail\)" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_HELO_SOFTFAIL, SPF_SOFTFAIL +X-Spam-Level: *** +X-Archive-Number: 200608/400 +X-Sequence-Number: 20585 + +This is a multi-part message in MIME format. + +------_=_NextPart_001_01C6C7D7.2C0EADEE +Content-Type: text/plain; + charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable + +Parent table has a column say column1 which is indexed (parent table and +all child tables are indexed on that column) + +=20 + +When a select max(column1) is done on parent table..takes a very long +time to get back with the result + +The same query on a child table gives instantaneous response (the tables +are quite large appx.each child table has about 20-30 million rows) + +=20 + +Constraint exclusion is turned on. The column is not the basis for +partitioning. Postgres 8.1.2 + + +------_=_NextPart_001_01C6C7D7.2C0EADEE +Content-Type: text/html; + charset="US-ASCII" +Content-Transfer-Encoding: quoted-printable + + + + + + + + + + + + +
+ +

Parent table has a column say column1 which is = +indexed +(parent table and all child tables are indexed on that = +column)

+ +

 

+ +

When a select max(column1) is done on parent = +table..takes a +very long time to get back with the result

+ +

The same query on a child table gives instantaneous = +response +(the tables are quite large appx.each child table has about 20-30 = +million rows)

+ +

 

+ +

Constraint exclusion is turned on. The column is not = +the +basis for partitioning. Postgres 8.1.2

+ +
+ + + + + +------_=_NextPart_001_01C6C7D7.2C0EADEE-- + +From pgsql-performance-owner@postgresql.org Thu Aug 24 22:09:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B17939FA646 + for ; + Thu, 24 Aug 2006 22:09:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 31031-07 for + ; + Thu, 24 Aug 2006 22:08:59 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 5D4319FB24D + for ; + Thu, 24 Aug 2006 22:08:59 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7P18oWS013576 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Thu, 24 Aug 2006 18:08:56 -0700 +Message-ID: <44EE4DA1.5060701@commandprompt.com> +Date: Thu, 24 Aug 2006 18:08:49 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Sriram Dandapani +CC: "Pgsql-Performance (E-mail)" +Subject: Re: select max(column) from parent table very slow +References: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> +In-Reply-To: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Thu, 24 Aug 2006 18:08:56 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.212 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/401 +X-Sequence-Number: 20586 + +Sriram Dandapani wrote: +> Parent table has a column say column1 which is indexed (parent table and +> all child tables are indexed on that column) +> + +Do you mean? + +select max(foo) from bar; + +In older versions of postgresql that would scan the whole table. In 8.1 +and above it doesn't. However, I am guess that since this is a +partitioned table the planner isn't smart enough to just perform the +query on each child and a max on the set that is returned. Thus you are +scanning each table completely. + +But that is just a guess. + +Joshua D. Drake + + +> +> +> When a select max(column1) is done on parent table..takes a very long +> time to get back with the result +> +> The same query on a child table gives instantaneous response (the tables +> are quite large appx.each child table has about 20-30 million rows) +> +> +> +> Constraint exclusion is turned on. The column is not the basis for +> partitioning. Postgres 8.1.2 + + + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Fri Aug 25 01:33:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 671F49FB46B + for ; + Fri, 25 Aug 2006 01:33:34 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 66009-03 for + ; + Fri, 25 Aug 2006 01:33:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 6B9829FB462 + for ; + Fri, 25 Aug 2006 01:33:30 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7P4XS8n018395; + Fri, 25 Aug 2006 00:33:28 -0400 (EDT) +To: "Joshua D. Drake" +cc: Sriram Dandapani , + "Pgsql-Performance (E-mail)" +Subject: Re: select max(column) from parent table very slow +In-reply-to: <44EE4DA1.5060701@commandprompt.com> +References: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> + <44EE4DA1.5060701@commandprompt.com> +Comments: In-reply-to "Joshua D. Drake" + message dated "Thu, 24 Aug 2006 18:08:49 -0700" +Date: Fri, 25 Aug 2006 00:33:27 -0400 +Message-ID: <18394.1156480407@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.145 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/402 +X-Sequence-Number: 20587 + +"Joshua D. Drake" writes: +> Sriram Dandapani wrote: +>> Parent table has a column say column1 which is indexed (parent table and +>> all child tables are indexed on that column) + +> In older versions of postgresql that would scan the whole table. In 8.1 +> and above it doesn't. However, I am guess that since this is a +> partitioned table the planner isn't smart enough to just perform the +> query on each child and a max on the set that is returned. + +It is not. Feel free to submit a patch for planagg.c ... + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Fri Aug 25 02:17:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A06899FB491 + for ; + Fri, 25 Aug 2006 02:17:13 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 67942-03 for + ; + Fri, 25 Aug 2006 02:17:08 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 7AB9F9FB48B + for ; + Fri, 25 Aug 2006 02:17:08 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7P5GtJQ017421 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Thu, 24 Aug 2006 22:17:11 -0700 +Message-ID: <44EE87BB.4050104@commandprompt.com> +Date: Thu, 24 Aug 2006 22:16:43 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Tom Lane +CC: Sriram Dandapani , + "Pgsql-Performance (E-mail)" +Subject: Re: select max(column) from parent table very slow +References: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> + <44EE4DA1.5060701@commandprompt.com> + <18394.1156480407@sss.pgh.pa.us> +In-Reply-To: <18394.1156480407@sss.pgh.pa.us> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Thu, 24 Aug 2006 22:17:11 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.212 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/403 +X-Sequence-Number: 20588 + +Tom Lane wrote: +> "Joshua D. Drake" writes: +>> Sriram Dandapani wrote: +>>> Parent table has a column say column1 which is indexed (parent table and +>>> all child tables are indexed on that column) +> +>> In older versions of postgresql that would scan the whole table. In 8.1 +>> and above it doesn't. However, I am guess that since this is a +>> partitioned table the planner isn't smart enough to just perform the +>> query on each child and a max on the set that is returned. +> +> It is not. Feel free to submit a patch for planagg.c ... + +I think my patch to pgbench may have set your expectations of me a bit +high ;)... + +Joshua D. Drake + + +> +> regards, tom lane +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Fri Aug 25 11:46:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3DB6E9FBAD4 + for ; + Fri, 25 Aug 2006 11:46:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 70927-06 for + ; + Fri, 25 Aug 2006 11:45:56 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id B56B09FBAD1 + for ; + Fri, 25 Aug 2006 11:45:56 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7PEjrI5029092; + Fri, 25 Aug 2006 07:45:54 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 7E2DCC2DC58; Fri, 25 Aug 2006 10:45:30 -0400 (CLT) +Date: Fri, 25 Aug 2006 10:45:30 -0400 +From: Alvaro Herrera +To: "Joshua D. Drake" +Cc: Tom Lane , + Sriram Dandapani , + "Pgsql-Performance (E-mail)" +Subject: Re: select max(column) from parent table very slow +Message-ID: <20060825144530.GA14622@alvh.no-ip.org> +Mail-Followup-To: "Joshua D. Drake" , + Tom Lane , + Sriram Dandapani , + "Pgsql-Performance (E-mail)" +References: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> + <44EE4DA1.5060701@commandprompt.com> + <18394.1156480407@sss.pgh.pa.us> + <44EE87BB.4050104@commandprompt.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44EE87BB.4050104@commandprompt.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Fri, 25 Aug 2006 07:45:54 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.338 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/404 +X-Sequence-Number: 20589 + +Joshua D. Drake wrote: +> Tom Lane wrote: +> >"Joshua D. Drake" writes: +> >>Sriram Dandapani wrote: +> >>>Parent table has a column say column1 which is indexed (parent table and +> >>>all child tables are indexed on that column) +> > +> >>In older versions of postgresql that would scan the whole table. In 8.1 +> >>and above it doesn't. However, I am guess that since this is a +> >>partitioned table the planner isn't smart enough to just perform the +> >>query on each child and a max on the set that is returned. +> > +> >It is not. Feel free to submit a patch for planagg.c ... +> +> I think my patch to pgbench may have set your expectations of me a bit +> high ;)... + +Actually I think this is the perfect opportunity for you -- a patch that +not only was absolutely unexpected, undiscussed, and posted without +previous warning, but one that you were actually asked about! And +weren't you recently joking about giving Tom nightmares by sending +patches to the optimizer? + + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +PostgreSQL Replication, Consulting, Custom Development, 24x7 support + +From pgsql-performance-owner@postgresql.org Fri Aug 25 12:23:46 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id DB9BF9FBB31 + for ; + Fri, 25 Aug 2006 12:23:45 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 77776-01 for + ; + Fri, 25 Aug 2006 15:23:37 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id CA8849FBB25 + for ; + Fri, 25 Aug 2006 12:23:36 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7PFNY1O029984 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Fri, 25 Aug 2006 08:23:35 -0700 +Message-ID: <44EF15F9.7040807@commandprompt.com> +Date: Fri, 25 Aug 2006 08:23:37 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: "Joshua D. Drake" , Tom Lane , + Sriram Dandapani , + "Pgsql-Performance (E-mail)" +Subject: Re: select max(column) from parent table very slow +References: <6992E470F12A444BB787B5C937B9D4DF057500BF@ca-mail1.cis.local> + <44EE4DA1.5060701@commandprompt.com> + <18394.1156480407@sss.pgh.pa.us> + <44EE87BB.4050104@commandprompt.com> + <20060825144530.GA14622@alvh.no-ip.org> +In-Reply-To: <20060825144530.GA14622@alvh.no-ip.org> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Fri, 25 Aug 2006 08:23:35 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/405 +X-Sequence-Number: 20590 + +>>>> query on each child and a max on the set that is returned. +>>> It is not. Feel free to submit a patch for planagg.c ... +>> I think my patch to pgbench may have set your expectations of me a bit +>> high ;)... +> +> Actually I think this is the perfect opportunity for you -- a patch that +> not only was absolutely unexpected, undiscussed, and posted without +> previous warning, but one that you were actually asked about! And +> weren't you recently joking about giving Tom nightmares by sending +> patches to the optimizer? + +Yeah, but Tom is getting up there a bit, and that might mean a heart +attack. Then what would we do? ;) + +Joshua D. Drake + + +> +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Fri Aug 25 12:53:50 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 0248F9FBB5F + for ; + Fri, 25 Aug 2006 12:53:49 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 77791-08 for + ; + Fri, 25 Aug 2006 15:53:39 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.179]) + by postgresql.org (Postfix) with ESMTP id 701EB9FBB49 + for ; + Fri, 25 Aug 2006 12:53:39 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so1249873pyd + for ; + Fri, 25 Aug 2006 08:53:38 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:to:subject:mime-version:content-type; + b=kSOgQSbZhZD0te3UzgjiVxr0wTNeQda30dBFTEIoL5ioSSflN63o5cM1vchm6UWZ4s0RDH8BW2TO4RzmLjOpUsMvxWlSLzUqt1fH0M/zhce3Pu7Ayc4ecUzi286NgRJKV87F9WG+GOg6scc2Qy8P5iQKzxHke2fBWjuSkezJkgM= +Received: by 10.35.109.2 with SMTP id l2mr5359115pym; + Fri, 25 Aug 2006 08:53:38 -0700 (PDT) +Received: by 10.35.9.8 with HTTP; Fri, 25 Aug 2006 08:53:38 -0700 (PDT) +Message-ID: <9f2e40a90608250853w2705c6ber6ea772c6072a712d@mail.gmail.com> +Date: Fri, 25 Aug 2006 21:23:38 +0530 +From: "soni de" +To: pgsql-performance@postgresql.org +Subject: Related to Inserting into the database from XML file +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_142312_13650000.1156521218611" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=HTML_30_40, + HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/406 +X-Sequence-Number: 20591 + +------=_Part_142312_13650000.1156521218611 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hello, + +I want to ask, Is there any way to insert records from XML file to the +postgres database? + +Please provide me some help regarding above query. + +Postgres version which we are using is 7.2.4 + +Thanks, +Sonal + +------=_Part_142312_13650000.1156521218611 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +
Hello,
+
 
+
I want to ask, Is there any way to insert records from XML file to the postgres database?
+
 
+
Please provide me some help regarding above query.
+
 
+
Postgres version which we are using is 7.2.4
+
 
+
Thanks,
+
Sonal
+ +------=_Part_142312_13650000.1156521218611-- + +From pgsql-performance-owner@postgresql.org Fri Aug 25 13:19:35 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 6D3379FBB73 + for ; + Fri, 25 Aug 2006 13:19:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 83379-10 for + ; + Fri, 25 Aug 2006 13:19:30 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from servata.com (ip-216-152-249-241.servata.com [216.152.249.241]) + by postgresql.org (Postfix) with ESMTP id 1EDB29FBB6A + for ; + Fri, 25 Aug 2006 13:19:30 -0300 (ADT) +Received: from [209.162.219.253] (helo=dogma.v10.wvs) + by servata.com with esmtpa (Exim 4.50) + id 1GGeP0-00066s-Ij; Fri, 25 Aug 2006 09:19:26 -0700 +Subject: Re: Related to Inserting into the database from XML file +From: Jeff Davis +To: soni de +Cc: pgsql-performance@postgresql.org +In-Reply-To: <9f2e40a90608250853w2705c6ber6ea772c6072a712d@mail.gmail.com> +References: <9f2e40a90608250853w2705c6ber6ea772c6072a712d@mail.gmail.com> +Content-Type: text/plain +Date: Fri, 25 Aug 2006 09:19:27 -0700 +Message-Id: <1156522767.1347.22.camel@dogma.v10.wvs> +Mime-Version: 1.0 +X-Mailer: Evolution 2.0.4 (2.0.4-7) +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.279 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/407 +X-Sequence-Number: 20592 + +On Fri, 2006-08-25 at 21:23 +0530, soni de wrote: +> Hello, +> +> I want to ask, Is there any way to insert records from XML file to the +> postgres database? + +Try the contrib/xml2 module. + +> +> Please provide me some help regarding above query. +> +> Postgres version which we are using is 7.2.4 +> + +I highly recommend upgrading if at all possible. That's quite an old +version. + +Hope this helps, + Jeff Davis + + + +From pgsql-performance-owner@postgresql.org Fri Aug 25 13:55:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6776A9FBB93 + for ; + Fri, 25 Aug 2006 13:55:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 96200-06 for + ; + Fri, 25 Aug 2006 16:54:55 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx-serv.inrialpes.fr (mx-serv.inrialpes.fr [194.199.18.100]) + by postgresql.org (Postfix) with ESMTP id 94A089FBB6C + for ; + Fri, 25 Aug 2006 13:54:53 -0300 (ADT) +Received: from vilnius.inrialpes.fr (vilnius.inrialpes.fr [194.199.18.81]) + by mx-serv.inrialpes.fr (8.13.6/8.13.0) with ESMTP id k7PGsmYp000425 + for ; + Fri, 25 Aug 2006 18:54:48 +0200 (MEST) +Received: from [194.199.25.12] (magnesium.inrialpes.fr [194.199.25.12]) + by vilnius.inrialpes.fr (8.13.6/8.11.3/ImagV2) with ESMTP id + k7PGsl0v027434 for ; + Fri, 25 Aug 2006 18:54:47 +0200 (MEST) +Message-ID: <44EF2BE4.5050301@inrialpes.fr> +Date: Fri, 25 Aug 2006 18:57:08 +0200 +From: Jean Arnaud +User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Changing max_connections without restart ? +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 8bit +X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 + (mx-serv.inrialpes.fr [194.199.18.100]); + Fri, 25 Aug 2006 18:54:48 +0200 (MEST) +X-mx-serv-inrialpes-fr-MailScanner-Information: Please contact + postmaster@inrialpes.fr for more information +X-mx-serv-inrialpes-fr-MailScanner: Found to be clean +X-mx-serv-inrialpes-fr-MailScanner-SpamCheck: n'est pas un polluriel, + SpamAssassin (score=0, requis 6) +X-mx-serv-inrialpes-fr-MailScanner-From: jean.arnaud@inrialpes.fr +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/408 +X-Sequence-Number: 20593 + +Hi ! + +I'm looking for a way to change the "max_connections" parameter without +restarting the PostGreSQL database. +All the docs i found online are saying that this option can only be set +on startup (-N option to comand-line) or by changing it in postgresql.conf. + +Does anyone know how to do it ? + +Thanks + +-- +-- Jean Arnaud +-- Projet SARDES +-- INRIA Rh�ne-Alpes / LSR-IMAG +-- T�l. : +33 (0)4 76 61 52 80 + + +From pgsql-performance-owner@postgresql.org Fri Aug 25 14:55:32 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 23AB19FBBE4 + for ; + Fri, 25 Aug 2006 14:55:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 05772-09 for + ; + Fri, 25 Aug 2006 17:55:24 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 154CA9FBBCE + for ; + Fri, 25 Aug 2006 14:55:23 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7PHtK15003394; + Fri, 25 Aug 2006 13:55:20 -0400 (EDT) +To: Jean Arnaud +cc: pgsql-performance@postgresql.org +Subject: Re: Changing max_connections without restart ? +In-reply-to: <44EF2BE4.5050301@inrialpes.fr> +References: <44EF2BE4.5050301@inrialpes.fr> +Comments: In-reply-to Jean Arnaud + message dated "Fri, 25 Aug 2006 18:57:08 +0200" +Date: Fri, 25 Aug 2006 13:55:20 -0400 +Message-ID: <3393.1156528520@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/409 +X-Sequence-Number: 20594 + +Jean Arnaud writes: +> I'm looking for a way to change the "max_connections" parameter without +> restarting the PostGreSQL database. + +There is none. That's one of the parameters that determines shared +memory array sizes, and we can't change those on-the-fly. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Sat Aug 26 14:13:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D0F099FC19B + for ; + Sat, 26 Aug 2006 14:13:27 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 35187-06 for + ; + Sat, 26 Aug 2006 14:13:23 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mis010-1.exch010.intermedia.net + (mis010-1.exch010.intermedia.net [64.78.61.91]) + by postgresql.org (Postfix) with ESMTP id 376269FC132 + for ; + Sat, 26 Aug 2006 14:13:22 -0300 (ADT) +Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by + mis010-1.exch010.intermedia.net with Microsoft + SMTPSVC(6.0.3790.1830); Sat, 26 Aug 2006 10:13:21 -0700 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: stats reset during pg_restore? +Date: Sat, 26 Aug 2006 10:13:19 -0700 +Message-ID: + <8C5B026B51B6854CBE88121DBF097A863CD6CA@ehost010-33.exch010.intermedia.net> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: stats reset during pg_restore? +Thread-Index: AcbFb0AzPQabV5CtTCKQ8onBzlDM0ADw2tNw +From: "George Pavlov" +To: +X-OriginalArrivalTime: 26 Aug 2006 17:13:21.0358 (UTC) + FILETIME=[EE806EE0:01C6C932] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/410 +X-Sequence-Number: 20595 + +This did not have any takers in pgsql-general. Maybe +performance-oriented folks can shed light? The basic question is if +there is a way to preserve stats during pg_restore? + + +-----Original Message----- +From: pgsql-general-owner@postgresql.org +[mailto:pgsql-general-owner@postgresql.org] On Behalf Of George Pavlov +Sent: Monday, August 21, 2006 3:15 PM +To: pgsql-general@postgresql.org +Subject: [GENERAL] stats reset during pg_restore? + +I would like to analyze server stats offline, so I attempt to pg_dump my +production database and then pg_restore it into another database. In the +process all stats seem to be reset (they are not completely zeroed). So +in production I have a table with the following stats (from +pg_stat_all_tables as an example): + +relid | 25519576 +relname | property_contact +seq_scan | 5612 +seq_tup_read | 569971320 +idx_scan | 4486454 +idx_tup_fetch | 180100369 +n_tup_ins | 39114 +n_tup_upd | 17553 +n_tup_del | 21877 + +After I restore the stats for the same table look like this: + +relid | 104017313 +relname | property_contact +seq_scan | 9 +seq_tup_read | 992493 +idx_scan | 0 +idx_tup_fetch | 0 +n_tup_ins | 110277 +n_tup_upd | 0 +n_tup_del | 0 + +These look like stats for table accesses during the restore itself: +11027 is indeed the number of rows in the table, and 992493 / 110277 =3D +9, which happens to be the number of indexes and FK constraints on the +table. + +I do have stats_reset_on_server_start =3D off on both servers. + +Can someone share what exatly happens with stats upon restore? Also is +there anything one can do to keep them intact during a dump/restore?=20 + +Apologies if already discussed--I failed to find any references. + +TIA, + +George + +From pgsql-performance-owner@postgresql.org Sat Aug 26 17:12:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id F24FE9FC267 + for ; + Sat, 26 Aug 2006 17:12:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 48341-01 for + ; + Sat, 26 Aug 2006 17:11:56 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) + by postgresql.org (Postfix) with ESMTP id 81C8C9FC27D + for ; + Sat, 26 Aug 2006 17:11:56 -0300 (ADT) +Received: by floppy.pyrenet.fr (Postfix, from userid 106) + id 4F58A308E2; Sat, 26 Aug 2006 22:11:55 +0200 (MET DST) +From: Hayes +X-Newsgroups: pgsql.performance +Subject: [8.1.4] Help optimizing query +Date: Sat, 26 Aug 2006 16:11:54 -0400 +Organization: Hayes, Inc. +Lines: 167 +Message-ID: +X-Complaints-To: usenet@news.hub.org +Mail-Copies-To: poster +User-Agent: MT-NewsWatcher/3.4 (PPC Mac OS X) +To: pgsql-performance@postgresql.org +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/411 +X-Sequence-Number: 20596 + +Hi all, + +I need help making the below query go faster. There are about 5 of +these being done +in one report. Some use joins instead of subselects but they all go +about the same speed. +I'm not much of a SQL person so I just threw indices on everything +involved but it still +takes about at least 19sec and sometimes as much as 60s. I'd be happy +to get it to about +5s. + +Other info: random_page_cost is 4 as I/O on this box as kinda slow. +It's a converted desktop with a single IDE drive. shared_buffers is +12500 and effective_page_cache is 100M. I upped the statistics on +entry_date and session_id to 1000. I analyzed the tables after +modifying the statistics. The actual deployment platform is a lot +beefier but I'd like these queries to at least be tolerable on this +machine. + +I can see that the estimate for the GroupAggregate is off, if I'm +interpreting things correctly, but I don't know what to do about it. + +tia, +arturo + +Query: + +SELECT subscription_id, + to_char(sum(session_length), 'HH24:MI:SS') as session_length, + sum(hits) as hits, + 2006 as theYear, + 2 as theQuarter, + sum(count) as count +FROM ( + SELECT subscription_id, + count(distinct session_id) as count, + age(MAX(entry_date),MIN(entry_date)) as session_length, + COUNT(action) as hits + FROM + extended_user JOIN user_tracking USING (user_id) + WHERE subscription_id > 0 AND + EXTRACT(year from entry_date) = 2006 AND + EXTRACT(quarter from entry_date) = 2 + GROUP BY session_id, + subscription_id + ) as session_stuff + WHERE subscription_id > 0 + GROUP BY subscription_id + ORDER BY subscription_id; + + +Sort (cost=123305.88..123306.38 rows=200 width=36) (actual +time=75039.706..75040.500 rows=258 loops=1) + Sort Key: session_stuff.subscription_id + -> HashAggregate (cost=123294.24..123298.24 rows=200 width=36) +(actual time=75036.487..75038.360 rows=258 loops=1) + -> GroupAggregate (cost=108839.34..118475.94 rows=240915 +width=72) (actual time=68016.583..74702.710 rows=38369 loops=1) + -> Sort (cost=108839.34..109441.63 rows=240915 +width=72) (actual time=67978.193..68982.962 rows=245727 loops=1) + Sort Key: user_tracking.session_id, +extended_user.subscription_id + -> Hash Join (cost=7746.59..75492.37 rows=240915 +width=72) (actual time=16944.487..50737.230 rows=245727 loops=1) + Hash Cond: ("outer".user_id = "inner".user_id) + -> Bitmap Heap Scan on user_tracking +(cost=7524.10..68644.10 rows=240950 width=72) (actual +time=16843.695..48306.383 rows=258923 loops=1) + Recheck Cond: +((date_part('quarter'::text, entry_date) = 2::double precision) AND +(date_part('year'::text, entry_date) = 2006::double precision)) + -> BitmapAnd (cost=7524.10..7524.10 +rows=240950 width=0) (actual time=16779.178..16779.178 rows=0 loops=1) + -> Bitmap Index Scan on +user_tracking_quarter_idx (cost=0.00..3331.51 rows=533288 width=0) +(actual time=9079.545..9079.545 rows=533492 loops=1) + Index Cond: +(date_part('quarter'::text, entry_date) = 2::double precision) + -> Bitmap Index Scan on +user_tracking_year_idx (cost=0.00..4192.34 rows=671239 width=0) (actual +time=7685.906..7685.906 rows=671787 loops=1) + Index Cond: +(date_part('year'::text, entry_date) = 2006::double precision) + -> Hash (cost=206.42..206.42 rows=6428 +width=8) (actual time=100.754..100.754 rows=6411 loops=1) + -> Seq Scan on extended_user +(cost=0.00..206.42 rows=6428 width=8) (actual time=0.020..28.873 +rows=6411 loops=1) + Filter: ((subscription_id > 0) +AND (subscription_id > 0)) + Total runtime: 75069.453 ms + +Tables: + +This one has about 6-7k rows. + + Table "public.extended_user" + Column | Type | Modifiers +-------------------+--------------------------+----------- + create_date | timestamp with time zone | not null + email | character varying(99) | + first_name | character varying(99) | not null + last_name | character varying(99) | not null + license_agreement | boolean | not null + license_date | timestamp with time zone | + password | character varying(32) | not null + subscription_id | integer | not null + user_id | integer | not null + user_name | character varying(99) | not null +Indexes: + "extended_user_pkey" PRIMARY KEY, btree (user_id) + "extended_user_subscription_id_idx" btree (subscription_id) + "extended_user_subscription_idx" btree (subscription_id) +Foreign-key constraints: + "extended_user_subscription_id_fkey" FOREIGN KEY (subscription_id) +REFERENCES subscription(subscription_id) DEFERRABLE INITIALLY DEFERRED + +This one has about 2k rows. + + Table "public.subscription" + Column | Type | Modifiers +------------------+--------------------------+----------- + allow_printing | boolean | not null + company_id | character varying(50) | not null + company_name | character varying(100) | not null + end_date | timestamp with time zone | + licenses | integer | not null + pass_through_key | character varying(50) | + start_date | timestamp with time zone | not null + subscription_id | integer | not null +Indexes: + "subscription_pkey" PRIMARY KEY, btree (subscription_id) + + +This one has about 1.4M rows. It's kind of a log of pages visited. + + Table +"public.user_tracking" + Column | Type | +Modifiers +------------------+-----------------------------+------------------------ +-------------------------------------------------- + action | character varying(255) | not null + entry_date | timestamp without time zone | not null + note | text | + report_id | integer | + session_id | character varying(255) | not null + user_id | integer | + user_tracking_id | integer | not null default +nextval('user_tracking_user_tracking_id_seq'::regclass) +Indexes: + "user_tracking_pkey" PRIMARY KEY, btree (user_tracking_id) + "user_tracking_entry_date_idx" btree (entry_date) + "user_tracking_month_idx" btree (date_part('month'::text, +entry_date)) + "user_tracking_quarter_idx" btree (date_part('quarter'::text, +entry_date)) + "user_tracking_report_id_idx" btree (report_id) + "user_tracking_session_idx" btree (session_id) + "user_tracking_user_id_idx" btree (user_id) + "user_tracking_year_idx" btree (date_part('year'::text, entry_date)) +Foreign-key constraints: + "user_tracking_report_id_fkey" FOREIGN KEY (report_id) REFERENCES +article(article_id) DEFERRABLE INITIALLY DEFERRED + "user_tracking_user_id_fkey" FOREIGN KEY (user_id) REFERENCES +extended_user(user_id) DEFERRABLE INITIALLY DEFERRED + +From pgsql-performance-owner@postgresql.org Sat Aug 26 23:46:38 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4E8C39FC3BF + for ; + Sat, 26 Aug 2006 23:46:35 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 12695-06 for + ; + Sun, 27 Aug 2006 02:46:26 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id A80239FC3B6 + for ; + Sat, 26 Aug 2006 23:46:25 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7R2kJMB003308; + Sat, 26 Aug 2006 19:46:24 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 2FAF0C2DC58; Sat, 26 Aug 2006 22:45:54 -0400 (CLT) +Date: Sat, 26 Aug 2006 22:45:54 -0400 +From: Alvaro Herrera +To: George Pavlov +Cc: pgsql-performance@postgresql.org +Subject: Re: stats reset during pg_restore? +Message-ID: <20060827024554.GD30132@alvh.no-ip.org> +Mail-Followup-To: George Pavlov , + pgsql-performance@postgresql.org +References: + <8C5B026B51B6854CBE88121DBF097A863CD6CA@ehost010-33.exch010.intermedia.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: + <8C5B026B51B6854CBE88121DBF097A863CD6CA@ehost010-33.exch010.intermedia.net> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Sat, 26 Aug 2006 19:46:24 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/412 +X-Sequence-Number: 20597 + +George Pavlov wrote: +> This did not have any takers in pgsql-general. Maybe +> performance-oriented folks can shed light? The basic question is if +> there is a way to preserve stats during pg_restore? + +No, there isn't. + +> Can someone share what exatly happens with stats upon restore? Also is +> there anything one can do to keep them intact during a dump/restore? + +These stats are not stored in tables, only in memory and saved to a +special file on disk to be able to preserve it across server stop/start. +But pg_dump does not make the slightest attempt to save it. + +Also, you can't save it yourself -- while you could save the values it +returns on queries to the stats views, there is no way to feed those +saved values back to the system after a dump/restore. + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Sun Aug 27 11:18:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 56CFE9FC59A + for ; + Sun, 27 Aug 2006 11:18:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 02967-01 for + ; + Sun, 27 Aug 2006 14:18:16 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mis010-1.exch010.intermedia.net + (mis010-1.exch010.intermedia.net [64.78.61.91]) + by postgresql.org (Postfix) with ESMTP id A6A059FC592 + for ; + Sun, 27 Aug 2006 11:18:16 -0300 (ADT) +Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by + mis010-1.exch010.intermedia.net with Microsoft + SMTPSVC(6.0.3790.1830); Sun, 27 Aug 2006 07:18:13 -0700 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: Related to Inserting into the database from XML file +Date: Sun, 27 Aug 2006 07:18:09 -0700 +Message-ID: + <8C5B026B51B6854CBE88121DBF097A863CD6DB@ehost010-33.exch010.intermedia.net> +In-Reply-To: <1156522767.1347.22.camel@dogma.v10.wvs> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] Related to Inserting into the database from XML file +Thread-Index: AcbIYi5PcTMbIuOqRbi+PdxSLEsiTgBgHQSA +From: "George Pavlov" +To: "Jeff Davis" , + "soni de" +Cc: +X-OriginalArrivalTime: 27 Aug 2006 14:18:13.0823 (UTC) + FILETIME=[A1EF94F0:01C6C9E3] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/413 +X-Sequence-Number: 20598 + +> On Fri, 2006-08-25 at 21:23 +0530, soni de wrote: +> > Hello, +> > =20 +> > I want to ask, Is there any way to insert records from XML=20 +> > file to the postgres database? +>=20 +> Try the contrib/xml2 module. + +Alas, that module will not help you much with the insertion of records. +It is more about querying XML that is stored within the database.=20 + +A basic question is whether you want to store XML in the DB or you just +have data that is in XML now and you want it loaded into a table +structure. The xml2 module will only be useful in the first case. + +In either case the approach is to transform the data into a form that +PGSQL's COPY understands or into a bunch of INSERT statements (much less +performant). To that end you probably want to become familiar with XSLT +unless the data is so simple that a processing with regular tools (perl, +sed, awk) will suffice. + +George + +From pgsql-performance-owner@postgresql.org Sun Aug 27 11:24:33 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5BC409FC5A3 + for ; + Sun, 27 Aug 2006 11:24:32 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 02967-02 for + ; + Sun, 27 Aug 2006 14:24:29 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mis010-1.exch010.intermedia.net + (mis010-1.exch010.intermedia.net [64.78.61.91]) + by postgresql.org (Postfix) with ESMTP id 6B09C9FC5A1 + for ; + Sun, 27 Aug 2006 11:24:27 -0300 (ADT) +Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by + mis010-1.exch010.intermedia.net with Microsoft + SMTPSVC(6.0.3790.1830); Sun, 27 Aug 2006 07:24:25 -0700 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: stats reset during pg_restore? +Date: Sun, 27 Aug 2006 07:24:21 -0700 +Message-ID: + <8C5B026B51B6854CBE88121DBF097A863CD6DC@ehost010-33.exch010.intermedia.net> +In-Reply-To: <20060827024554.GD30132@alvh.no-ip.org> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] stats reset during pg_restore? +Thread-Index: AcbJgstG6VhGyds6RZyDpOIcXD4FUwAYPHVg +From: "George Pavlov" +To: "Alvaro Herrera" +Cc: +X-OriginalArrivalTime: 27 Aug 2006 14:24:25.0638 (UTC) + FILETIME=[7F8E0C60:01C6C9E4] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/414 +X-Sequence-Number: 20599 + +> These stats are not stored in tables, only in memory and saved to a +> special file on disk to be able to preserve it across server=20 +> stop/start. +> But pg_dump does not make the slightest attempt to save it. +>=20 +> Also, you can't save it yourself -- while you could save the values it +> returns on queries to the stats views, there is no way to feed those +> saved values back to the system after a dump/restore. + +Thanks! Sounds like I just need to query the stats tables and save the +output for oofline analysis before I do a dump.=20 + +Based on how it works it seems that a server crash might lose the +in-memory stats data as well? I imagine PITR does not take care of that +special file (where is it by, by the way?). I have not worked with +replication (yet), but I imagine replica databases will also be agnostic +of the master's stats? + + +From pgsql-performance-owner@postgresql.org Sun Aug 27 11:38:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 351659FC5B1 + for ; + Sun, 27 Aug 2006 11:38:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 75488-10 for + ; + Sun, 27 Aug 2006 14:38:26 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 6506E9FC5AA + for ; + Sun, 27 Aug 2006 11:38:26 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7REcJdk007061; + Sun, 27 Aug 2006 07:38:24 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id CDDAFC2DC58; Sun, 27 Aug 2006 10:37:54 -0400 (CLT) +Date: Sun, 27 Aug 2006 10:37:54 -0400 +From: Alvaro Herrera +To: George Pavlov +Cc: pgsql-performance@postgresql.org +Subject: Re: stats reset during pg_restore? +Message-ID: <20060827143754.GA13665@alvh.no-ip.org> +Mail-Followup-To: George Pavlov , + pgsql-performance@postgresql.org +References: <20060827024554.GD30132@alvh.no-ip.org> + <8C5B026B51B6854CBE88121DBF097A863CD6DC@ehost010-33.exch010.intermedia.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: + <8C5B026B51B6854CBE88121DBF097A863CD6DC@ehost010-33.exch010.intermedia.net> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Sun, 27 Aug 2006 07:38:24 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/415 +X-Sequence-Number: 20600 + +George Pavlov wrote: + +> Based on how it works it seems that a server crash might lose the +> in-memory stats data as well? + +Yeah, IIRC the postmaster removes the stat file after crash recovery. +It doesn't check the file for correctness. + +> I imagine PITR does not take care of that special file (where is it +> by, by the way?). I have not worked with replication (yet), but I +> imagine replica databases will also be agnostic of the master's stats? + +Neither PITR nor the replication systems I know about do anything about +the stats. + +The file is $PGDATA/global/pgstat.stat + +The code to read it, which is at the same time the documentation to its +format, is in src/backend/postmaster/pgstat.c, function +pgstat_read_statfile. It's quite simple. I think you could read it in +Perl if you wanted; and rewrite the file again after a restore (you'd +need to change the Oids in the table entries, etc). + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Sun Aug 27 13:41:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 498679FC622 + for ; + Sun, 27 Aug 2006 13:41:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 40667-08 for + ; + Sun, 27 Aug 2006 16:40:56 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mis010.exch010.intermedia.net (mis010.exch010.intermedia.net + [64.78.61.97]) by postgresql.org (Postfix) with ESMTP id 83D1B9FC621 + for ; + Sun, 27 Aug 2006 13:40:56 -0300 (ADT) +Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by + mis010.exch010.intermedia.net with Microsoft SMTPSVC(6.0.3790.1830); + Sun, 27 Aug 2006 09:39:32 -0700 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable +Subject: Re: [8.1.4] Help optimizing query +Date: Sun, 27 Aug 2006 09:40:49 -0700 +Message-ID: + <8C5B026B51B6854CBE88121DBF097A863CD6DE@ehost010-33.exch010.intermedia.net> +In-Reply-To: +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] [8.1.4] Help optimizing query +Thread-Index: AcbJS9BdqKGIybm/Tk2vrE8iEuQ7mwAp4YNg +From: "George Pavlov" +To: "Hayes" , + +X-OriginalArrivalTime: 27 Aug 2006 16:39:32.0461 (UTC) + FILETIME=[5F9911D0:01C6C9F7] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/416 +X-Sequence-Number: 20601 + +Without having looked at this in detail my first suggestion would be to +do away with those date_part indices. I have found that indexes with few +distinct values usually hurt more then help and the PG optimizer is not +always smart enough to ignore them and the BitmapAnd and scan for dates +seem like a waste since you can consolidate that information from the +get-go, e.g. could you rewrite your WHERE clause to be something like: + + WHERE date_trunc('quarter', entry_date) =3D '2006-04-01' -- for 2nd +quarter of '06 + +or + + WHERE entry_date >=3D '2006-04-01'=20 + AND entry_date < '2006-07-01'=20 + +You could try an index on either the date_trunc or the entry_date +itself, as appropriate.=20 + +I assume your user_tracking table is being inserted onto on each visit, +so you may want to be very cautious with what indexes you have on it +anyway and pare those down. + +BTW, you have a redundant "WHERE subscription_id > 0" in the outer +query, not that that affects much. + + From then on you may want to materialize the subselect so that all of +your five queries use it or, if possible, consolidate those five queries +into one or at least less than five. You can go even further -- seems +like this would be a good candidate for an aggregated reporting table +(essentially your subselect as a separate table updated by triggers, or +every night, or whatever). Especially since the situation will only get +worse as you have more data in your system. + +George + + +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org=20 +> [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Hayes +> Sent: Saturday, August 26, 2006 1:12 PM +> To: pgsql-performance@postgresql.org +> Subject: [PERFORM] [8.1.4] Help optimizing query +>=20 +> Hi all, +>=20 +> I need help making the below query go faster. There are about 5 of=20 +> these being done +> in one report. Some use joins instead of subselects but they all go=20 +> about the same speed. +> I'm not much of a SQL person so I just threw indices on everything=20 +> involved but it still +> takes about at least 19sec and sometimes as much as 60s. I'd=20 +> be happy=20 +> to get it to about +> 5s. +>=20 +> Other info: random_page_cost is 4 as I/O on this box as kinda slow. =20 +> It's a converted desktop with a single IDE drive. shared_buffers is=20 +> 12500 and effective_page_cache is 100M. I upped the statistics on=20 +> entry_date and session_id to 1000. I analyzed the tables after=20 +> modifying the statistics. The actual deployment platform is a lot=20 +> beefier but I'd like these queries to at least be tolerable on this=20 +> machine. +>=20 +> I can see that the estimate for the GroupAggregate is off, if I'm=20 +> interpreting things correctly, but I don't know what to do about it. +>=20 +> tia, +> arturo +>=20 +> Query: +>=20 +> SELECT subscription_id,=20 +> to_char(sum(session_length), 'HH24:MI:SS') as session_length, +> sum(hits) as hits, +> 2006 as theYear, +> 2 as theQuarter, +> sum(count) as count +> FROM ( +> SELECT subscription_id, +> count(distinct session_id) as count,=20 +> age(MAX(entry_date),MIN(entry_date)) as session_length,=20 +> COUNT(action) as hits +> FROM +> extended_user JOIN user_tracking USING (user_id) +> WHERE subscription_id > 0 AND +> EXTRACT(year from entry_date) =3D 2006 AND=20 +> EXTRACT(quarter from entry_date) =3D 2 +> GROUP BY session_id, +> subscription_id +> ) as session_stuff +> WHERE subscription_id > 0 +> GROUP BY subscription_id +> ORDER BY subscription_id; +>=20 +>=20 +> Sort (cost=3D123305.88..123306.38 rows=3D200 width=3D36) (actual=20 +> time=3D75039.706..75040.500 rows=3D258 loops=3D1) +> Sort Key: session_stuff.subscription_id +> -> HashAggregate (cost=3D123294.24..123298.24 rows=3D200 = +width=3D36)=20 +> (actual time=3D75036.487..75038.360 rows=3D258 loops=3D1) +> -> GroupAggregate (cost=3D108839.34..118475.94 = +rows=3D240915=20 +> width=3D72) (actual time=3D68016.583..74702.710 rows=3D38369 = +loops=3D1) +> -> Sort (cost=3D108839.34..109441.63 rows=3D240915=20 +> width=3D72) (actual time=3D67978.193..68982.962 rows=3D245727 = +loops=3D1) +> Sort Key: user_tracking.session_id,=20 +> extended_user.subscription_id +> -> Hash Join (cost=3D7746.59..75492.37=20 +> rows=3D240915=20 +> width=3D72) (actual time=3D16944.487..50737.230 rows=3D245727 = +loops=3D1) +> Hash Cond: ("outer".user_id =3D=20 +> "inner".user_id) +> -> Bitmap Heap Scan on user_tracking =20 +> (cost=3D7524.10..68644.10 rows=3D240950 width=3D72) (actual=20 +> time=3D16843.695..48306.383 rows=3D258923 loops=3D1) +> Recheck Cond:=20 +> ((date_part('quarter'::text, entry_date) =3D 2::double precision) AND=20 +> (date_part('year'::text, entry_date) =3D 2006::double precision)) +> -> BitmapAnd =20 +> (cost=3D7524.10..7524.10=20 +> rows=3D240950 width=3D0) (actual time=3D16779.178..16779.178 rows=3D0 = +loops=3D1) +> -> Bitmap Index Scan on=20 +> user_tracking_quarter_idx (cost=3D0.00..3331.51 rows=3D533288 = +width=3D0)=20 +> (actual time=3D9079.545..9079.545 rows=3D533492 loops=3D1) +> Index Cond:=20 +> (date_part('quarter'::text, entry_date) =3D 2::double precision) +> -> Bitmap Index Scan on=20 +> user_tracking_year_idx (cost=3D0.00..4192.34 rows=3D671239=20 +> width=3D0) (actual=20 +> time=3D7685.906..7685.906 rows=3D671787 loops=3D1) +> Index Cond:=20 +> (date_part('year'::text, entry_date) =3D 2006::double precision) +> -> Hash (cost=3D206.42..206.42 = +rows=3D6428=20 +> width=3D8) (actual time=3D100.754..100.754 rows=3D6411 loops=3D1) +> -> Seq Scan on extended_user =20 +> (cost=3D0.00..206.42 rows=3D6428 width=3D8) (actual = +time=3D0.020..28.873=20 +> rows=3D6411 loops=3D1) +> Filter: ((subscription_id > 0)=20 +> AND (subscription_id > 0)) +> Total runtime: 75069.453 ms +>=20 +> Tables: +>=20 +> This one has about 6-7k rows. +>=20 +> Table "public.extended_user" +> Column | Type | Modifiers=20 +> -------------------+--------------------------+----------- +> create_date | timestamp with time zone | not null +> email | character varying(99) |=20 +> first_name | character varying(99) | not null +> last_name | character varying(99) | not null +> license_agreement | boolean | not null +> license_date | timestamp with time zone |=20 +> password | character varying(32) | not null +> subscription_id | integer | not null +> user_id | integer | not null +> user_name | character varying(99) | not null +> Indexes: +> "extended_user_pkey" PRIMARY KEY, btree (user_id) +> "extended_user_subscription_id_idx" btree (subscription_id) +> "extended_user_subscription_idx" btree (subscription_id) +> Foreign-key constraints: +> "extended_user_subscription_id_fkey" FOREIGN KEY=20 +> (subscription_id)=20 +> REFERENCES subscription(subscription_id) DEFERRABLE INITIALLY DEFERRED +>=20 +> This one has about 2k rows. +>=20 +> Table "public.subscription" +> Column | Type | Modifiers=20 +> ------------------+--------------------------+----------- +> allow_printing | boolean | not null +> company_id | character varying(50) | not null +> company_name | character varying(100) | not null +> end_date | timestamp with time zone |=20 +> licenses | integer | not null +> pass_through_key | character varying(50) |=20 +> start_date | timestamp with time zone | not null +> subscription_id | integer | not null +> Indexes: +> "subscription_pkey" PRIMARY KEY, btree (subscription_id) +>=20 +>=20 +> This one has about 1.4M rows. It's kind of a log of pages visited. +>=20 +> Table=20 +> "public.user_tracking" +> Column | Type | =20 +> =20 +> Modifiers =20 +> ------------------+-----------------------------+------------- +> ----------- +> -------------------------------------------------- +> action | character varying(255) | not null +> entry_date | timestamp without time zone | not null +> note | text |=20 +> report_id | integer |=20 +> session_id | character varying(255) | not null +> user_id | integer |=20 +> user_tracking_id | integer | not null default=20 +> nextval('user_tracking_user_tracking_id_seq'::regclass) +> Indexes: +> "user_tracking_pkey" PRIMARY KEY, btree (user_tracking_id) +> "user_tracking_entry_date_idx" btree (entry_date) +> "user_tracking_month_idx" btree (date_part('month'::text,=20 +> entry_date)) +> "user_tracking_quarter_idx" btree (date_part('quarter'::text,=20 +> entry_date)) +> "user_tracking_report_id_idx" btree (report_id) +> "user_tracking_session_idx" btree (session_id) +> "user_tracking_user_id_idx" btree (user_id) +> "user_tracking_year_idx" btree (date_part('year'::text,=20 +> entry_date)) +> Foreign-key constraints: +> "user_tracking_report_id_fkey" FOREIGN KEY (report_id) REFERENCES=20 +> article(article_id) DEFERRABLE INITIALLY DEFERRED +> "user_tracking_user_id_fkey" FOREIGN KEY (user_id) REFERENCES=20 +> extended_user(user_id) DEFERRABLE INITIALLY DEFERRED +>=20 +> ---------------------------(end of=20 +> broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +>=20 + +From pgsql-performance-owner@postgresql.org Sun Aug 27 23:26:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C279B9FC8A0 + for ; + Sun, 27 Aug 2006 23:26:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 78810-01 for + ; + Mon, 28 Aug 2006 02:26:15 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.193]) + by postgresql.org (Postfix) with ESMTP id 156EB9FC89F + for ; + Sun, 27 Aug 2006 23:26:14 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so789070nzn + for ; + Sun, 27 Aug 2006 19:26:13 -0700 (PDT) +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=hXwFWaW2SKp7UYSgpABV7o0duZoTpTRnRMPAWsKsHybPHZ2tnFg2VuaA22B+l5gqCKC0eXUlyg3Lfp++bH8N4GWty7+05y4KfWzDdHa8OsOTxY7l7k5c63W9tlaH1125H9p63lWK5zqKEvRXansE22qPuIbnuV4UodjgIGJOPjg= +Received: by 10.65.59.17 with SMTP id m17mr6183748qbk; + Sun, 27 Aug 2006 19:26:13 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Sun, 27 Aug 2006 19:26:12 -0700 (PDT) +Message-ID: +Date: Sun, 27 Aug 2006 22:26:12 -0400 +From: "Merlin Moncure" +To: "Charles Sprickman" +Subject: Re: Benchmarks +Cc: pgsql-performance@postgresql.org +In-Reply-To: +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/417 +X-Sequence-Number: 20602 + +> -Tyan dual-core/dual-cpu mainboard ( +> -One Opteron 270 2.0GHz (although our vendor gave us two for some reason) +> -Chenbro 3U case (RM31212B) - OK, but not very well thought-out +> -8 Seagate SATA drives (yes, we stuck with our vendor of choice, WD +> Raptors may have been a better choice) +> -3Ware 9550SX-12MI +> -2GB RAM (we'll get more when we need it) + +yes, you should have bought raptors :) + +> So what are people using to get a general feel for the bang/buck ratio? +> I've toyed with Bonnie, IOZone and simple "dd" writes. I'd like to go a +> little further and actually hit Postgres to see how the entire system +> performs. My reasons are, in no particular order: + +also pgbench. + +> The second is a pretty big deal - we've been doing all 1U builds and +> currently spread our load amongst individual db servers that also do the +> web front end for mailing list management. This has worked OK, but we may +> want to peel off the db section and start moving towards two large boxes +> like this with one replicating the other as a backup. + +imo, this is a smart move. + +> That last one is a stickler. I've seen so much data posted on this list, +> is there any project in the works to collect this? It seems like some +> RAID hardware just totally sucks (cough *Adaptec* cough). Having a site +> that listed results for the more common benchmarks and sorting it out by +> hardware would help reduce the number of people that get burned by buying +> overpriced/underperforming RAID controllers/SANs. + +just post to this list :) hardware moves quick so published +information quickly loses its value. one warning, many people focus +overmuch on sequential i/o, watch out for that. + +> I'll be throwing in some quick stats on the box described above later +> today... At first glance, the 3Ware controller is really looking like an +> excellent value. + +they are pretty decent. the benchmark is software raid which actually +outperforms many hardware controllers. adaptec is complete trash, +they even dropped support of their command line utilty for the +controller on linux, ugh. ibm serveraid controllers are rebranded +adaptect btw. + +merlin + +From pgsql-performance-owner@postgresql.org Mon Aug 28 02:31:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 61FE89FCCC5 + for ; + Mon, 28 Aug 2006 02:31:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 44714-02 for + ; + Mon, 28 Aug 2006 05:31:13 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.181]) + by postgresql.org (Postfix) with ESMTP id B8EE29FC9BC + for ; + Mon, 28 Aug 2006 02:31:12 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so2290666pyd + for ; + Sun, 27 Aug 2006 22:31:12 -0700 (PDT) +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:references; + b=l8q4v5gvv9BcNceQNvMcYmbluSveBA9RfTNuGl3tOPoBfHmv7ezGFCAIGvFFtRz/NoxMTS6hxlcvThl3zq7ganfNwDT6G3d/eWUFdwteBlnUEsa2kIvpk6WvscFUpcxT5oBO/8RkLcWA3BPhuY8rhKMqGcb6ms+VALziRjVcYug= +Received: by 10.35.20.14 with SMTP id x14mr11626236pyi; + Sun, 27 Aug 2006 22:31:12 -0700 (PDT) +Received: by 10.35.9.8 with HTTP; Sun, 27 Aug 2006 22:31:11 -0700 (PDT) +Message-ID: <9f2e40a90608272231k3eccfcefkb98d77f8f953d0ef@mail.gmail.com> +Date: Mon, 28 Aug 2006 11:01:11 +0530 +From: "soni de" +To: "George Pavlov" +Subject: Re: Related to Inserting into the database from XML file +Cc: "Jeff Davis" , pgsql-performance@postgresql.org +In-Reply-To: + <8C5B026B51B6854CBE88121DBF097A863CD6DB@ehost010-33.exch010.intermedia.net> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_170601_7933493.1156743071934" +References: <1156522767.1347.22.camel@dogma.v10.wvs> + <8C5B026B51B6854CBE88121DBF097A863CD6DB@ehost010-33.exch010.intermedia.net> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.334 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_50_60, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/418 +X-Sequence-Number: 20603 + +------=_Part_170601_7933493.1156743071934 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I am little bit confused between whether to insert XML file as it is or +insert data from the XML file in to a particular field from the table. + +I will decided it depending upon the performance factor + + + +For storing the XML file as it is, will there be any performance cause if +compared to storing values in particular fields. + + + +If performance issue is not there for XML formats then we have around 12 to +13 tables, + +if we store XML data as it is in all tables then is there any generic format +for select query? + + + + + +Thanks +Soni + + +On 8/27/06, George Pavlov wrote: +> +> > On Fri, 2006-08-25 at 21:23 +0530, soni de wrote: +> > > Hello, +> > > +> > > I want to ask, Is there any way to insert records from XML +> > > file to the postgres database? +> > +> > Try the contrib/xml2 module. +> +> Alas, that module will not help you much with the insertion of records. +> It is more about querying XML that is stored within the database. +> +> A basic question is whether you want to store XML in the DB or you just +> have data that is in XML now and you want it loaded into a table +> structure. The xml2 module will only be useful in the first case. +> +> In either case the approach is to transform the data into a form that +> PGSQL's COPY understands or into a bunch of INSERT statements (much less +> performant). To that end you probably want to become familiar with XSLT +> unless the data is so simple that a processing with regular tools (perl, +> sed, awk) will suffice. +> +> George +> + +------=_Part_170601_7933493.1156743071934 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + + +

I am little bit confused between whether to insert XML file as it is or insert data from the XML file in to a particular field from the table. +

+

I will decided it depending upon the performance factor

+

 

+

For storing the XML file as it is, will there be any performance cause if compared to storing values in particular fields. +

+

 

+

If performance issue is not there for XML formats then we have around 12 to 13 tables,

+

if we store XML data as it is in all tables then is there any generic format for select query?

+

 

+

 

+

+Thanks +
Soni

 
+
On 8/27/06, George Pavlov <gpavlov@mynewplace.com> wrote: +
> On Fri, 2006-08-25 at 21:23 +0530, soni de wrote:
> > Hello,
> >
> > I want to ask, Is there any way to insert records from XML +
> > file to the postgres database?
>
> Try the contrib/xml2 module.

Alas, that module will not help you much with the insertion of records.
It is more about querying XML that is stored within the database. +

A basic question is whether you want to store XML in the DB or you just
have data that is in XML now and you want it loaded into a table
structure. The xml2 module will only be useful in the first case.

+In either case the approach is to transform the data into a form that
PGSQL's COPY understands or into a bunch of INSERT statements (much less
performant). To that end you probably want to become familiar with XSLT
+unless the data is so simple that a processing with regular tools (perl,
sed, awk) will suffice.

George

+ +------=_Part_170601_7933493.1156743071934-- + +From pgsql-performance-owner@postgresql.org Mon Aug 28 04:51:08 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 847679FCD8F + for ; + Mon, 28 Aug 2006 04:51:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28977-01 for + ; + Mon, 28 Aug 2006 04:50:57 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id B9CAC9FCD84 + for ; + Mon, 28 Aug 2006 04:50:57 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from rose.ctd.hcltech.com (rose.ctd.hcltech.com [202.54.64.23]) + by svr4.postgresql.org (Postfix) with ESMTP id 510075AF8C6 + for ; + Mon, 28 Aug 2006 07:50:55 +0000 (GMT) +Content-Class: urn:content-classes:message +X-MessageTextProcessor: DisclaimIt (2.50.252) [HCL Technologies Limited] +Received: from Ganesh.ctd.hcltech.com ([202.54.64.2]) by rose.ctd.hcltech.com + with Microsoft SMTPSVC(5.0.2195.6713); + Mon, 28 Aug 2006 13:20:49 +0530 +Received: by Ganesh.ctd.hcltech.com with Internet Mail Service (5.5.2653.19) + id ; Mon, 28 Aug 2006 13:20:49 +0530 +Message-ID: <012301731C23DE4DBFE035647C68F1CC03BDF7B6@sindhu.ctd.hcltech.com> +From: "Ravindran G - TLS, Chennai." +To: +Content-Transfer-Encoding: quoted-printable +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Date: Mon, 28 Aug 2006 13:20:48 +0530 +Importance: high +X-Priority: 1 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +MIME-Version: 1.0 +X-Mailer: Internet Mail Service (5.5.2653.19) +Content-Type: text/plain; + charset="iso-8859-1" +X-OriginalArrivalTime: 28 Aug 2006 07:50:49.0557 (UTC) + FILETIME=[ADAFD050:01C6CA76] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.502 tagged_above=0 required=5 tests=AWL, + SPF_NEUTRAL, X_PRIORITY_HIGH +X-Spam-Level: ** +X-Archive-Number: 200608/419 +X-Sequence-Number: 20604 + +I would like to talk to one of the org member in postgre about this = +issue. +This is critical for us. Please help. + +It will be great, if you could provide your contact number to discuss on +this.=20 + +Thank you in advance.=20 + +Regards, Ravi + +-----Original Message----- +From: Ravindran G - TLS, Chennai.=20 +Sent: Tuesday, August 22, 2006 6:09 PM +To: 'pgsql-performance@postgresql.org' +Subject: Postgre SQL 7.1 cygwin performance issue. +Importance: High + + +Hi, + +We are using PostgreSQL 7.1 cygwin installed on Windows 2000 (2 GB = +Memory, +P4).=20 + +We understand that the maximum connections that can be set is 64 in +Postgresql 7.1 version.=20 + +The performance is very slow and some time the database is not getting +connected from our application because of this.=20 + +Please advise us on how to increase the performance by setting any +attributes in configuration files ?.=20 + +Find enclosed the configuration file.=20 + +Thanks and regards, +Ravi + + +To post a message to the mailing list, send it to + pgsql-performance@postgresql.org + + +-----Original Message----- +From: pgsql-performance-owner@postgresql.org +[mailto:pgsql-performance-owner@postgresql.org] +Sent: Tuesday, August 22, 2006 5:32 PM +To: ravig3 +Subject: 7E88-5CD9-AD0E : CONFIRM from pgsql-performance (subscribe) + + +__=20 +The following request + + "subscribe pgsql-performance ravig3 " + +was sent to =20 +by ravig3 . + +To accept or reject this request, please do one of the following: + +1. If you have web browsing capability, visit +=20 + + and follow the instructions there. + +2. Reply to majordomo@postgresql.org=20 + with one of the following two commands in the body of the message: + + accept + reject + + (The number 7E88-5CD9-AD0E must be in the Subject header) + +3. Reply to majordomo@postgresql.org=20 + with one of the following two commands in the body of the message: + =20 + accept 7E88-5CD9-AD0E + reject 7E88-5CD9-AD0E + +Your confirmation is required for the following reason(s): + + The subscribe_policy rule says that the "subscribe" command=20 + must be confirmed by the person affected by the command. + =20 + +If you do not respond within 4 days, a reminder will be sent. + +If you do not respond within 7 days, this token will expire, +and the request will not be completed. + +If you would like to communicate with a person,=20 +send mail to pgsql-performance-owner@postgresql.org. +DISCLAIMER=20 +The contents of this e-mail and any attachment(s) are confidential and = +intended for the=20 + +named recipient(s) only. It shall not attach any liability on the = +originator or HCL or its=20 + +affiliates. Any views or opinions presented in this email are solely = +those of the author and=20 + +may not necessarily reflect the opinions of HCL or its affiliates. Any = +form of reproduction,=20 + +dissemination, copying, disclosure, modification, distribution and / or = +publication of this=20 + +message without the prior written consent of the author of this e-mail = +is strictly=20 + +prohibited. If you have received this email in error please delete it = +and notify the sender=20 + +immediately. Before opening any mail and attachments please check them = +for viruses and=20 + +defect. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 05:15:10 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 223D99FB3B2 + for ; + Mon, 28 Aug 2006 05:15:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 29512-06 for + ; + Mon, 28 Aug 2006 05:15:01 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 6FD929FCDC6 + for ; + Mon, 28 Aug 2006 05:15:01 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) + by svr4.postgresql.org (Postfix) with ESMTP id 4EFA95AF8AA + for ; + Mon, 28 Aug 2006 08:14:59 +0000 (GMT) +Received: from localhost (localhost [127.0.0.1]) + by mail.mnc.ch (Postfix) with ESMTP id 468F8A82F0 + for ; + Mon, 28 Aug 2006 10:20:17 +0200 (CEST) +Received: from mail.mnc.ch ([127.0.0.1]) + by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, + port 10025) with ESMTP + id 06473-06 for ; + Mon, 28 Aug 2006 10:20:15 +0200 (CEST) +Received: from meuh.mnc.lan (62-2-77-204.static.cablecom.ch [62.2.77.204]) + by mail.mnc.ch (Postfix) with ESMTP id E3681A82CB + for ; + Mon, 28 Aug 2006 10:20:15 +0200 (CEST) +Received: by meuh.mnc.lan (Postfix, from userid 1000) + id E2A651835C3; Mon, 28 Aug 2006 10:14:52 +0200 (CEST) +To: pgsql-performance@postgresql.org +Subject: perf pb solved only after pg_dump and restore +X-Hashcash: + 1:20:060828:pgsql-performance@postgresql.org::2DQz8Uo3rXJOpqVo:000000000000000000000000000002WxP +From: Guillaume Cottenceau +Date: 28 Aug 2006 10:14:52 +0200 +Message-ID: <8764gd1dkz.fsf@meuh.mnc.lan> +Lines: 27 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: amavisd-new at mnc.ch +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/420 +X-Sequence-Number: 20605 + +Hi, + +We noticed a slowdown on our application while traffic was kinda +heavy. The logics after reading the docs commanded us to trim the +enlarged tables, run VACUUM ANALYZE and then expect fast +performance again; but it wasn't the case[1]. + +Out of the blue, we dumped the database, removed it, recreated +from the restore, and now the performance is lightning fast +again. + +Does it look familiar to anyone? I thought running VACUUM ANALYZE +after a trim should be enough so that pg has assembled the data +and has good statistical knowledge of the tables contents.. + +Thanks for any tips. + +Ref: +[1] Processes were always showing one/some postmaster on SELECT, + a constant load of 1, and vmstat always showing activity in + IO blocks out (application generate all sort of typical + statements, some SELECT, UPDATE, INSERT either "directly" or + through stored procedures) + +-- +Guillaume Cottenceau +Create your personal SMS or WAP Service - visit http://mobilefriends.ch/ + +From pgsql-performance-owner@postgresql.org Mon Aug 28 06:28:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3699E9FCE17 + for ; + Mon, 28 Aug 2006 06:28:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 84628-09 for + ; + Mon, 28 Aug 2006 09:28:02 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id EC27D9FCE0F + for ; + Mon, 28 Aug 2006 06:28:01 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1A06.dip0.t-ipconnect.de + [84.157.26.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id BA96C6597B; + Mon, 28 Aug 2006 11:30:07 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 0C6291809DD49; + Mon, 28 Aug 2006 11:28:24 +0200 (CEST) +Message-ID: <44F2B737.7070301@logix-tt.com> +Date: Mon, 28 Aug 2006 11:28:23 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Guillaume Cottenceau +Cc: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> +In-Reply-To: <8764gd1dkz.fsf@meuh.mnc.lan> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/421 +X-Sequence-Number: 20606 + +Hi, Guillaume + +Guillaume Cottenceau wrote: + +> We noticed a slowdown on our application while traffic was kinda +> heavy. The logics after reading the docs commanded us to trim the +> enlarged tables, run VACUUM ANALYZE and then expect fast +> performance again; but it wasn't the case[1]. + +What exactly do you mean with "trim the enlarged tables"? + +> Out of the blue, we dumped the database, removed it, recreated +> from the restore, and now the performance is lightning fast +> again. +> +> Does it look familiar to anyone? I thought running VACUUM ANALYZE +> after a trim should be enough so that pg has assembled the data +> and has good statistical knowledge of the tables contents.. + +This looks like either your free_space_map setting is way to low, or you +have index bloat. + +Maybe a VACUUM FULL fullowed by a REINDEX will have solved your problem. + +It also might make sense to issue a CLUSTER instead (which combines the +effects of VACUUM FULL, REINDEX and physically reordering the data). + +When the free_space_map is to low, VACUUM ANALYZE should have told you +via a warning (at least, if your logging is set appropriately). + + +HTH, +Markus +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 28 06:43:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ED7589FCE05 + for ; + Mon, 28 Aug 2006 06:43:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 34310-08 for + ; + Mon, 28 Aug 2006 06:43:21 -0300 (ADT) +X-Greylist: delayed 01:28:21.530879 by SQLgrey- +Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) + by postgresql.org (Postfix) with ESMTP id 87EB99FCE07 + for ; + Mon, 28 Aug 2006 06:43:21 -0300 (ADT) +Received: from localhost (localhost [127.0.0.1]) + by mail.mnc.ch (Postfix) with ESMTP id 02AE3A82F3; + Mon, 28 Aug 2006 11:48:41 +0200 (CEST) +Received: from mail.mnc.ch ([127.0.0.1]) + by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, + port 10025) with ESMTP + id 09048-04; Mon, 28 Aug 2006 11:48:39 +0200 (CEST) +Received: from meuh.mnc.lan (62-2-77-204.static.cablecom.ch [62.2.77.204]) + by mail.mnc.ch (Postfix) with ESMTP id 86442A82CB; + Mon, 28 Aug 2006 11:48:39 +0200 (CEST) +Received: by meuh.mnc.lan (Postfix, from userid 1000) + id 144541835C3; Mon, 28 Aug 2006 11:43:16 +0200 (CEST) +To: Markus Schaber +Cc: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> +X-Hashcash: + 1:20:060828:schabi@logix-tt.com::J0AUoC3AQbwUtduX:0000000000000000000000000000000000000000000+Ir +X-Hashcash: + 1:20:060828:pgsql-performance@postgresql.org::WF1kAxrw7uuKiYHl:000000000000000000000000000006CGe +From: Guillaume Cottenceau +Date: 28 Aug 2006 11:43:16 +0200 +In-Reply-To: <44F2B737.7070301@logix-tt.com> +Message-ID: <87sljhyz4b.fsf@meuh.mnc.lan> +Lines: 68 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: amavisd-new at mnc.ch +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.292 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SARE_MILLIONSOF +X-Spam-Level: +X-Archive-Number: 200608/422 +X-Sequence-Number: 20607 + +Hi Markus, + +Thanks for your message. + +> Guillaume Cottenceau wrote: +> +> > We noticed a slowdown on our application while traffic was kinda +> > heavy. The logics after reading the docs commanded us to trim the +> > enlarged tables, run VACUUM ANALYZE and then expect fast +> > performance again; but it wasn't the case[1]. +> +> What exactly do you mean with "trim the enlarged tables"? + +We have a couple of logs files which get larger over time +(millions of rows). As they are log files, they can be trimmed +from older values. + +> > Out of the blue, we dumped the database, removed it, recreated +> > from the restore, and now the performance is lightning fast +> > again. +> > +> > Does it look familiar to anyone? I thought running VACUUM ANALYZE +> > after a trim should be enough so that pg has assembled the data +> > and has good statistical knowledge of the tables contents.. +> +> This looks like either your free_space_map setting is way to low, or you + +I don't know much about free_space_map. Trying to search in +documentation, I found run time configuration of the two +following parameters for which the current values follow: + + max_fsm_pages is 20000 + max_fsm_relations is 1000 + +Do they look low? + +Notice: table data is only 600M after trim (without indexes), +while it was probably 3x to 10x this size before the trim. +Machine is a 2G Dell 1850 with lsi logic megaraid. + +> have index bloat. + +Can you elaborate? I have created a couple of indexes (according +to multiple models of use in our application) and they do take up +quite some disk space (table dump is 600M but after restore it +takes up 1.5G on disk) but I thought they could only do good or +never be used, not impair performance.. + +> Maybe a VACUUM FULL fullowed by a REINDEX will have solved your problem. + +So these would have reordered the data for faster sequential +access which is not the case of VACUUM ANALYZE? + +> It also might make sense to issue a CLUSTER instead (which combines the +> effects of VACUUM FULL, REINDEX and physically reordering the data). + +I was reluctant in using CLUSTER because you have to choose an +index and there are multiple indexes on the large tables.. + +> When the free_space_map is to low, VACUUM ANALYZE should have told you +> via a warning (at least, if your logging is set appropriately). + +Unfortunately, we didn't keep the logs of VACUUM ANALYZE, so I +can't be sure :/ + +-- +Guillaume Cottenceau +Create your personal SMS or WAP Service - visit http://mobilefriends.ch/ + +From pgsql-performance-owner@postgresql.org Mon Aug 28 07:17:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 1E4FD9FCE34 + for ; + Mon, 28 Aug 2006 07:17:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 95304-10 for + ; + Mon, 28 Aug 2006 10:17:10 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.176]) + by postgresql.org (Postfix) with ESMTP id 8CABE9FCE2D + for ; + Mon, 28 Aug 2006 07:17:10 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so2368054pyd + for ; + Mon, 28 Aug 2006 03:17:09 -0700 (PDT) +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=TXyQZBjHg8va/UicywliYRN0RC9Y1sPJa9+ZMzszF6JxjS1CszRVie42s74mrUvSV79Ot2bZjGCYWnG4qTJ8LOpIfOLxdCwxPM6il4n69NT8Xno5+Ovz6o5JOyPHvYGGp1/eS1ff+P203+g5njcOL4KDcBUz/R/nUiXpF/JxEYI= +Received: by 10.35.106.15 with SMTP id i15mr12074015pym; + Mon, 28 Aug 2006 03:17:09 -0700 (PDT) +Received: by 10.35.49.19 with HTTP; Mon, 28 Aug 2006 03:17:08 -0700 (PDT) +Message-ID: <1d4e0c10608280317i4eb9d7d0r2b397845ffb8c19d@mail.gmail.com> +Date: Mon, 28 Aug 2006 12:17:08 +0200 +From: "Guillaume Smet" +To: "Guillaume Cottenceau" +Subject: Re: perf pb solved only after pg_dump and restore +Cc: "Markus Schaber" , pgsql-performance@postgresql.org +In-Reply-To: <87sljhyz4b.fsf@meuh.mnc.lan> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> + <87sljhyz4b.fsf@meuh.mnc.lan> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/423 +X-Sequence-Number: 20608 + +Guillaume, + +On 28 Aug 2006 11:43:16 +0200, Guillaume Cottenceau wrote: +> max_fsm_pages is 20000 +> max_fsm_relations is 1000 +> Do they look low? + +Yes they are probably too low if you don't run VACUUM on a regular +basis and you have a lot of UPDATE/DELETE activity. FSM doesn't take a +lot of memory so it's usually recommended to have a confortable value +for it. + +I usually recommend to read: +http://www.pervasive-postgres.com/instantkb13/article.aspx?id=10116&cNode=5K1C3W +http://www.pervasive-postgres.com/instantkb13/article.aspx?id=10087&cNode=5K1C3W +to understand better what VACUUM and FSM mean. + +> Can you elaborate? I have created a couple of indexes (according +> to multiple models of use in our application) and they do take up +> quite some disk space (table dump is 600M but after restore it +> takes up 1.5G on disk) but I thought they could only do good or +> never be used, not impair performance.. + +Index slow downs write activity (you have to maintain them). It's not +always a good idea to create them. + +> > Maybe a VACUUM FULL fullowed by a REINDEX will have solved your problem. +> +> So these would have reordered the data for faster sequential +> access which is not the case of VACUUM ANALYZE? + +VACUUM ANALYZE won't help you if your database is completely bloated. +And AFAICS you're not running it on a regular basis so your database +was probably completely bloated which means: +- bloated indexes, +- bloated tables (ie a lot of fragmentation in the pages which means +that you need far more pages to store the same data). + +The only ways to solve this situation is either to dump/restore or run +a VACUUM FULL ANALYZE (VERBOSE is better to keep a log), and +eventually reindex any bloated index (depends on your situation). + +> > When the free_space_map is to low, VACUUM ANALYZE should have told you +> > via a warning (at least, if your logging is set appropriately). +> +> Unfortunately, we didn't keep the logs of VACUUM ANALYZE, so I +> can't be sure :/ + +You should really run VACUUM ANALYZE VERBOSE on a regular basis and +analyze the logs to be sure your VACUUM strategy and FSM settings are +OK. + +I developed http://pgfouine.projects.postgresql.org/vacuum.html to +help us doing it on our production databases. + +Regards, + +-- +Guillaume + +From pgsql-performance-owner@postgresql.org Mon Aug 28 07:34:02 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 19A5B9FCE41 + for ; + Mon, 28 Aug 2006 07:34:01 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 11876-01 for + ; + Mon, 28 Aug 2006 10:33:58 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 2EE3A9FCE3B + for ; + Mon, 28 Aug 2006 07:33:58 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1A06.dip0.t-ipconnect.de + [84.157.26.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 95B7165984; + Mon, 28 Aug 2006 12:36:04 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id B9AFD1809DD49; + Mon, 28 Aug 2006 12:34:20 +0200 (CEST) +Message-ID: <44F2C6AC.5060602@logix-tt.com> +Date: Mon, 28 Aug 2006 12:34:20 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Guillaume Cottenceau +Cc: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> + <87sljhyz4b.fsf@meuh.mnc.lan> +In-Reply-To: <87sljhyz4b.fsf@meuh.mnc.lan> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.45 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, + SARE_MILLIONSOF +X-Spam-Level: +X-Archive-Number: 200608/424 +X-Sequence-Number: 20609 + +Hi, Guillaume, + +Guillaume Cottenceau wrote: + +> We have a couple of logs files which get larger over time +> (millions of rows). As they are log files, they can be trimmed +> from older values. + +Ah, ok, you DELETEd the old rows. + +So I assume that you never UPDATE, but only INSERT new entries and +sometimes DELETE a big bunch of entries from the beginning. + +This is a special usage pattern, where the normal "VACUUM" is not well +suited for. + +DELETing rows itsself does not free any space. Only after your +transaction is committed, a following VACUUM FULL or CLUSTER does +actually free the space. + +VACUUM and VACUUM ANALYZE only remove obsolete rows from the pages and +marks them free (by entering them into the free space map, as long as +that one is large enough). That means that your table will actually stay +as large as before, having 90% of free pages at the beginning and 10% +used pages at the very end. New INSERTs and UPDATEs will prefer to use +pages from the free space map before allocating new pages, but the +existing rows will stay forever. + +Now, VACUUM FULL actively moves rows to the beginning of the table, +allowing to cut the end of the table, while CLUSTER recreates the table +from scratch, in index order. Both lead to a compact storage, having all +used rows at the beginning, and no free pages. + +So, I think, in your case VACUUM FULL and CLUSTER would both have solved +your problem. + +> max_fsm_pages is 20000 +> Do they look low? +> Notice: table data is only 600M after trim (without indexes), +> while it was probably 3x to 10x this size before the trim. + +10x the size means 6G, so 5.4G of data were freed by the trim. Each page +has 8k in size, so the fsm needs about 675000 pages. So, yes, for your +usage, they look low, and give very suboptimal results. + +>> have index bloat. +> +> Can you elaborate? I have created a couple of indexes (according +> to multiple models of use in our application) and they do take up +> quite some disk space (table dump is 600M but after restore it +> takes up 1.5G on disk) but I thought they could only do good or +> never be used, not impair performance.. + +Like tables, indices may suffer from getting bloated by old, unused +entries. Especially the GIST based indices in 7.4 (used by PostGIS and +other plugins) suffered from that problem[1], but recent PostgreSQL +versions have improved in this area. + +Now, when the query planner decides to use an index, the index access is +extremely slow because of all the deleted entries the index scan has to +skip. + +However, from the additional information you gave above, I doubt it was +index bloat. + +>> Maybe a VACUUM FULL fullowed by a REINDEX will have solved your problem. +> +> So these would have reordered the data for faster sequential +> access which is not the case of VACUUM ANALYZE? + +A VACUUM FULL would have reordered the data, and a REINDEX would have +optimized the index. + +>> It also might make sense to issue a CLUSTER instead (which combines the +>> effects of VACUUM FULL, REINDEX and physically reordering the data). +> +> I was reluctant in using CLUSTER because you have to choose an +> index and there are multiple indexes on the large tables.. + +Usually, CLUSTERing on one index does not necessarily slow down accesses +on other indices, compared to the non-clustered (= random) table before. + +If you have some indices that are somehow related (e. G. a timestamp and +a serial number), CLUSTERing on one index does automatically help the +other index, especially as the query planer uses corellation statistics. + +Btw, if your queries often include 2 or 3 columns, a multi-column index +(and clustering on that index) might be the best. + +>> When the free_space_map is to low, VACUUM ANALYZE should have told you +>> via a warning (at least, if your logging is set appropriately). +> +> Unfortunately, we didn't keep the logs of VACUUM ANALYZE, so I +> can't be sure :/ + +AFAIK, the warning is also output on the psql command line. + +HTH, +Markus + +[1] We once had an index that was about 100 times larger before REINDEX. + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 28 09:32:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A0C7A9FCE9F + for ; + Mon, 28 Aug 2006 09:32:07 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 52880-04 for + ; + Mon, 28 Aug 2006 09:31:54 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) + by postgresql.org (Postfix) with ESMTP id 4B1379FCEA6 + for ; + Mon, 28 Aug 2006 09:31:53 -0300 (ADT) +Received: from localhost (localhost [127.0.0.1]) + by mail.mnc.ch (Postfix) with ESMTP id 69A4AA82F0; + Mon, 28 Aug 2006 14:37:13 +0200 (CEST) +Received: from mail.mnc.ch ([127.0.0.1]) + by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, + port 10025) with ESMTP + id 12113-07; Mon, 28 Aug 2006 14:37:11 +0200 (CEST) +Received: from meuh.mnc.lan (62-2-77-204.static.cablecom.ch [62.2.77.204]) + by mail.mnc.ch (Postfix) with ESMTP id D27F5A82CB; + Mon, 28 Aug 2006 14:37:11 +0200 (CEST) +Received: by meuh.mnc.lan (Postfix, from userid 1000) + id 820251835C3; Mon, 28 Aug 2006 14:31:47 +0200 (CEST) +To: "Guillaume Smet" +Cc: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> + <87sljhyz4b.fsf@meuh.mnc.lan> + <1d4e0c10608280317i4eb9d7d0r2b397845ffb8c19d@mail.gmail.com> +X-Hashcash: + 1:20:060828:guillaume.smet@gmail.com::lzF1iuaRxxHMFDjk:00000000000000000000000000000000000009tom +X-Hashcash: + 1:20:060828:pgsql-performance@postgresql.org::gpewOUyJDiaXRiXs:000000000000000000000000000000h/q +From: Guillaume Cottenceau +Date: 28 Aug 2006 14:31:47 +0200 +In-Reply-To: <1d4e0c10608280317i4eb9d7d0r2b397845ffb8c19d@mail.gmail.com> +Message-ID: <874pvxyrbg.fsf@meuh.mnc.lan> +Lines: 87 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: amavisd-new at mnc.ch +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.214 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/425 +X-Sequence-Number: 20610 + +Guillaume, + +Thanks for your help. + +> On 28 Aug 2006 11:43:16 +0200, Guillaume Cottenceau wrote: +> > max_fsm_pages is 20000 +> > max_fsm_relations is 1000 +> > Do they look low? +> +> Yes they are probably too low if you don't run VACUUM on a regular +> basis and you have a lot of UPDATE/DELETE activity. FSM doesn't take a +> lot of memory so it's usually recommended to have a confortable value +> for it. + +Normally, we run VACUUM ANALYZE overnight. I'd say we have low +DELETE activity, kinda high SELECT/INSERT activity, and UPDATE +would be in the middle of that. + +> I usually recommend to read: +> http://www.pervasive-postgres.com/instantkb13/article.aspx?id=10116&cNode=5K1C3W +> http://www.pervasive-postgres.com/instantkb13/article.aspx?id=10087&cNode=5K1C3W +> to understand better what VACUUM and FSM mean. + +Thanks for the pointer, will read that. + +> > Can you elaborate? I have created a couple of indexes (according +> > to multiple models of use in our application) and they do take up +> > quite some disk space (table dump is 600M but after restore it +> > takes up 1.5G on disk) but I thought they could only do good or +> > never be used, not impair performance.. +> +> Index slow downs write activity (you have to maintain them). It's not +> always a good idea to create them. + +Of course. How newbie did I look :/. The thing is that I once did +a few measurements and noticed no (measurable) impact in INSERT +with a supplementary index, so I (wrongly) forgot about this. + +> > > Maybe a VACUUM FULL fullowed by a REINDEX will have solved your problem. +> > +> > So these would have reordered the data for faster sequential +> > access which is not the case of VACUUM ANALYZE? +> +> VACUUM ANALYZE won't help you if your database is completely bloated. + +What do you mean exactly by bloated? If you mean that there is a +lot of (unused) data, the thing is that our trim removed most of +it. I was kinda hoping that after analyzing the database, the old +data would exit the whole picture, which obviously wasn't the +case. + +About REINDEX: is it ok to consider that REINDEX is to indexes +what VACUUM FULL is to table data, because it cleans up unused +index pages? + +> And AFAICS you're not running it on a regular basis so your database +> was probably completely bloated which means: +> - bloated indexes, +> - bloated tables (ie a lot of fragmentation in the pages which means +> that you need far more pages to store the same data). + +I suppose that table fragmentation occurs when DELETE are +interleaved with INSERT? + +> The only ways to solve this situation is either to dump/restore or run +> a VACUUM FULL ANALYZE (VERBOSE is better to keep a log), and +> eventually reindex any bloated index (depends on your situation). + +Ok. + +> > > When the free_space_map is to low, VACUUM ANALYZE should have told you +> > > via a warning (at least, if your logging is set appropriately). +> > +> > Unfortunately, we didn't keep the logs of VACUUM ANALYZE, so I +> > can't be sure :/ +> +> You should really run VACUUM ANALYZE VERBOSE on a regular basis and +> analyze the logs to be sure your VACUUM strategy and FSM settings are +> OK. + +VACUUM ANALYZE is normally run overnight (each night). Is it not +regular enough? There can be hundreds of thousands of statements +a day. + +-- +Guillaume Cottenceau +Create your personal SMS or WAP Service - visit http://mobilefriends.ch/ + +From pgsql-performance-owner@postgresql.org Mon Aug 28 10:07:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 571A79FCECE + for ; + Mon, 28 Aug 2006 10:07:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 45071-09 for + ; + Mon, 28 Aug 2006 13:07:40 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) + by postgresql.org (Postfix) with ESMTP id DF53D9FCECA + for ; + Mon, 28 Aug 2006 10:07:39 -0300 (ADT) +Received: from localhost (localhost [127.0.0.1]) + by mail.mnc.ch (Postfix) with ESMTP id B9061A82F1; + Mon, 28 Aug 2006 15:12:59 +0200 (CEST) +Received: from mail.mnc.ch ([127.0.0.1]) + by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, + port 10025) with ESMTP + id 13225-03; Mon, 28 Aug 2006 15:12:58 +0200 (CEST) +Received: from meuh.mnc.lan (62-2-77-204.static.cablecom.ch [62.2.77.204]) + by mail.mnc.ch (Postfix) with ESMTP id 20867A82CB; + Mon, 28 Aug 2006 15:12:58 +0200 (CEST) +Received: by meuh.mnc.lan (Postfix, from userid 1000) + id 9C56C1835C3; Mon, 28 Aug 2006 15:07:33 +0200 (CEST) +To: Markus Schaber +Cc: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> + <87sljhyz4b.fsf@meuh.mnc.lan> <44F2C6AC.5060602@logix-tt.com> +X-Hashcash: + 1:20:060828:schabi@logix-tt.com::Rg5HJh+BCkPQAgVE:0000000000000000000000000000000000000000007c9N +X-Hashcash: + 1:20:060828:pgsql-performance@postgresql.org::cTzJ9QKrezST4n27:000000000000000000000000000003bbZ +From: Guillaume Cottenceau +Date: 28 Aug 2006 15:07:33 +0200 +In-Reply-To: <44F2C6AC.5060602@logix-tt.com> +Message-ID: <87veodxb3e.fsf@meuh.mnc.lan> +Lines: 115 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: amavisd-new at mnc.ch +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.45 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, + SARE_MILLIONSOF +X-Spam-Level: +X-Archive-Number: 200608/426 +X-Sequence-Number: 20611 + +> > We have a couple of logs files which get larger over time +> > (millions of rows). As they are log files, they can be trimmed +> > from older values. +> +> Ah, ok, you DELETEd the old rows. + +Yes. + +> So I assume that you never UPDATE, but only INSERT new entries and +> sometimes DELETE a big bunch of entries from the beginning. + +Actually, in the version of software where we have the problem, +that's exactly the case. But in newer versions, UPDATE come into +the picture (typically on recently inserted rows - one or two +updates per row). Does UPDATE change anything? Row selection is +done on the primary key (of SERIAL type). + +> This is a special usage pattern, where the normal "VACUUM" is not well +> suited for. +> +> DELETing rows itsself does not free any space. Only after your +> transaction is committed, a following VACUUM FULL or CLUSTER does +> actually free the space. +> +> VACUUM and VACUUM ANALYZE only remove obsolete rows from the pages and +> marks them free (by entering them into the free space map, as long as +> that one is large enough). That means that your table will actually stay +> as large as before, having 90% of free pages at the beginning and 10% +> used pages at the very end. New INSERTs and UPDATEs will prefer to use +> pages from the free space map before allocating new pages, but the +> existing rows will stay forever. + +Yes, that what I had in mind. But I assumed that performance +would be reclaimed (as if VACUUM FULL was run) because the +statistics after analyzing are accurate as to data distribution, +only disk space would not be reclaimed (but we don't care, at +least for the moment). + +> Now, VACUUM FULL actively moves rows to the beginning of the table, +> allowing to cut the end of the table, while CLUSTER recreates the table +> from scratch, in index order. Both lead to a compact storage, having all +> used rows at the beginning, and no free pages. + +I actually assumed that VACUUM ANALYZE would order rows +sequentially on disk (mainly because it was taking quite some +time and a lot of disk output activity), but obviously this was +wrong. + +> So, I think, in your case VACUUM FULL and CLUSTER would both have solved +> your problem. + +Ok. + +> > max_fsm_pages is 20000 +> > Do they look low? +> > Notice: table data is only 600M after trim (without indexes), +> > while it was probably 3x to 10x this size before the trim. +> +> 10x the size means 6G, so 5.4G of data were freed by the trim. Each page +> has 8k in size, so the fsm needs about 675000 pages. So, yes, for your +> usage, they look low, and give very suboptimal results. + +"max_fsm_pages = 675000" means we also need to enlarge shared +buffers, or the shared buffers available space for data caching +would be reduced, right? + +I guess the bottom line is that I don't understand what the Free +Space Map behaviour really is. Is it a map containing location of +free disk pages, free meaning that they correspond to pages +removed with DELETE but not yet released to the OS with VACUUM +FULL, which are used for INSERT in favor of enlarging the size of +data used on disk? If that's correct, am I right in assuming that +we don't care about the Free Space Map size if we perform a +VACUUM FULL right after large bunches of DELETE? + +> >> have index bloat. +> > +> > Can you elaborate? I have created a couple of indexes (according +> > to multiple models of use in our application) and they do take up +> > quite some disk space (table dump is 600M but after restore it +> > takes up 1.5G on disk) but I thought they could only do good or +> > never be used, not impair performance.. +> +> Like tables, indices may suffer from getting bloated by old, unused +> entries. Especially the GIST based indices in 7.4 (used by PostGIS and +> other plugins) suffered from that problem[1], but recent PostgreSQL +> versions have improved in this area. + +We actually are obliged to use 7.4.5 :/ + +Am I correct in assuming that regularly running REINDEX would cut +this bloat? (daily) + +(documentation very much insists on solving index data corruption +with REINDEX and doesn't talk much about removing old obsolete +data) + +(also, is there any way to REINDEX all index of all tables +easily? as when we do just "VACUUM ANALYZE" for the whole +database) + +> Now, when the query planner decides to use an index, the index access is +> extremely slow because of all the deleted entries the index scan has to +> skip. + +I see. + +> However, from the additional information you gave above, I doubt it was +> index bloat. + +[...] + +-- +Guillaume Cottenceau +Create your personal SMS or WAP Service - visit http://mobilefriends.ch/ + +From pgsql-performance-owner@postgresql.org Mon Aug 28 10:13:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 7A12E9FCED6 + for ; + Mon, 28 Aug 2006 10:13:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 54752-06 for + ; + Mon, 28 Aug 2006 10:13:25 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 169179FCECE + for ; + Mon, 28 Aug 2006 10:13:26 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1A06.dip0.t-ipconnect.de + [84.157.26.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id CA9EE6597B + for ; + Mon, 28 Aug 2006 15:15:32 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 376A218542391 + for ; + Mon, 28 Aug 2006 15:13:49 +0200 (CEST) +Message-ID: <44F2EC0C.7090407@logix-tt.com> +Date: Mon, 28 Aug 2006 15:13:48 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> + <44F2B737.7070301@logix-tt.com> <87sljhyz4b.fsf@meuh.mnc.lan> + <1d4e0c10608280317i4eb9d7d0r2b397845ffb8c19d@mail.gmail.com> + <874pvxyrbg.fsf@meuh.mnc.lan> +In-Reply-To: <874pvxyrbg.fsf@meuh.mnc.lan> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.168 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/427 +X-Sequence-Number: 20612 + +Hi, Guillaume, + +Guillaume Cottenceau wrote: + +> About REINDEX: is it ok to consider that REINDEX is to indexes +> what VACUUM FULL is to table data, because it cleans up unused +> index pages? + +Yes, roughly speaking. + +>> And AFAICS you're not running it on a regular basis so your database +>> was probably completely bloated which means: +>> - bloated indexes, +>> - bloated tables (ie a lot of fragmentation in the pages which means +>> that you need far more pages to store the same data). +> +> I suppose that table fragmentation occurs when DELETE are +> interleaved with INSERT? + +Yes, and it gets ugly as soon as the fsm setting is to low / VACUUM +frequency is to low, so it cannot keep up. + +Big bunches of UPDATE/DELETE that hit more than, say 20% of the table +between VACUUM runs, justify a VACUUM FULL in most cases. + +> VACUUM ANALYZE is normally run overnight (each night). Is it not +> regular enough? There can be hundreds of thousands of statements +> a day. + +Which PostgreSQL version are you using? Maybe you should consider +autovacuum (which is a contrib module at least since 7.4, and included +in the server since 8.1). If you think that vacuum during working hours +puts too much load on your server, there are options to tweak that, at +least in 8.1. + +Markus + + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 28 10:32:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 520DB9FCEF7 + for ; + Mon, 28 Aug 2006 10:32:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 50580-09 for + ; + Mon, 28 Aug 2006 13:32:30 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 28F879FA236 + for ; + Mon, 28 Aug 2006 10:32:29 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7SDWOXd004976; + Mon, 28 Aug 2006 06:32:25 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 6604DC2DC58; Mon, 28 Aug 2006 09:32:06 -0400 (CLT) +Date: Mon, 28 Aug 2006 09:32:06 -0400 +From: Alvaro Herrera +To: "Ravindran G - TLS, Chennai." +Cc: pgsql-performance@postgresql.org +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Message-ID: <20060828133206.GB27526@alvh.no-ip.org> +Mail-Followup-To: "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org +References: <012301731C23DE4DBFE035647C68F1CC03BDF7B6@sindhu.ctd.hcltech.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03BDF7B6@sindhu.ctd.hcltech.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 28 Aug 2006 06:32:25 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/428 +X-Sequence-Number: 20613 + +Ravindran G - TLS, Chennai. wrote: +> I would like to talk to one of the org member in postgre about this issue. +> This is critical for us. Please help. +> +> It will be great, if you could provide your contact number to discuss on +> this. + +Sure, we're happy to help. You can contact several "org members" via +this mailing list. What's your problem exactly? If you're finding that +the 7.1 cygwin version is too slow, please consider migrating some +something more recent. 8.1 runs natively on Windows, no Cygwin required. +It's much faster and doesn't have that limitation on the number of +connections. + +Please note that the name is "PostgreSQL" and is usually shortened to +"Postgres". It's never "postgre". + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 10:43:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 896399FCF05 + for ; + Mon, 28 Aug 2006 10:43:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 58078-06-3 + for ; + Mon, 28 Aug 2006 13:43:25 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id 58C529FCF03 + for ; + Mon, 28 Aug 2006 10:43:25 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1A06.dip0.t-ipconnect.de + [84.157.26.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 3BDAD6597B + for ; + Mon, 28 Aug 2006 15:45:32 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id C31E018542391 + for ; + Mon, 28 Aug 2006 15:43:48 +0200 (CEST) +Message-ID: <44F2F314.5040001@logix-tt.com> +Date: Mon, 28 Aug 2006 15:43:48 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> + <44F2B737.7070301@logix-tt.com> <87sljhyz4b.fsf@meuh.mnc.lan> + <44F2C6AC.5060602@logix-tt.com> <87veodxb3e.fsf@meuh.mnc.lan> +In-Reply-To: <87veodxb3e.fsf@meuh.mnc.lan> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/429 +X-Sequence-Number: 20614 + +Hi, Guillaume, + +Guillaume Cottenceau wrote: + +>> So I assume that you never UPDATE, but only INSERT new entries and +>> sometimes DELETE a big bunch of entries from the beginning. +> +> Actually, in the version of software where we have the problem, +> that's exactly the case. But in newer versions, UPDATE come into +> the picture (typically on recently inserted rows - one or two +> updates per row). Does UPDATE change anything? Row selection is +> done on the primary key (of SERIAL type). + +In a MVCC database like PostgreSQL, UPDATE internally INSERTs the new +version of the row, and marks the old one as deleted. + +Later transactions use the transaction's exit state (commit or rollback) +to decide which row version to use. VACUUM removes row versions that are +known to be obsolete (that's why longstanding transactions hold VACUUM, +beause they still can reference old, obsolete versions.). + +So, for a few updates that are at the end of the table, normal VACUUM +with a sufficient free space map setting will work okay. + +However, when updating or deleting big bunches of data (like the 90% you +spoke of), VACUUM FULL or CLUSTER does make sense. + +> Yes, that what I had in mind. But I assumed that performance +> would be reclaimed (as if VACUUM FULL was run) because the +> statistics after analyzing are accurate as to data distribution, +> only disk space would not be reclaimed (but we don't care, at +> least for the moment). + +Performance is not reclaimed for everything involving a sequential scan, +as it still has to scan the whole table. + +It is partially reclaimed for index scans on UPDATEd rows, as the old +versions are removed, and so index have less versions to check for +validity in the current transaction. + +> I actually assumed that VACUUM ANALYZE would order rows +> sequentially on disk (mainly because it was taking quite some +> time and a lot of disk output activity), but obviously this was +> wrong. + +It only does so inside each page, but not across pages. + +> "max_fsm_pages = 675000" means we also need to enlarge shared +> buffers, or the shared buffers available space for data caching +> would be reduced, right? + +AFAIK, the FSM is not a part of the shared buffers memory, but they both +account to the kernels shared memory limit, which you may have to increase. + +> I guess the bottom line is that I don't understand what the Free +> Space Map behaviour really is. Is it a map containing location of +> free disk pages, free meaning that they correspond to pages +> removed with DELETE but not yet released to the OS with VACUUM +> FULL, which are used for INSERT in favor of enlarging the size of +> data used on disk? + +Mostly, yes. VACUUM scans the whole table, that's why it has so much +disk IO. On every page, it first deletes obsolete rows (by checking +their transaction IDs), and compacts the rest. It then appends the page +to the free space map, if it contains free space and the fsm has a free +slot left. As it does not move valid rows between pages, it can run +concurrently with "real" transactions and does not need a table lock. + +INSERT uses the FSM before enlarging the file, UPDATE first looks for +free space on the same page where the old row is (which avoids updating +the index), then the FSM, then enlarging the file. + +> If that's correct, am I right in assuming that +> we don't care about the Free Space Map size if we perform a +> VACUUM FULL right after large bunches of DELETE? + +I don't know exactly, but as far as I remember, VACUUM FULL uses the FSM +map itsself, as it must have free target pages to move the rows to. + +So an insufficient FSM may lead to the need of several VACUUM FULL runs +until the table is cleaned up, or might even fail completely. + +Tom & co, please correct me if that statement above is imprecise. + +> We actually are obliged to use 7.4.5 :/ + +I URGE you to update at least to 7.4.13 (which can be done in place, +without dump/restore). For a list of the urgend bug fixes, see +http://www.postgresql.org/docs/7.4/static/release.html#RELEASE-7-4-13 +which also contains hints for a smooth upgrade. + +> Am I correct in assuming that regularly running REINDEX would cut +> this bloat? (daily) + +Yes, a regular REINDEX will cut index bloat (but not table bloat). + +If you have a maintainance window every night, but very high traffic +during the daytime, it might make sense to have a cron script issuing a +bunch of VACUUM FULL / REINDEX / CLUSTER commands every night. + +Btw, CLUSTERing a table includes the effects of VACUUM FULL and REINDEX, +but not ANALYZE. + +> (also, is there any way to REINDEX all index of all tables +> easily? as when we do just "VACUUM ANALYZE" for the whole +> database) + +For 7.4, you'll need a script to do that (current versions have improved +in this area). You might recycle the idea from the pgsql-sql list some +days ago: + +http://archives.postgresql.org/pgsql-sql/2006-08/msg00184.php + +Simply use the meta tables to get a list of all schema.table names, and +create the bunch of VACUUM FULL / REINDEX commands. + +HTH, +Markus +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 28 10:48:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DF4FC9FCF18 + for ; + Mon, 28 Aug 2006 10:48:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 57966-08 for + ; + Mon, 28 Aug 2006 10:47:49 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) + by postgresql.org (Postfix) with ESMTP id B2A539FCF03 + for ; + Mon, 28 Aug 2006 10:47:49 -0300 (ADT) +Received: from localhost (localhost [127.0.0.1]) + by mail.mnc.ch (Postfix) with ESMTP id 46842A82F1; + Mon, 28 Aug 2006 15:53:09 +0200 (CEST) +Received: from mail.mnc.ch ([127.0.0.1]) + by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, + port 10025) with ESMTP + id 13733-10; Mon, 28 Aug 2006 15:53:06 +0200 (CEST) +Received: from meuh.mnc.lan (62-2-77-204.static.cablecom.ch [62.2.77.204]) + by mail.mnc.ch (Postfix) with ESMTP id DA001A82CB; + Mon, 28 Aug 2006 15:53:06 +0200 (CEST) +Received: by meuh.mnc.lan (Postfix, from userid 1000) + id 1F0551835C3; Mon, 28 Aug 2006 15:47:42 +0200 (CEST) +To: Markus Schaber +Cc: pgsql-performance@postgresql.org +Subject: Re: perf pb solved only after pg_dump and restore +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> + <87sljhyz4b.fsf@meuh.mnc.lan> + <1d4e0c10608280317i4eb9d7d0r2b397845ffb8c19d@mail.gmail.com> + <874pvxyrbg.fsf@meuh.mnc.lan> <44F2EC0C.7090407@logix-tt.com> +X-Hashcash: + 1:20:060828:schabi@logix-tt.com::qUdX6CF2MmvgfN7E:0000000000000000000000000000000000000000006Lum +X-Hashcash: + 1:20:060828:pgsql-performance@postgresql.org::idPfc01uaKwvNeIQ:00000000000000000000000000000365s +From: Guillaume Cottenceau +Date: 28 Aug 2006 15:47:42 +0200 +In-Reply-To: <44F2EC0C.7090407@logix-tt.com> +Message-ID: <87ac5px98h.fsf@meuh.mnc.lan> +Lines: 18 +User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Virus-Scanned: amavisd-new at mnc.ch +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.238 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/430 +X-Sequence-Number: 20615 + +Markus Schaber writes: + +> > VACUUM ANALYZE is normally run overnight (each night). Is it not +> > regular enough? There can be hundreds of thousands of statements +> > a day. +> +> Which PostgreSQL version are you using? Maybe you should consider +> autovacuum (which is a contrib module at least since 7.4, and included +> in the server since 8.1). If you think that vacuum during working hours +> puts too much load on your server, there are options to tweak that, at +> least in 8.1. + +Ok, thanks. Unfortunately production insists on sticking on 7.4.5 +for the moment :/ + +-- +Guillaume Cottenceau +Create your personal SMS or WAP Service - visit http://mobilefriends.ch/ + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:01:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D09EA9FCF2A + for ; + Mon, 28 Aug 2006 11:01:23 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 64403-04 for + ; + Mon, 28 Aug 2006 14:01:20 +0000 (UTC) +X-Greylist: delayed 06:10:21.645749 by SQLgrey- +Received: from rose.ctd.hcltech.com (rose.ctd.hcltech.com [202.54.64.23]) + by postgresql.org (Postfix) with ESMTP id E863F9FCF24 + for ; + Mon, 28 Aug 2006 11:01:19 -0300 (ADT) +Content-Class: urn:content-classes:message +X-MessageTextProcessor: DisclaimIt (2.50.252) [HCL Technologies Limited] +Received: from Ganesh.ctd.hcltech.com ([202.54.64.2]) by rose.ctd.hcltech.com + with Microsoft SMTPSVC(5.0.2195.6713); + Mon, 28 Aug 2006 19:31:16 +0530 +Received: by Ganesh.ctd.hcltech.com with Internet Mail Service (5.5.2653.19) + id ; Mon, 28 Aug 2006 19:31:16 +0530 +Message-ID: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +From: "Ravindran G - TLS, Chennai." +Content-Transfer-Encoding: quoted-printable +To: "Alvaro Herrera" +Cc: , + "Isac Newton A - TLS, Chennai." +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Date: Mon, 28 Aug 2006 19:30:44 +0530 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 +MIME-Version: 1.0 +X-Mailer: Internet Mail Service (5.5.2653.19) +Content-Type: text/plain; + charset="iso-8859-1" +X-OriginalArrivalTime: 28 Aug 2006 14:01:16.0620 (UTC) + FILETIME=[6E0C78C0:01C6CAAA] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.069 tagged_above=0 required=5 tests=SPF_NEUTRAL +X-Spam-Level: * +X-Archive-Number: 200608/431 +X-Sequence-Number: 20616 + +Thanks Alvaro. + +We are using PostgreSQL 7.1 cygwin installed on Windows 2000. + +We understand that the maximum connections that can be set is 64 in +Postgresql 7.1 version. =20 + +But our application is installed in 8 / 10 PC or more than that and it = +opens +multiple connections and it exceeds 64.=20 + +Because of this the subsequent connections are failed to connect with DB +from application. + +Please advise us on how to resolve this ?.=20 + +-- + +Migrating to 8.1 may not be possible at this point of time due to some +reasons.=20 + +Regards, Ravi + + +-----Original Message----- +From: Alvaro Herrera [mailto:alvherre@commandprompt.com] +Sent: Monday, August 28, 2006 7:02 PM +To: Ravindran G - TLS, Chennai. +Cc: pgsql-performance@postgresql.org +Subject: Re: [PERFORM] Postgre SQL 7.1 cygwin performance issue. + + +Ravindran G - TLS, Chennai. wrote: +> I would like to talk to one of the org member in postgre about this = +issue. +> This is critical for us. Please help. +>=20 +> It will be great, if you could provide your contact number to discuss = +on +> this.=20 + +Sure, we're happy to help. You can contact several "org members" via +this mailing list. What's your problem exactly? If you're finding that +the 7.1 cygwin version is too slow, please consider migrating some +something more recent. 8.1 runs natively on Windows, no Cygwin = +required. +It's much faster and doesn't have that limitation on the number of +connections. + +Please note that the name is "PostgreSQL" and is usually shortened to +"Postgres". It's never "postgre". + +--=20 +Alvaro Herrera = +http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. +DISCLAIMER=20 +The contents of this e-mail and any attachment(s) are confidential and = +intended for the=20 + +named recipient(s) only. It shall not attach any liability on the = +originator or HCL or its=20 + +affiliates. Any views or opinions presented in this email are solely = +those of the author and=20 + +may not necessarily reflect the opinions of HCL or its affiliates. Any = +form of reproduction,=20 + +dissemination, copying, disclosure, modification, distribution and / or = +publication of this=20 + +message without the prior written consent of the author of this e-mail = +is strictly=20 + +prohibited. If you have received this email in error please delete it = +and notify the sender=20 + +immediately. Before opening any mail and attachments please check them = +for viruses and=20 + +defect. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:17:57 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 673419FCF40 + for ; + Mon, 28 Aug 2006 11:17:56 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 65802-06 for + ; + Mon, 28 Aug 2006 14:17:54 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.185]) + by postgresql.org (Postfix) with ESMTP id 9C56C9FCF3E + for ; + Mon, 28 Aug 2006 11:17:53 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id p77so1340329nfc + for ; + Mon, 28 Aug 2006 07:17:52 -0700 (PDT) +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=sA8ZftwK6OnkmFt5hup9LoGAvrIKQ2er7uhDF/HOiu58JETa64qT99YrN9dtlmMCFdH+bP5wsMnpf+I5/3EUZ4SfdSmGBGgy/D36+qj2eZJnvtHXOyNUVsdLtbg+xpSkr2y7dL6sJJCy5YdBz6j3XO8M9ijrMJ6ZTKQTV2g1fKU= +Received: by 10.65.157.13 with SMTP id j13mr6914480qbo; + Mon, 28 Aug 2006 07:17:51 -0700 (PDT) +Received: by 10.64.27.7 with HTTP; Mon, 28 Aug 2006 07:17:51 -0700 (PDT) +Message-ID: +Date: Mon, 28 Aug 2006 14:17:51 +0000 +From: "Christopher Browne" +To: "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/432 +X-Sequence-Number: 20617 + +On 8/28/06, Ravindran G - TLS, Chennai. wrote: +> Thanks Alvaro. +> +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000. +> +> We understand that the maximum connections that can be set is 64 in +> Postgresql 7.1 version. +> +> But our application is installed in 8 / 10 PC or more than that and it op= +ens +> multiple connections and it exceeds 64. +> +> Because of this the subsequent connections are failed to connect with DB +> from application. +> +> Please advise us on how to resolve this ?. + +I don't think you have any answer other than to migrate to a +better-supportable version of PostgreSQL. + +The last release of 7.1 was in August 2001; you're using a version +that is now over five years old, with known "it'll eat your data" +problems. That is why there have been some fifty-odd subsequent +releases. + +The right answer is to arrange for an upgrade to a much less antiquated ver= +sion. + +You're going to be pretty well restricted to the 64 connections until +you upgrade to a more recent version. + +There is an alternative: You could migrate to some Unix-like platform +(such as Linux or FreeBSD) where version 7.1.3 could in fact support +more than 64 connections. +--=20 +http://www3.sympatico.ca/cbbrowne/linux.html +Oddly enough, this is completely standard behaviour for shells. This +is a roundabout way of saying `don't use combined chains of `&&'s and +`||'s unless you think G=F6del's theorem is for sissies'. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:18:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 70CA59FCF3A + for ; + Mon, 28 Aug 2006 11:18:58 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 61078-04 for + ; + Mon, 28 Aug 2006 11:18:37 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from moutng.kundenserver.de (moutng.kundenserver.de + [212.227.126.188]) + by postgresql.org (Postfix) with ESMTP id C3D2A9FCF40 + for ; + Mon, 28 Aug 2006 11:18:37 -0300 (ADT) +Received: from [194.25.154.138] (helo=webserv.wug.de) + by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis), + id 0MKwtQ-1GHhwh2hDV-0001Tz; Mon, 28 Aug 2006 16:18:36 +0200 +Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) + id 1GHhwg-0005FB-00 + for pgsql-performance@postgresql.org; Mon, 28 Aug 2006 16:18:34 +0200 +Date: Mon, 28 Aug 2006 16:18:34 +0200 +From: "A. Kretschmer" +To: pgsql-performance@postgresql.org +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Message-ID: <20060828141834.GH9416@localhost.localdomain> +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +User-Agent: Mutt/1.5.9i +X-Provags-ID: kundenserver.de abuse@kundenserver.de + login:51ea9561fc3f6d9539a2acd743e4748c +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.774 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/433 +X-Sequence-Number: 20618 + +am Mon, dem 28.08.2006, um 19:30:44 +0530 mailte Ravindran G - TLS, Chennai. folgendes: +> Thanks Alvaro. +> +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000. + +*grrr* + +> +> We understand that the maximum connections that can be set is 64 in +> Postgresql 7.1 version. +> +> But our application is installed in 8 / 10 PC or more than that and it opens +> multiple connections and it exceeds 64. +> +> Because of this the subsequent connections are failed to connect with DB +> from application. +> +> Please advise us on how to resolve this ?. + +I'm not sure, but perhaps, pgpool can solve your problem. + +> +> -- +> +> Migrating to 8.1 may not be possible at this point of time due to some +> reasons. + +Pity. 8.1 is *very* nice, and 7.1 *very* old, slow and out of +life-cycle. + + + +> +> Regards, Ravi +> +> +> -----Original Message----- + +Please, no top-posting with fullquote below. + + +Andreas +-- +Andreas Kretschmer +Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) +GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:20:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3CB8D9FCF4D + for ; + Mon, 28 Aug 2006 11:20:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 63659-10 for + ; + Mon, 28 Aug 2006 14:20:22 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 190039FCF50 + for ; + Mon, 28 Aug 2006 11:20:21 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7SEKF7q005919; + Mon, 28 Aug 2006 07:20:15 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id 1DA21C2DC58; Mon, 28 Aug 2006 10:20:00 -0400 (CLT) +Date: Mon, 28 Aug 2006 10:19:59 -0400 +From: Alvaro Herrera +To: "Ravindran G - TLS, Chennai." +Cc: pgsql-performance@postgresql.org, + "Isac Newton A - TLS, Chennai." +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Message-ID: <20060828141959.GD27526@alvh.no-ip.org> +Mail-Followup-To: "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org, + "Isac Newton A - TLS, Chennai." +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 28 Aug 2006 07:20:16 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/434 +X-Sequence-Number: 20619 + +Ravindran G - TLS, Chennai. wrote: +> Thanks Alvaro. +> +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000. +> +> We understand that the maximum connections that can be set is 64 in +> Postgresql 7.1 version. + +This is because of Cygwin limitations. + +> But our application is installed in 8 / 10 PC or more than that and it opens +> multiple connections and it exceeds 64. +> +> Because of this the subsequent connections are failed to connect with DB +> from application. +> +> Please advise us on how to resolve this ?. + +There's no solution short of upgrading. + +> Migrating to 8.1 may not be possible at this point of time due to some +> reasons. + +That's too bad :-( + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:28:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 484B49FCF67 + for ; + Mon, 28 Aug 2006 11:28:47 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 62090-03 for + ; + Mon, 28 Aug 2006 11:28:43 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.199]) + by postgresql.org (Postfix) with ESMTP id EC9939FCF60 + for ; + Mon, 28 Aug 2006 11:28:43 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so905088nzn + for ; + Mon, 28 Aug 2006 07:28:42 -0700 (PDT) +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=ji9c5N8feDsG8VS7djFKA0XgPoRIqAbeZywkA+3k1eclNE61FGvZel0aSK9IQBQpb3hn934tRe39L5K0EjLm2mzSFBkc2K9U+k4A4Q9gxOeD5qyBvo4LydFk9cTwc2JlOZUCAL3USZhrZmYTBxP7P9wKX8Wz5NCg9P0nT6lAb0I= +Received: by 10.65.81.19 with SMTP id i19mr6910824qbl; + Mon, 28 Aug 2006 07:28:42 -0700 (PDT) +Received: by 10.64.27.7 with HTTP; Mon, 28 Aug 2006 07:28:42 -0700 (PDT) +Message-ID: +Date: Mon, 28 Aug 2006 14:28:42 +0000 +From: "Christopher Browne" +To: "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org, + "Isac Newton A - TLS, Chennai." +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +In-Reply-To: <20060828141959.GD27526@alvh.no-ip.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> + <20060828141959.GD27526@alvh.no-ip.org> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.183 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/435 +X-Sequence-Number: 20620 + +On 8/28/06, Alvaro Herrera wrote: +> > Please advise us on how to resolve this ?. +> +> There's no solution short of upgrading. + +That's a little too negative. There is at least one alternative, +possibly two... + +1. Migrate the database to a Unix platform that does not suffer from +the Cygwin 64 connection restriction. (If running Linux, it may be +necessary to look for an old release, as there were changes to GLIBC +at around the same time as 7.2 that don't play perfectly well with +7.1...) + +2. It is *possible* that pg_pool could be usable as a proxy that +limits the number of connections actually used. I'm not sure how well +it'll play with 7.1, mind you... +--=20 +http://www3.sympatico.ca/cbbrowne/linux.html +Oddly enough, this is completely standard behaviour for shells. This +is a roundabout way of saying `don't use combined chains of `&&'s and +`||'s unless you think G=F6del's theorem is for sissies'. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:40:01 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8941D9FCF7C + for ; + Mon, 28 Aug 2006 11:40:00 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 76418-05 for + ; + Mon, 28 Aug 2006 14:39:57 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 27F889FCF76 + for ; + Mon, 28 Aug 2006 11:39:54 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from mx.mall.cz (mall--l3sw2-2948.tgnet.cz [82.100.0.98]) + by svr4.postgresql.org (Postfix) with ESMTP id 96AFE5AF8B3 + for ; + Mon, 28 Aug 2006 14:39:53 +0000 (GMT) +Received: from localhost (asterix [127.0.0.1]) + by mx.mall.cz (Postfix) with ESMTP id 988ED13F617 + for ; + Mon, 28 Aug 2006 16:39:41 +0200 (CEST) +Received: from mx.mall.cz ([127.0.0.1]) + by localhost (asterix [127.0.0.1]) (amavisd-new, port 10025) with ESMTP + id 26362-09 for ; + Mon, 28 Aug 2006 16:39:37 +0200 (CEST) +Message-ID: <44F30022.1000009@mall.cz> +Date: Mon, 28 Aug 2006 16:39:30 +0200 +From: Michal Taborsky - Internet Mall +Organization: Internet Mall, a.s. +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: Identifying bloated tables +Content-Type: text/plain; charset=ISO-8859-2; format=flowed +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: by amavisd-new at mall.cz +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.519 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_SOFTFAIL +X-Spam-Level: * +X-Archive-Number: 200608/436 +X-Sequence-Number: 20621 + +I just put together a view, which helps us in indentifying which +database tables are suffering from space bloat, ie. they take up much +more space than they actually should. I though this might be useful for +some folk here, because the questions about bloat-related performance +degradation are quite common. + +When using this view, you are interested in tables, which have the +"bloat" column higher that say 2.0 (in freshly dump/restored/analyzed +database they should all be around 1.0). + +The bloat problem can be one-time fixed either by VACUUM FULL or +CLUSTER, but if the problem is coming back after while, you should +consider doing VACUUM more often or increasing you FSM settings in +postgresql.conf. + +I hope I did the view right, it is more or less accurate, for our +purposes (for tables of just few pages the numbers may be off, but then +again, you are usually not much concerned about these tiny 5-page tables +performance-wise). + +Hope this helps someone. + +Here comes the view. + + +CREATE OR REPLACE VIEW "public"."relbloat" ( + nspname, + relname, + reltuples, + relpages, + avgwidth, + expectedpages, + bloat, + wastedspace) +AS +SELECT pg_namespace.nspname, pg_class.relname, pg_class.reltuples, + pg_class.relpages, rowwidths.avgwidth, ceil(((pg_class.reltuples * + (rowwidths.avgwidth)::double precision) / + (current_setting('block_size'::text))::double precision)) AS +expectedpages, + ((pg_class.relpages)::double precision / ceil(((pg_class.reltuples * + (rowwidths.avgwidth)::double precision) / + (current_setting('block_size'::text))::double precision))) AS bloat, + ceil(((((pg_class.relpages)::double precision * + (current_setting('block_size'::text))::double precision) - + ceil((pg_class.reltuples * (rowwidths.avgwidth)::double precision))) / + (1024)::double precision)) AS wastedspace +FROM ((( + SELECT pg_statistic.starelid, sum(pg_statistic.stawidth) AS avgwidth + FROM pg_statistic + GROUP BY pg_statistic.starelid + ) rowwidths JOIN pg_class ON ((rowwidths.starelid = pg_class.oid))) +JOIN + pg_namespace ON ((pg_namespace.oid = pg_class.relnamespace))) +WHERE (pg_class.relpages > 1); + + +Bye. + +-- +Michal T�borsk� +IT operations chief +Internet Mall, a.s. + + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:48:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ED6909FCF76 + for ; + Mon, 28 Aug 2006 11:48:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 62425-06 for + ; + Mon, 28 Aug 2006 11:48:20 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.libertyrms.com (vgateway.libertyrms.info [207.219.45.62]) + by postgresql.org (Postfix) with ESMTP id 3F2CA9FCF87 + for ; + Mon, 28 Aug 2006 11:48:20 -0300 (ADT) +Received: from dba5.int.libertyrms.com ([10.1.3.44]) + by mail.libertyrms.com with esmtp (Exim 4.22) + id 1GHiPT-0002Z0-Bz; Mon, 28 Aug 2006 10:48:19 -0400 +Subject: Re: Identifying bloated tables +From: Brad Nicholson +To: Michal Taborsky - Internet Mall +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44F30022.1000009@mall.cz> +References: <44F30022.1000009@mall.cz> +Content-Type: text/plain +Date: Mon, 28 Aug 2006 10:48:18 -0400 +Message-Id: <1156776499.10296.5.camel@dba5.int.libertyrms.com> +Mime-Version: 1.0 +X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5) +Content-Transfer-Encoding: 7bit +X-SA-Exim-Mail-From: bnichols@ca.afilias.info +X-SA-Exim-Scanned: No; SAEximRunCond expanded to false +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.298 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/437 +X-Sequence-Number: 20622 + +On Mon, 2006-08-28 at 16:39 +0200, Michal Taborsky - Internet Mall +wrote: +> I just put together a view, which helps us in indentifying which +> database tables are suffering from space bloat, ie. they take up much +> more space than they actually should. I though this might be useful for +> some folk here, because the questions about bloat-related performance +> degradation are quite common. + +Are you sure you haven't reinvented the wheel? Have you checked out +contrib/pgstattuple ? + +Brad. + + +From pgsql-performance-owner@postgresql.org Mon Aug 28 11:57:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id B73B49FCFA3 + for ; + Mon, 28 Aug 2006 11:56:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 63211-05 for + ; + Mon, 28 Aug 2006 11:56:52 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 50F569FB209 + for ; + Mon, 28 Aug 2006 11:56:52 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Mon, 28 Aug 2006 14:56:46 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 28 Aug 2006 09:56:46 -0500 +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +From: Scott Marlowe +To: "Ravindran G - TLS, Chennai." +Cc: Alvaro Herrera , + pgsql-performance@postgresql.org, "Isac Newton A - TLS, + Chennai." +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156777006.3932.11.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Mon, 28 Aug 2006 09:56:46 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.079 tagged_above=0 required=5 tests=AWL, SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/438 +X-Sequence-Number: 20623 + +On Mon, 2006-08-28 at 09:00, Ravindran G - TLS, Chennai. wrote: +> Thanks Alvaro. +> +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000. +> +> We understand that the maximum connections that can be set is 64 in +> Postgresql 7.1 version. +> +> But our application is installed in 8 / 10 PC or more than that and it opens +> multiple connections and it exceeds 64. +> +> Because of this the subsequent connections are failed to connect with DB +> from application. +> +> Please advise us on how to resolve this ?. + +As someone else mentioned, pg_pool might help here. But you're kind of +fighting an uphill battle here. I'm guessing that your effort will be +better spent on upgrading your db server than on trying to patch up the +system you have. + +Is there any chance of changing your client app so it doesn't open so +many connections? That would seem the easiest fix of all, if you have +access to that code. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 12:09:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id DBAA89FCFC5 + for ; + Mon, 28 Aug 2006 12:09:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 78337-10 for + ; + Mon, 28 Aug 2006 15:09:19 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 05B3F9FCFBF + for ; + Mon, 28 Aug 2006 12:09:18 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7SF9CDx007008 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Mon, 28 Aug 2006 08:09:16 -0700 +Message-ID: <44F3071F.20303@commandprompt.com> +Date: Mon, 28 Aug 2006 08:09:19 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: "Ravindran G - TLS, Chennai." +CC: pgsql-performance@postgresql.org +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +References: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +In-Reply-To: <012301731C23DE4DBFE035647C68F1CC03B3317B@sindhu.ctd.hcltech.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 28 Aug 2006 08:09:17 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=2.135 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SARE_RAND_1 +X-Spam-Level: ** +X-Archive-Number: 200608/439 +X-Sequence-Number: 20624 + +Ravindran G - TLS, Chennai. wrote: +> Hi, +> +> We are using PostgreSQL 7.1 cygwin installed on Windows 2000 (2 GB Memory, +> P4). +> + +I would strongly suggest moving to native 8.1 :). You will find your +life much better. + + +Joshua D. Drake + + +> We understand that the maximum connections that can be set is 64 in +> Postgresql 7.1 version. +> +> The performance is very slow and some time the database is not getting +> connected from our application because of this. +> +> Please advise us on how to increase the performance by setting any +> attributes in configuration files ?. +> +> Find enclosed the configuration file. +> +> Thanks and regards, +> Ravi +> +> +> To post a message to the mailing list, send it to +> pgsql-performance@postgresql.org +> +> +> -----Original Message----- +> From: pgsql-performance-owner@postgresql.org +> [mailto:pgsql-performance-owner@postgresql.org] +> Sent: Tuesday, August 22, 2006 5:32 PM +> To: ravig3 +> Subject: 7E88-5CD9-AD0E : CONFIRM from pgsql-performance (subscribe) +> +> +> __ +> The following request +> +> "subscribe pgsql-performance ravig3 " +> +> was sent to +> by ravig3 . +> +> To accept or reject this request, please do one of the following: +> +> 1. If you have web browsing capability, visit +> +> AD0E> +> and follow the instructions there. +> +> 2. Reply to majordomo@postgresql.org +> with one of the following two commands in the body of the message: +> +> accept +> reject +> +> (The number 7E88-5CD9-AD0E must be in the Subject header) +> +> 3. Reply to majordomo@postgresql.org +> with one of the following two commands in the body of the message: +> +> accept 7E88-5CD9-AD0E +> reject 7E88-5CD9-AD0E +> +> Your confirmation is required for the following reason(s): +> +> The subscribe_policy rule says that the "subscribe" command +> must be confirmed by the person affected by the command. +> +> +> If you do not respond within 4 days, a reminder will be sent. +> +> If you do not respond within 7 days, this token will expire, +> and the request will not be completed. +> +> If you would like to communicate with a person, +> send mail to pgsql-performance-owner@postgresql.org. +> DISCLAIMER +> The contents of this e-mail and any attachment(s) are confidential and intended for the +> +> named recipient(s) only. It shall not attach any liability on the originator or HCL or its +> +> affiliates. Any views or opinions presented in this email are solely those of the author and +> +> may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, +> +> dissemination, copying, disclosure, modification, distribution and / or publication of this +> +> message without the prior written consent of the author of this e-mail is strictly +> +> prohibited. If you have received this email in error please delete it and notify the sender +> +> immediately. Before opening any mail and attachments please check them for viruses and +> +> defect. +> +> +> ------------------------------------------------------------------------ +> +> # +> # PostgreSQL configuration file +> # ----------------------------- +> # +> # This file consists of lines of the form +> # +> # name = value +> # +> # (The `=' is optional.) White space is collapsed, comments are +> # introduced by `#' anywhere on a line. The complete list of option +> # names and allowed values can be found in the PostgreSQL +> # documentation. The commented-out settings shown in this file +> # represent the default values. +> +> # Any option can also be given as a command line switch to the +> # postmaster, e.g., 'postmaster -c log_connections=on'. Some options +> # can be changed at run-time with the 'SET' SQL command. +> +> +> #======================================================================== +> +> +> # +> # Connection Parameters +> # +> tcpip_socket = true +> #ssl = false +> +> max_connections = 64 +> +> #port = 5432 +> #hostname_lookup = false +> #show_source_port = false +> +> #unix_socket_directory = '' +> #unix_socket_group = '' +> #unix_socket_permissions = 0777 +> +> #virtual_host = '' +> +> #krb_server_keyfile = '' +> +> +> # +> # Shared Memory Size +> # +> shared_buffers = 20000 # 2*max_connections, min 16 +> #max_fsm_relations = 100 # min 10, fsm is free space map +> max_fsm_pages = 20000 # min 1000, fsm is free space map +> #max_locks_per_transaction = 64 # min 10 +> #wal_buffers = 8 # min 4 +> +> # +> # Non-shared Memory Sizes +> # +> #sort_mem = 512 # min 32 +> #vacuum_mem = 8192 # min 1024 +> +> +> # +> # Write-ahead log (WAL) +> # +> #wal_files = 0 # range 0-64 +> wal_sync_method = open_sync # the default varies across platforms: +> # # fsync, fdatasync, open_sync, or open_datasync +> #wal_debug = 0 # range 0-16 +> #commit_delay = 0 # range 0-100000 +> #commit_siblings = 5 # range 1-1000 +> #checkpoint_segments = 3 # in logfile segments (16MB each), min 1 +> #checkpoint_timeout = 300 # in seconds, range 30-3600 +> #fsync = true +> +> +> # +> # Optimizer Parameters +> # +> #enable_seqscan = true +> #enable_indexscan = true +> #enable_tidscan = true +> #enable_sort = true +> #enable_nestloop = true +> #enable_mergejoin = true +> #enable_hashjoin = true +> +> #ksqo = false +> +> effective_cache_size = 5000 # default in 8k pages +> #random_page_cost = 4 +> #cpu_tuple_cost = 0.01 +> #cpu_index_tuple_cost = 0.001 +> #cpu_operator_cost = 0.0025 +> +> +> # +> # GEQO Optimizer Parameters +> # +> #geqo = true +> #geqo_selection_bias = 2.0 # range 1.5-2.0 +> #geqo_threshold = 11 +> #geqo_pool_size = 0 # default based on #tables in query, range 128-1024 +> #geqo_effort = 1 +> #geqo_generations = 0 +> #geqo_random_seed = -1 # auto-compute seed +> +> +> # +> # Debug display +> # +> #silent_mode = false +> +> log_connections = true +> log_timestamp = true +> #log_pid = false +> +> #debug_level = 0 # range 0-16 +> +> debug_print_query = true +> #debug_print_parse = false +> #debug_print_rewritten = false +> #debug_print_plan = false +> #debug_pretty_print = false +> +> # requires USE_ASSERT_CHECKING +> #debug_assertions = true +> +> +> # +> # Syslog +> # +> # requires ENABLE_SYSLOG +> #syslog = 0 # range 0-2 +> #syslog_facility = 'LOCAL0' +> #syslog_ident = 'postgres' +> +> +> # +> # Statistics +> # +> #show_parser_stats = false +> #show_planner_stats = false +> #show_executor_stats = false +> #show_query_stats = false +> +> # requires BTREE_BUILD_STATS +> #show_btree_build_stats = false +> +> +> # +> # Access statistics collection +> # +> #stats_start_collector = true +> #stats_reset_on_server_start = true +> #stats_command_string = false +> #stats_row_level = false +> #stats_block_level = false +> +> +> # +> # Lock Tracing +> # +> #trace_notify = false +> +> # requires LOCK_DEBUG +> #trace_locks = false +> #trace_userlocks = false +> #trace_lwlocks = false +> #debug_deadlocks = false +> #trace_lock_oidmin = 16384 +> #trace_lock_table = 0 +> +> +> # +> # Misc +> # +> #dynamic_library_path = '$libdir' +> #australian_timezones = false +> #authentication_timeout = 60 # min 1, max 600 +> #deadlock_timeout = 1000 +> #default_transaction_isolation = 'read committed' +> #max_expr_depth = 10000 # min 10 +> #max_files_per_process = 1000 # min 25 +> #password_encryption = false +> #sql_inheritance = true +> #transform_null_equals = false +> +> +> +> ------------------------------------------------------------------------ +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 6: explain analyze is your friend + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Mon Aug 28 12:14:06 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 845119FCFCB + for ; + Mon, 28 Aug 2006 12:14:05 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 78989-09 for + ; + Mon, 28 Aug 2006 15:14:02 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 56DBA9FCFBF + for ; + Mon, 28 Aug 2006 12:14:01 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7SFDtgs028300; + Mon, 28 Aug 2006 11:13:55 -0400 (EDT) +To: "Christopher Browne" +cc: "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org, "Isac Newton A - TLS, + Chennai." +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +In-reply-to: +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> + <20060828141959.GD27526@alvh.no-ip.org> + +Comments: In-reply-to "Christopher Browne" + message dated "Mon, 28 Aug 2006 14:28:42 -0000" +Date: Mon, 28 Aug 2006 11:13:55 -0400 +Message-ID: <28299.1156778035@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/440 +X-Sequence-Number: 20625 + +"Christopher Browne" writes: +> On 8/28/06, Alvaro Herrera wrote: +>> There's no solution short of upgrading. + +> That's a little too negative. There is at least one alternative, +> possibly two... + +But both of those would probably involve work comparable to an upgrade. + +There is another reason for not encouraging these folk to stay on 7.1 +indefinitely, which is that 7.1 still has the transaction ID wraparound +problem. It *will* --- not might, WILL --- eat their data someday. +Without knowing anything about their transaction rate, I can't say +whether that will happen tomorrow or not for many years, but insisting +on staying on 7.1 is a dangerous game. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Mon Aug 28 12:28:03 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 104F19FCFDF + for ; + Mon, 28 Aug 2006 12:28:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 63204-10 for + ; + Mon, 28 Aug 2006 12:27:57 -0300 (ADT) +X-Greylist: delayed 00:48:13.113032 by SQLgrey- +Received: from mx.mall.cz (mall--l3sw2-2948.tgnet.cz [82.100.0.98]) + by postgresql.org (Postfix) with ESMTP id 31B019FCFD5 + for ; + Mon, 28 Aug 2006 12:27:55 -0300 (ADT) +Received: from localhost (asterix [127.0.0.1]) + by mx.mall.cz (Postfix) with ESMTP id AF1A713F60B; + Mon, 28 Aug 2006 17:27:54 +0200 (CEST) +Received: from mx.mall.cz ([127.0.0.1]) + by localhost (asterix [127.0.0.1]) (amavisd-new, port 10025) with ESMTP + id 32559-04; Mon, 28 Aug 2006 17:27:52 +0200 (CEST) +Message-ID: <44F30B7A.4020800@mall.cz> +Date: Mon, 28 Aug 2006 17:27:54 +0200 +From: Michal Taborsky - Internet Mall +Organization: Internet Mall, a.s. +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Brad Nicholson +Cc: pgsql-performance@postgresql.org +Subject: Re: Identifying bloated tables +References: <44F30022.1000009@mall.cz> + <1156776499.10296.5.camel@dba5.int.libertyrms.com> +In-Reply-To: <1156776499.10296.5.camel@dba5.int.libertyrms.com> +Content-Type: text/plain; charset=ISO-8859-2; format=flowed +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: by amavisd-new at mall.cz +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.365 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/441 +X-Sequence-Number: 20626 + +Brad Nicholson napsal(a): +>> I just put together a view, which helps us in indentifying which +>> database tables are suffering from space bloat, ie. they take up much + +> Are you sure you haven't reinvented the wheel? Have you checked out +> contrib/pgstattuple ? + +Well, I wasn't aware of it, so I guess I did reinvent the wheel. I +Googled for a solution to this problem, but Googled poorly I suppose. + +On the other hand, pgstattuple might be a bit difficult to use for +not-so-experienced users in answering the question "Which table should I +shrink?", as you have to first install it from contrib and then come up +with a select to pick the "worst" relations. + +Anyway, if someone finds this view useful, good. If not, ignore it. + +Bye. + +-- +Michal T�borsk� +IT operations chief +Internet Mall, a.s. + + +From pgsql-performance-owner@postgresql.org Mon Aug 28 12:32:39 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id AE0609FCFE2 + for ; + Mon, 28 Aug 2006 12:32:37 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 91579-03 for + ; + Mon, 28 Aug 2006 15:32:30 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id F1A8B9FCFD5 + for ; + Mon, 28 Aug 2006 12:32:29 -0300 (ADT) +Received: from alvh.no-ip.org (201-221-200-187.bk11-dsl.surnet.cl + [201.221.200.187]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7SFWE7D007454; + Mon, 28 Aug 2006 08:32:19 -0700 +Received: by alvh.no-ip.org (Postfix, from userid 1000) + id A307DC2DC58; Mon, 28 Aug 2006 11:31:52 -0400 (CLT) +Date: Mon, 28 Aug 2006 11:31:52 -0400 +From: Alvaro Herrera +To: Brad Nicholson +Cc: Michal Taborsky - Internet Mall , + pgsql-performance@postgresql.org +Subject: Re: Identifying bloated tables +Message-ID: <20060828153152.GH27526@alvh.no-ip.org> +Mail-Followup-To: Brad Nicholson , + Michal Taborsky - Internet Mall , + pgsql-performance@postgresql.org +References: <44F30022.1000009@mall.cz> + <1156776499.10296.5.camel@dba5.int.libertyrms.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1156776499.10296.5.camel@dba5.int.libertyrms.com> +User-Agent: Mutt/1.5.12-2006-07-14 +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Mon, 28 Aug 2006 08:32:19 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/442 +X-Sequence-Number: 20627 + +Brad Nicholson wrote: +> On Mon, 2006-08-28 at 16:39 +0200, Michal Taborsky - Internet Mall +> wrote: +> > I just put together a view, which helps us in indentifying which +> > database tables are suffering from space bloat, ie. they take up much +> > more space than they actually should. I though this might be useful for +> > some folk here, because the questions about bloat-related performance +> > degradation are quite common. +> +> Are you sure you haven't reinvented the wheel? Have you checked out +> contrib/pgstattuple ? + +Actually, pgstattuple needs to scan the whole table, so I think having a +cheap workaround that gives approximate figures is a good idea anyway. + +-- +Alvaro Herrera http://www.CommandPrompt.com/ +The PostgreSQL Company - Command Prompt, Inc. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 12:49:25 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C2D2D9FCFEE + for ; + Mon, 28 Aug 2006 12:49:24 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 68157-07 for + ; + Mon, 28 Aug 2006 12:49:07 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) + by postgresql.org (Postfix) with ESMTP id D93A29FCFAA + for ; + Mon, 28 Aug 2006 12:49:06 -0300 (ADT) +Received: from kingfisher.intern.logix-tt.com (p549D1A06.dip0.t-ipconnect.de + [84.157.26.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.logix-tt.com (Postfix) with ESMTP id 4BE4C6597B; + Mon, 28 Aug 2006 17:51:12 +0200 (CEST) +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 293261853F088; + Mon, 28 Aug 2006 17:49:29 +0200 (CEST) +Message-ID: <44F31088.5040602@logix-tt.com> +Date: Mon, 28 Aug 2006 17:49:28 +0200 +From: Markus Schaber +Organization: Logical Tracking and Tracing International AG, Switzerland +User-Agent: Thunderbird 1.5.0.4 (X11/20060713) +MIME-Version: 1.0 +To: Michal Taborsky - Internet Mall +Cc: pgsql-performance@postgresql.org +Subject: Re: Identifying bloated tables +References: <44F30022.1000009@mall.cz> +In-Reply-To: <44F30022.1000009@mall.cz> +X-Enigmail-Version: 0.94.0.0 +Content-Type: text/plain; charset=ISO-8859-15 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.17 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/443 +X-Sequence-Number: 20628 + +Hi, Michal, + +Michal Taborsky - Internet Mall wrote: + +> When using this view, you are interested in tables, which have the +> "bloat" column higher that say 2.0 (in freshly dump/restored/analyzed +> database they should all be around 1.0). + +I just noticed some columns in pg_catalog with a bloat value <1 and a +negative "wasted space" - is this due to the pseudo nature of them? + +Markus + + +-- +Markus Schaber | Logical Tracking&Tracing International AG +Dipl. Inf. | Software Development GIS + +Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org + +From pgsql-performance-owner@postgresql.org Mon Aug 28 12:56:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id D5FD49FD003 + for ; + Mon, 28 Aug 2006 12:56:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 01444-07 for + ; + Mon, 28 Aug 2006 15:56:11 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mx.mall.cz (mall--l3sw2-2948.tgnet.cz [82.100.0.98]) + by postgresql.org (Postfix) with ESMTP id DE84C9FCFFA + for ; + Mon, 28 Aug 2006 12:56:10 -0300 (ADT) +Received: from localhost (asterix [127.0.0.1]) + by mx.mall.cz (Postfix) with ESMTP id 5C3D413F61E; + Mon, 28 Aug 2006 17:56:09 +0200 (CEST) +Received: from mx.mall.cz ([127.0.0.1]) + by localhost (asterix [127.0.0.1]) (amavisd-new, port 10025) with ESMTP + id 04207-01; Mon, 28 Aug 2006 17:56:06 +0200 (CEST) +Message-ID: <44F31218.6040703@mall.cz> +Date: Mon, 28 Aug 2006 17:56:08 +0200 +From: Michal Taborsky - Internet Mall +Organization: Internet Mall, a.s. +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Markus Schaber +Cc: pgsql-performance@postgresql.org +Subject: Re: Identifying bloated tables +References: <44F30022.1000009@mall.cz> <44F31088.5040602@logix-tt.com> +In-Reply-To: <44F31088.5040602@logix-tt.com> +Content-Type: text/plain; charset=ISO-8859-2; format=flowed +Content-Transfer-Encoding: 8bit +X-Virus-Scanned: by amavisd-new at mall.cz +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/444 +X-Sequence-Number: 20629 + +Markus Schaber napsal(a): +> Hi, Michal, +> +> Michal Taborsky - Internet Mall wrote: +> +>> When using this view, you are interested in tables, which have the +>> "bloat" column higher that say 2.0 (in freshly dump/restored/analyzed +>> database they should all be around 1.0). +> +> I just noticed some columns in pg_catalog with a bloat value <1 and a +> negative "wasted space" - is this due to the pseudo nature of them? + +It is more likely due to the fact, that these numbers are just +estimates, based on collected table statistics, so for small or +non-standard tables the statistical error is greater that the actual +value. You are usually not interested in tables, which have wasted space +of 1000kB or -1000kB. Also the database must be ANALYZEd properly for +these numbers to carry any significance. + +-- +Michal T�borsk� +IT operations chief +Internet Mall, a.s. + +Internet Mall - obchody, kter� si obl�b�te + + +From pgsql-performance-owner@postgresql.org Mon Aug 28 13:03:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 3FE019FD025 + for ; + Mon, 28 Aug 2006 13:03:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 02796-07 for + ; + Mon, 28 Aug 2006 16:03:01 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id DE21B9FD023 + for ; + Mon, 28 Aug 2006 13:03:00 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Mon, 28 Aug 2006 16:02:59 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 28 Aug 2006 11:02:59 -0500 +Subject: Re: Benchmarks +From: Scott Marlowe +To: Merlin Moncure +Cc: Charles Sprickman , pgsql-performance@postgresql.org +In-Reply-To: +References: + +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156780979.10490.6.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Mon, 28 Aug 2006 11:02:59 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/445 +X-Sequence-Number: 20630 + +On Sun, 2006-08-27 at 21:26, Merlin Moncure wrote: + +> > I'll be throwing in some quick stats on the box described above later +> > today... At first glance, the 3Ware controller is really looking like an +> > excellent value. +> +> they are pretty decent. the benchmark is software raid which actually +> outperforms many hardware controllers. adaptec is complete trash, +> they even dropped support of their command line utilty for the +> controller on linux, ugh. ibm serveraid controllers are rebranded +> adaptect btw. + +Just a followup on this. Last place I worked we had a bunch of Dell +2600 boxen with Adaptec RAID controllers. Due to the horribly +unreliable behaviour of these machines with those controllers (random +lockups etc...) we switched off the RAID and went to software mirror +sets under linux. The machines because very stable, and as an added +bonus, the performance was higher as well. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 13:20:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C9C3A9FD046 + for ; + Mon, 28 Aug 2006 13:20:25 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 23442-02 for + ; + Mon, 28 Aug 2006 16:20:08 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wr-out-0506.google.com (wr-out-0506.google.com + [64.233.184.229]) + by postgresql.org (Postfix) with ESMTP id A9F219FD049 + for ; + Mon, 28 Aug 2006 13:20:08 -0300 (ADT) +Received: by wr-out-0506.google.com with SMTP id i21so301391wra + for ; + Mon, 28 Aug 2006 09:20:07 -0700 (PDT) +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=C5cpJgHtuUVe4AmxOkL0Eqz9RsfwafMnj8Jqtw2kKuyBD2DmWn9jR/1y8AKVw0nVlf+K0Mw9giP5eOfa8DuBZ5qwAmNqRg4JIybwh0fkxrMMLpCREKPK974ClKlNq/ZyCQBspGjdnCIiQIagUJKuZm2b1z7j6tLi9pDbd46oNZc= +Received: by 10.64.156.3 with SMTP id d3mr7120116qbe; + Mon, 28 Aug 2006 09:20:07 -0700 (PDT) +Received: by 10.64.27.7 with HTTP; Mon, 28 Aug 2006 09:20:07 -0700 (PDT) +Message-ID: +Date: Mon, 28 Aug 2006 16:20:07 +0000 +From: "Christopher Browne" +To: "Tom Lane" +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Cc: "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org, + "Isac Newton A - TLS, Chennai." +In-Reply-To: <28299.1156778035@sss.pgh.pa.us> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> + <20060828141959.GD27526@alvh.no-ip.org> + + <28299.1156778035@sss.pgh.pa.us> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/446 +X-Sequence-Number: 20631 + +On 8/28/06, Tom Lane wrote: +> "Christopher Browne" writes: +> > On 8/28/06, Alvaro Herrera wrote: +> >> There's no solution short of upgrading. +> +> > That's a little too negative. There is at least one alternative, +> > possibly two... +> +> But both of those would probably involve work comparable to an upgrade. + +We don't know what is preventing the upgrade; we haven't been told +anything about the details surrounding that. + +> There is another reason for not encouraging these folk to stay on 7.1 +> indefinitely, which is that 7.1 still has the transaction ID wraparound +> problem. It *will* --- not might, WILL --- eat their data someday. +> Without knowing anything about their transaction rate, I can't say +> whether that will happen tomorrow or not for many years, but insisting +> on staying on 7.1 is a dangerous game. + +Fair enough. I would only suggest these workarounds as a way of +getting a bit of temporary "breathing room" before doing the upgrade. + +These should at best be considered temporary workarounds, because +there are around 50 releases that have been made since 7.1.3. All but +a handful of those releases (namely 7.2.0, 7.3.0, 7.4.0, 8.0.0, and +8.1.0) were created because of discovering "eat your data" problems of +one variety or another. +--=20 +http://www3.sympatico.ca/cbbrowne/linux.html +Oddly enough, this is completely standard behaviour for shells. This +is a roundabout way of saying `don't use combined chains of `&&'s and +`||'s unless you think G=F6del's theorem is for sissies'. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 13:25:52 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 459B39FD055 + for ; + Mon, 28 Aug 2006 13:25:52 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 26496-01 for + ; + Mon, 28 Aug 2006 16:25:42 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from exchange.g2switchworks.com (mail.g2switchworks.com + [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id ED7049FD054 + for ; + Mon, 28 Aug 2006 13:25:41 -0300 (ADT) +Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com + ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; + Mon, 28 Aug 2006 16:25:41 +0000 +Received: from state.g2switchworks.com by mail.g2switchworks.com; + 28 Aug 2006 11:25:41 -0500 +Subject: Re: perf pb solved only after pg_dump and restore +From: Scott Marlowe +To: Guillaume Cottenceau +Cc: Markus Schaber , pgsql-performance@postgresql.org +In-Reply-To: <87ac5px98h.fsf@meuh.mnc.lan> +References: <8764gd1dkz.fsf@meuh.mnc.lan> <44F2B737.7070301@logix-tt.com> + <87sljhyz4b.fsf@meuh.mnc.lan> + <1d4e0c10608280317i4eb9d7d0r2b397845ffb8c19d@mail.gmail.com> + <874pvxyrbg.fsf@meuh.mnc.lan> <44F2EC0C.7090407@logix-tt.com> + <87ac5px98h.fsf@meuh.mnc.lan> +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Message-Id: <1156782340.10490.9.camel@state.g2switchworks.com> +Mime-Version: 1.0 +X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) +Date: Mon, 28 Aug 2006 11:25:41 -0500 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/447 +X-Sequence-Number: 20632 + +On Mon, 2006-08-28 at 08:47, Guillaume Cottenceau wrote: +> Markus Schaber writes: +> +> > > VACUUM ANALYZE is normally run overnight (each night). Is it not +> > > regular enough? There can be hundreds of thousands of statements +> > > a day. +> > +> > Which PostgreSQL version are you using? Maybe you should consider +> > autovacuum (which is a contrib module at least since 7.4, and included +> > in the server since 8.1). If you think that vacuum during working hours +> > puts too much load on your server, there are options to tweak that, at +> > least in 8.1. +> +> Ok, thanks. Unfortunately production insists on sticking on 7.4.5 +> for the moment :/ + +There are known data loss bugs in that version. You should at least +make them update to 7.4.13. Running 7.4.5 instead of 7.4.13 is a bad +decision. Note that there is no need for migrating your data or any of +that with an update within the same major / minor version. As long as +the first two numbers don't change, it's a very simple and fast upgrade. + +NOT doing it is negligent. + +From pgsql-performance-owner@postgresql.org Mon Aug 28 16:47:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id F29589FD183 + for ; + Mon, 28 Aug 2006 16:47:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 87930-01 for + ; + Mon, 28 Aug 2006 16:47:19 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.195]) + by postgresql.org (Postfix) with ESMTP id 6BAC99FD19F + for ; + Mon, 28 Aug 2006 16:47:19 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so1270691nzn + for ; + Mon, 28 Aug 2006 12:47:18 -0700 (PDT) +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=QI++rP7WEdAEtZJVKyP2a3OzjAZxEnuul3wJMASjSG0k1JO7V0H7977qCRvipPmq0f+IjWJ4ati+bQJ1G59tpjr0hliELXGIHxxVZJBpL/GIq8i9V/fWnFNTvjWMqAdqkJXFehuL/ygWmifGpoucS5u1GWGkKbeiwMjGc/DV/TU= +Received: by 10.65.219.4 with SMTP id w4mr1863677qbq; + Mon, 28 Aug 2006 12:47:18 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Mon, 28 Aug 2006 12:47:18 -0700 (PDT) +Message-ID: +Date: Mon, 28 Aug 2006 15:47:18 -0400 +From: "Merlin Moncure" +To: "Christopher Browne" +Subject: Re: Postgre SQL 7.1 cygwin performance issue. +Cc: "Tom Lane" , + "Ravindran G - TLS, Chennai." , + pgsql-performance@postgresql.org, + "Isac Newton A - TLS, Chennai." +In-Reply-To: +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <012301731C23DE4DBFE035647C68F1CC03BE0092@sindhu.ctd.hcltech.com> + <20060828141959.GD27526@alvh.no-ip.org> + + <28299.1156778035@sss.pgh.pa.us> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.318 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/448 +X-Sequence-Number: 20633 + +On 8/28/06, Christopher Browne wrote: +> On 8/28/06, Tom Lane wrote: +> > "Christopher Browne" writes: +> > > On 8/28/06, Alvaro Herrera wrote: +> > >> There's no solution short of upgrading. +> > +> > > That's a little too negative. There is at least one alternative, +> > > possibly two... +> > +> > But both of those would probably involve work comparable to an upgrade. +> +> We don't know what is preventing the upgrade; we haven't been told +> anything about the details surrounding that. + +be sure and check out +http://archives.postgresql.org/pgsql-hackers/2006-08/msg00655.php. +(read the entire thread) moving off 7.1 is a great idea, but it may +or may not solve the connection the problem (its windows) :). + +merlin + +From pgsql-performance-owner@postgresql.org Mon Aug 28 20:06:56 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4EAED9FD2D2 + for ; + Mon, 28 Aug 2006 20:06:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 37304-08 for + ; + Mon, 28 Aug 2006 23:06:52 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) + by postgresql.org (Postfix) with ESMTP id EA48D9FD2D0 + for ; + Mon, 28 Aug 2006 20:06:51 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so1776500ugc + for ; + Mon, 28 Aug 2006 16:06:50 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:to:subject:mime-version:content-type; + b=SlZp50iBgqDXPHwGUTXoFoBuhJ6hnzM0HhcBWcxDHwjAmV38L6qKWcw1D6SB3F52xH5tcM+OF3rEPKF/sH3WEvQqrn2rHM359/LKviC8PtnlVgTbUFP8M7BGnMohOWYLnZ5D8et6lhfXfENjlae0qnEAdMCuOBRmIqcqGzzRDgw= +Received: by 10.66.220.17 with SMTP id s17mr4061823ugg; + Mon, 28 Aug 2006 16:06:50 -0700 (PDT) +Received: by 10.67.31.16 with HTTP; Mon, 28 Aug 2006 16:06:50 -0700 (PDT) +Message-ID: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> +Date: Mon, 28 Aug 2006 16:06:50 -0700 +From: "Junaili Lie" +To: pgsql-performance@postgresql.org +Subject: slow i/o +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_30480_31795423.1156806410252" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.995 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_00_10, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/449 +X-Sequence-Number: 20634 + +------=_Part_30480_31795423.1156806410252 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hi everyone, +We have a postgresql 8.1 installed on Solaris 10. It is running fine. +However, for the past couple days, we have seen the i/o reports indicating +that the i/o is busy most of the time. Before this, we only saw i/o being +busy occasionally (very rare). So far, there has been no performance +complaints by customers, and the slow query reports doesn't indicate +anything out of the ordinary. +There's no code changes on the applications layer and no database +configuration changes. +I am wondering if there's a tool out there on Solaris to tell which process +is doing most of the i/o activity? +Thank you in advance. + +J + +------=_Part_30480_31795423.1156806410252 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hi everyone,
+We have a postgresql 8.1 installed on Solaris 10. It is running fine. +However, for the past couple days, we have seen the i/o reports +indicating that the i/o is busy most of the time. Before this, we only +saw i/o being busy occasionally (very rare). So far, there has been no +performance complaints by customers, and the slow query reports doesn't +indicate anything out of the ordinary.
+There's no code changes on the applications layer and no database configuration changes.
+I am wondering if there's a tool out there on Solaris to tell which process is doing most of the i/o activity?
+Thank you in advance.
+
+J
+
+ +------=_Part_30480_31795423.1156806410252-- + +From pgsql-performance-owner@postgresql.org Tue Aug 29 03:35:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id BCAF19FB1F4 + for ; + Tue, 29 Aug 2006 03:35:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 54409-09 for + ; + Tue, 29 Aug 2006 06:35:26 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nf-out-0910.google.com (nf-out-0910.google.com + [64.233.182.184]) + by postgresql.org (Postfix) with ESMTP id 08CE49FB1EE + for ; + Tue, 29 Aug 2006 03:35:25 -0300 (ADT) +Received: by nf-out-0910.google.com with SMTP id m18so27298nfc + for ; + Mon, 28 Aug 2006 23:35:24 -0700 (PDT) +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=JPSiI97QmOUc9T2zx7X0AkFl9MgW8oIK80i+6iGw3Ap6O0DsmUVYifgk7lQ45Loga3v1i8vYe5qLd45ZfeQeRxLm5ZE3DDHXx0M/HAczhN3ruWlj5jdVUKgBs9H19hp6mvO1eOYxEXPCgU55nx5yFoFpK34eb/DY1AUgO/YpXyA= +Received: by 10.49.41.18 with SMTP id t18mr609527nfj; + Mon, 28 Aug 2006 23:35:23 -0700 (PDT) +Received: by 10.48.213.13 with HTTP; Mon, 28 Aug 2006 23:35:23 -0700 (PDT) +Message-ID: +Date: Tue, 29 Aug 2006 07:35:23 +0100 +From: "Peter Childs" +To: pgsql-performance@postgresql.org +Subject: Re: Identifying bloated tables +In-Reply-To: <44F31218.6040703@mall.cz> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44F30022.1000009@mall.cz> <44F31088.5040602@logix-tt.com> + <44F31218.6040703@mall.cz> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/450 +X-Sequence-Number: 20635 + +On 28/08/06, Michal Taborsky - Internet Mall wrote: +> Markus Schaber napsal(a): +> > Hi, Michal, +> > +> > Michal Taborsky - Internet Mall wrote: +> > +> >> When using this view, you are interested in tables, which have the +> >> "bloat" column higher that say 2.0 (in freshly dump/restored/analyzed +> >> database they should all be around 1.0). +> > +> > I just noticed some columns in pg_catalog with a bloat value <1 and a +> > negative "wasted space" - is this due to the pseudo nature of them? +> +> It is more likely due to the fact, that these numbers are just +> estimates, based on collected table statistics, so for small or +> non-standard tables the statistical error is greater that the actual +> value. You are usually not interested in tables, which have wasted space +> of 1000kB or -1000kB. Also the database must be ANALYZEd properly for +> these numbers to carry any significance. +> + +I was just playing around with this table and noticed it preforms the +badly in tables with very small record sizes. This seams to be because +it ignores the system overhead (oid, xmin ctid etc) which seams to be +about 28 bytes per a record this can be quite significate in small +record tables and can cause trouble even with a smal numbers of +record. Hence I've got a table thats static and fresly "vacuum full" +which reads with a bloat of 4. + +Easy to recreate problem to + +Create table regionpostcode (area varchar(4), regionid int); + +then insert 120000 records. + +Peter. + +From pgsql-performance-owner@postgresql.org Tue Aug 29 04:21:38 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 124D09FB1F9 + for ; + Tue, 29 Aug 2006 04:21:38 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 38911-02 for + ; + Tue, 29 Aug 2006 04:21:29 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.194]) + by postgresql.org (Postfix) with ESMTP id 3830C9FB1F8 + for ; + Tue, 29 Aug 2006 04:21:29 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so1396701nzn + for ; + Tue, 29 Aug 2006 00:21:28 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:message-id:date:from:to:subject:mime-version:content-type; + b=DSAOatuYX86RXWNlyiJqtuJEwH/waeDfgoakrhN4yVnmsKyI0X/MD0YnWpb70PhCvrf8XyYb7re+d4hWMIPpOe9O4EIj+RqlWLST+7V28sDNhyCwo5gnqVgQ7TF0HTro6YOMCjUF+faWlf2vMjanDnqOOLcLhBCPQ3FKx6MLNX4= +Received: by 10.64.249.18 with SMTP id w18mr8041746qbh; + Tue, 29 Aug 2006 00:21:28 -0700 (PDT) +Received: by 10.64.179.13 with HTTP; Tue, 29 Aug 2006 00:21:27 -0700 (PDT) +Message-ID: +Date: Tue, 29 Aug 2006 12:51:27 +0530 +From: "Vanitha Jaya" +To: pgsql-performance@postgresql.org +Subject: Internal Operations on LIMIT & OFFSET clause +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_2910_23421601.1156836087809" +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.574 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/451 +X-Sequence-Number: 20636 + +------=_Part_2910_23421601.1156836087809 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hi Friends, + + I have one doubt in LIMIT & OFFSET clause operation. +I have a table "test_limit", and it contain, + +SELECT * from test_limit; + s_no | name +------+------------- + 1 | anbarasu + 8 | egambaram + 12 | jyothi + 6 | mahalakshmi + 4 | maheswari + 2 | manju + 5 | ramkumar + 7 | sangeetha + 11 | sasikala + 10 | thekkamalai + 9 | vivek + 13 | ganeshwari + 3 | anandhi +(13 rows) + +Here, I applied LIMIT clause as bellow. +SELECT * from test_limit LIMIT 5; + s_no | name +------+------------- + 1 | anbarasu + 8 | egambaram + 12 | jyothi + 6 | mahalakshmi + 4 | maheswari +(5 rows) + +In this above query was processed only five records OR all the 13 record +was got and then only 5 record printed. +this is what my doubt. + +I tried where clause in above query as bellow. +SELECT * from test_limit where s_no IN (1,2,3,4,5,6,7,8,9) LIMIT 5; + s_no | name +------+------------- + 1 | anbarasu + 8 | egambaram + 6 | mahalakshmi + 4 | maheswari + 2 | manju +(5 rows) + +In this case It should process up to records fulfill the requirement. +i.e atleast it should process 6 records. +My question is it is processed only 6 records (fulfill the requirement) or +all (13) the records. + +I also tried ORDER BY clause as bellow. +SELECT * from test_limit ORDER BY s_no LIMIT 5; + s_no | name +------+----------- + 1 | anbarasu + 2 | manju + 3 | anandhi + 4 | maheswari + 5 | ramkumar +(5 rows) + + From this output, I know it is processed all(13) the records and the printed +only 5 records. +But, without ORDER BY clause I don't know how many record processing when +applying LIMIT clause. + +--- +Vanitha Jaya + +------=_Part_2910_23421601.1156836087809 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hi Friends,
+
+        I have one doubt in LIMIT & OFFSET clause operation.
+I have a table "test_limit",  and it contain,
+
SELECT * from test_limit;
+ s_no |    name
+------+-------------
+    1 | anbarasu
+    8 | egambaram
+   12 | jyothi
+    6 | mahalakshmi
+    4 | maheswari
+    2 | manju
+    5 | ramkumar
+    7 | sangeetha
+   11 | sasikala
+   10 | thekkamalai
+    9 | vivek
+   13 | ganeshwari
+    3 | anandhi
+(13 rows)
+
+Here, I applied LIMIT clause as bellow.
+SELECT * from test_limit LIMIT 5;
+ s_no |    name
+------+-------------
+    1 | anbarasu
+    8 | egambaram
+   12 | jyothi
+    6 | mahalakshmi
+    4 | maheswari
+(5 rows)
+
+In this above query was processed only five records  OR all the 13 record was got and then only 5 record printed.
+this is what my doubt.
+
+I tried where clause in above query as bellow.
+SELECT * from test_limit where s_no IN (1,2,3,4,5,6,7,8,9) LIMIT 5;
+ s_no |    name
+------+-------------
+    1 | anbarasu
+    8 | egambaram
+    6 | mahalakshmi
+    4 | maheswari
+    2 | manju
+(5 rows)
+
+In this case It should process up to  records fulfill the requirement.
+i.e  atleast it should process 6 records.
+My question is it is processed only 6 records (fulfill the requirement) or all (13) the records.
+
+I also tried ORDER BY clause as bellow.
+SELECT * from test_limit ORDER BY s_no LIMIT 5;
+ s_no |   name
+------+-----------
+    1 | anbarasu
+    2 | manju
+    3 | anandhi
+    4 | maheswari
+    5 | ramkumar
+(5 rows)
+
+ From this output, I know it is processed all(13) the records and the printed only 5 records.
+But, without ORDER BY clause I don't know how many record processing when applying LIMIT clause.
+
+---
Vanitha Jaya + +------=_Part_2910_23421601.1156836087809-- + +From pgsql-performance-owner@postgresql.org Tue Aug 29 04:38:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id DE9079FB1FC + for ; + Tue, 29 Aug 2006 04:38:27 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 37364-06 for + ; + Tue, 29 Aug 2006 04:38:13 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from moutng.kundenserver.de (moutng.kundenserver.de + [212.227.126.177]) + by postgresql.org (Postfix) with ESMTP id 75D149FB1F9 + for ; + Tue, 29 Aug 2006 04:38:13 -0300 (ADT) +Received: from [194.25.154.138] (helo=webserv.wug.de) + by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), + id 0MKxQS-1GHyAm0DVZ-0005ke; Tue, 29 Aug 2006 09:38:12 +0200 +Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) + id 1GHyAl-0007v9-00 + for pgsql-performance@postgresql.org; Tue, 29 Aug 2006 09:38:11 +0200 +Date: Tue, 29 Aug 2006 09:38:11 +0200 +From: "A. Kretschmer" +To: pgsql-performance@postgresql.org +Subject: Re: Internal Operations on LIMIT & OFFSET clause +Message-ID: <20060829073811.GA28883@localhost.localdomain> +References: +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: +User-Agent: Mutt/1.5.9i +X-Provags-ID: kundenserver.de abuse@kundenserver.de + login:51ea9561fc3f6d9539a2acd743e4748c +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.749 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/452 +X-Sequence-Number: 20637 + +am Tue, dem 29.08.2006, um 12:51:27 +0530 mailte Vanitha Jaya folgendes: +> Hi Friends, +> +> I have one doubt in LIMIT & OFFSET clause operation. +> I have a table "test_limit", and it contain, + +First of all, you can use EXPLAIN ANALYSE for such tasks! + +test=*# explain analyse select * from mira limit 13; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Limit (cost=0.00..0.20 rows=13 width=12) (actual time=0.073..0.146 rows=13 loops=1) + -> Seq Scan on mira (cost=0.00..2311.00 rows=150000 width=12) (actual time=0.068..0.097 rows=13 loops=1) + Total runtime: 0.223 ms +(3 rows) + +This is a Seq-Scan for the first 13 records. The table contains 15.000 records. + +> +> I also tried ORDER BY clause as bellow. +> SELECT * from test_limit ORDER BY s_no LIMIT 5; + +test=*# explain analyse select * from mira order by 1 limit 13; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- + Limit (cost=17263.70..17263.73 rows=13 width=12) (actual time=1149.554..1149.624 rows=13 loops=1) + -> Sort (cost=17263.70..17638.70 rows=150000 width=12) (actual time=1149.548..1149.574 rows=13 loops=1) + Sort Key: x + -> Seq Scan on mira (cost=0.00..2311.00 rows=150000 width=12) (actual time=0.013..362.187 rows=150000 loops=1) + Total runtime: 1153.545 ms +(5 rows) + +This is a komplete seq-scan, than the sort, then the limit. + + +> But, without ORDER BY clause I don't know how many record processing when +> applying LIMIT clause. + +Here, with 8.1, it processed only LIMIT records, see my example and notice the +runtime (0.223 ms versus 1153.545 ms). + + +HTH, Andreas +-- +Andreas Kretschmer +Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) +GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net + +From pgsql-performance-owner@postgresql.org Tue Aug 29 11:10:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id ED52A9FB27C + for ; + Tue, 29 Aug 2006 11:10:27 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 41643-08 for + ; + Tue, 29 Aug 2006 11:10:03 -0300 (ADT) +X-Greylist: delayed 00:16:47.733013 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 5918B9FB258 + for ; + Tue, 29 Aug 2006 11:09:55 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from relay03.is.co.za (relay03.is.co.za [196.35.6.71]) + by svr4.postgresql.org (Postfix) with ESMTP id 409405AF8D9 + for ; + Tue, 29 Aug 2006 13:53:04 +0000 (GMT) +Received: from relay03.is.co.za (localhost [127.0.0.1]) + by relay03.is.co.za (Postfix) with ESMTP id F22CE314FDC + for ; + Tue, 29 Aug 2006 15:53:00 +0200 (SAST) +Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) + by relay03.is.co.za (Postfix) with ESMTP id D8786314FA9 + for ; + Tue, 29 Aug 2006 15:53:00 +0200 (SAST) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp02.isdsl.net (Postfix) with ESMTP id 1F8792E15F + for ; + Tue, 29 Aug 2006 15:52:59 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Tue, 29 Aug 2006 15:56:43 +0200 +Message-ID: <44F446B2.2090900@studentvillage.co.za> +Date: Tue, 29 Aug 2006 15:52:50 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: pgsql-performance@postgresql.org +Subject: PostgreSQL performance issues +Content-Type: multipart/alternative; + boundary="------------080008020200000500000601" +X-OriginalArrivalTime: 29 Aug 2006 13:56:44.0046 (UTC) + FILETIME=[F5FEBAE0:01C6CB72] +X-Virus-Scanned: ClamAV using ClamSMTP at relay03.dial-up.net +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.27 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, + HTML_50_60, HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/453 +X-Sequence-Number: 20638 + +This is a multi-part message in MIME format. +--------------080008020200000500000601 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit + +Hi, + +We're running PostgreSQL 8.1.4 on CentOS 4 (Linux version +2.6.9-34.0.1.ELsmp). Hardware specs: + +2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 Cache Socket 940 +4 GB Registered ECC PC3200 DDR RAM +SuperMicro Server-Class 1U AS1020S series system +Dual-channel Ultra320 SCSI controller +1 x 73 GB 10,000rpm Ultra320 SCSI drive with 8MB cache + +I use it to drive a web application. Everything was working fine when +all of a sudden today, things went belly up. Load on the server started +increasing and query speeds decreased rapidly. After dropping all the +clients I did some quick tests and found the following: + +I have a log table looking like this: + Table "public.log" + Column | Type | Modifiers +---------+-----------------------------+--------------------------------- + site | bigint | not null + stamp | timestamp without time zone | default now() + type | character(8) | not null default 'log'::bpchar + user | text | not null default 'public'::text + message | text | +Indexes: + "fki_log_sites" btree (site) + "ix_log_stamp" btree (stamp) + "ix_log_type" btree ("type") + "ix_log_user" btree ("user") +Foreign-key constraints: + "log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE +CASCADE ON DELETE CASCADE + +and it has 743321 rows and a explain analyze select count(*) from +property_values; + QUERY +PLAN +---------------------------------------------------------------------------------------------------------------------------------- + Aggregate (cost=55121.95..55121.96 rows=1 width=0) (actual +time=4557.797..4557.798 rows=1 loops=1) + -> Seq Scan on property_values (cost=0.00..51848.56 rows=1309356 +width=0) (actual time=0.026..2581.418 rows=1309498 loops=1) + Total runtime: 4557.978 ms +(3 rows) + +4 1/2 seconds for a count(*) ? This seems a bit rough - is there +anything else I can try to optimize my Database? You can imagine that +slightly more complex queries goes out the roof. + +Any help appreciated + +Regards + +Willo van der Merwe + +--------------080008020200000500000601 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit + + + + + + + +Hi,
+
+We're running PostgreSQL 8.1.4 on CentOS 4 (Linux version +2.6.9-34.0.1.ELsmp). Hardware specs:
+
+
2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 Cache Socket 940
+4 GB Registered ECC PC3200 DDR RAM
+SuperMicro Server-Class 1U AS1020S series system
+Dual-channel Ultra320 SCSI controller
+1 x 73 GB 10,000rpm Ultra320 SCSI drive with 8MB cache
+I use it to drive a web +application. Everything +was working fine when all of a sudden today, things went belly up. Load +on the server started increasing and query speeds decreased rapidly. +After dropping all the clients I did some quick tests and found the +following:
+
+I have a log table looking like this:
+                           +Table "public.log"
+ Column  |            Type             |            Modifiers
+---------+-----------------------------+---------------------------------
+ site    | bigint                      | not null
+ stamp   | timestamp without time zone | default now()
+ type    | character(8)                | not null default 'log'::bpchar
+ user    | text                        | not null default 'public'::text
+ message | text                        |
+Indexes:
+    "fki_log_sites" btree (site)
+    "ix_log_stamp" btree (stamp)
+    "ix_log_type" btree ("type")
+    "ix_log_user" btree ("user")
+Foreign-key constraints:
+    "log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE +CASCADE ON DELETE CASCADE
+

+and it has 743321 rows and a explain analyze select count(*) from +property_values;
+                                                            QUERY +PLAN                                                       
+----------------------------------------------------------------------------------------------------------------------------------
+ Aggregate  (cost=55121.95..55121.96 rows=1 width=0) (actual +time=4557.797..4557.798 rows=1 loops=1)
+   ->  Seq Scan on property_values  (cost=0.00..51848.56 +rows=1309356 width=0) (actual time=0.026..2581.418 rows=1309498 loops=1)
+ Total runtime: 4557.978 ms
+(3 rows)
+
+4 1/2 seconds for a count(*) ? This seems a bit rough - is there +anything else I can try to optimize my Database? You can imagine that +slightly more complex queries goes out the roof.
+
+Any help appreciated
+
+Regards
+
+Willo van der Merwe
+
+ + + +--------------080008020200000500000601-- + +From pgsql-performance-owner@postgresql.org Tue Aug 29 11:46:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4678B9FB24B + for ; + Tue, 29 Aug 2006 11:46:55 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 25333-04 for + ; + Tue, 29 Aug 2006 14:46:42 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from moutng.kundenserver.de (moutng.kundenserver.de + [212.227.126.177]) + by postgresql.org (Postfix) with ESMTP id CF7FC9FB227 + for ; + Tue, 29 Aug 2006 11:46:39 -0300 (ADT) +Received: from [194.25.154.138] (helo=webserv.wug.de) + by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), + id 0ML21M-1GI4rN38IN-0002fP; Tue, 29 Aug 2006 16:46:38 +0200 +Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) + id 1GI4rM-0001sX-00 + for pgsql-performance@postgresql.org; Tue, 29 Aug 2006 16:46:36 +0200 +Date: Tue, 29 Aug 2006 16:46:36 +0200 +From: "A. Kretschmer" +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +Message-ID: <20060829144636.GA6796@localhost.localdomain> +References: <44F446B2.2090900@studentvillage.co.za> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44F446B2.2090900@studentvillage.co.za> +User-Agent: Mutt/1.5.9i +X-Provags-ID: kundenserver.de abuse@kundenserver.de + login:51ea9561fc3f6d9539a2acd743e4748c +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/454 +X-Sequence-Number: 20639 + +am Tue, dem 29.08.2006, um 15:52:50 +0200 mailte Willo van der Merwe folgendes: +> and it has 743321 rows and a explain analyze select count(*) from +> property_values; +> QUERY +> PLAN +> ---------------------------------------------------------------------------------------------------------------------------------- +> Aggregate (cost=55121.95..55121.96 rows=1 width=0) (actual time= +> 4557.797..4557.798 rows=1 loops=1) +> -> Seq Scan on property_values (cost=0.00..51848.56 rows=1309356 width=0) +> (actual time=0.026..2581.418 rows=1309498 loops=1) +> Total runtime: 4557.978 ms +> (3 rows) +> +> 4 1/2 seconds for a count(*) ? This seems a bit rough - is there anything else + +Because of MVCC. +http://www.thescripts.com/forum/thread173678.html +http://www.varlena.com/GeneralBits/120.php +http://www.varlena.com/GeneralBits/49.php + + +Andreas +-- +Andreas Kretschmer +Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) +GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net + +From pgsql-performance-owner@postgresql.org Tue Aug 29 11:52:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id A17619FB22E + for ; + Tue, 29 Aug 2006 11:52:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 27758-05 for + ; + Tue, 29 Aug 2006 14:51:42 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from lists.commandprompt.com (host-130.commandprompt.net + [207.173.203.130]) + by postgresql.org (Postfix) with ESMTP id 59FDE9FB256 + for ; + Tue, 29 Aug 2006 11:51:42 -0300 (ADT) +Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net + [67.76.146.141]) (authenticated bits=0) + by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k7TEpfBt005503 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); + Tue, 29 Aug 2006 07:51:42 -0700 +Message-ID: <44F45486.1070007@commandprompt.com> +Date: Tue, 29 Aug 2006 07:51:50 -0700 +From: "Joshua D. Drake" +Organization: Command Prompt, Inc. +User-Agent: Thunderbird 1.5.0.5 (X11/20060728) +MIME-Version: 1.0 +To: Willo van der Merwe +CC: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <44F446B2.2090900@studentvillage.co.za> +In-Reply-To: <44F446B2.2090900@studentvillage.co.za> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: ClamAV version 0.88.3, + clamav-milter version 0.88.3 on projects.commandprompt.com +X-Virus-Status: Clean +X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by + milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); + Tue, 29 Aug 2006 07:51:42 -0700 (PDT) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/455 +X-Sequence-Number: 20640 + + +> 4 1/2 seconds for a count(*) ? This seems a bit rough - is there +> anything else I can try to optimize my Database? You can imagine that +> slightly more complex queries goes out the roof. + +Well a couple of things. + +1. You put all your money in the wrong place.. 1 hard drive!!??!! +2. What is your maintenance regimen? Vacuum, Analyze???? + +Joshua D. Drake + +> +> Any help appreciated +> +> Regards +> +> Willo van der Merwe +> + + +-- + + === The PostgreSQL Company: Command Prompt, Inc. === +Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 + Providing the most comprehensive PostgreSQL solutions since 1997 + http://www.commandprompt.com/ + + + +From pgsql-performance-owner@postgresql.org Tue Aug 29 12:04:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 39BA89FB257 + for ; + Tue, 29 Aug 2006 12:04:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 90845-07 for + ; + Tue, 29 Aug 2006 12:03:48 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from brmea-mail-4.sun.com (brmea-mail-4.Sun.COM [192.18.98.36]) + by postgresql.org (Postfix) with ESMTP id C6E319FB22E + for ; + Tue, 29 Aug 2006 12:03:40 -0300 (ADT) +Received: from fe-amer-03.sun.com ([192.18.108.177]) + by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id + k7TF3eUx015903 for ; + Tue, 29 Aug 2006 09:03:40 -0600 (MDT) +Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com + (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) + id <0J4R00B01LKPD500@mail-amer.sun.com> (original mail from + J.K.Shah@Sun.COM) for pgsql-performance@postgresql.org; + Tue, 29 Aug 2006 09:03:40 -0600 (MDT) +Received: from [129.156.85.92] by mail-amer.sun.com + (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) + with ESMTPSA id <0J4R00LYLLU3STW6@mail-amer.sun.com>; Tue, + 29 Aug 2006 09:03:40 -0600 (MDT) +Date: Tue, 29 Aug 2006 16:03:38 +0100 +From: "Jignesh K. Shah" +Subject: Re: slow i/o +In-reply-to: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> +To: Junaili Lie +Cc: pgsql-performance@postgresql.org +Message-id: <44F4574A.3040705@sun.com> +MIME-version: 1.0 +Content-type: text/plain; format=flowed; charset=ISO-8859-1 +Content-transfer-encoding: 7BIT +X-Accept-Language: en-us, en +References: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> +User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050322) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, + hits=0.001 tagged_above=0 required=5 tests=UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/456 +X-Sequence-Number: 20641 + +Did you increase the checkpoint segments and changed the default WAL lock method to fdsync? + +http://blogs.sun.com/jkshah/entry/postgresql_on_solaris_better_use + +Try fdsync instead of fysnc as mentioned in the entry. + +Regards, +Jignesh + + +Junaili Lie wrote: +> Hi everyone, +> We have a postgresql 8.1 installed on Solaris 10. It is running fine. +> However, for the past couple days, we have seen the i/o reports +> indicating that the i/o is busy most of the time. Before this, we only +> saw i/o being busy occasionally (very rare). So far, there has been no +> performance complaints by customers, and the slow query reports doesn't +> indicate anything out of the ordinary. +> There's no code changes on the applications layer and no database +> configuration changes. +> I am wondering if there's a tool out there on Solaris to tell which +> process is doing most of the i/o activity? +> Thank you in advance. +> +> J +> + +From pgsql-performance-owner@postgresql.org Tue Aug 29 12:06:21 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 81CD59FB215 + for ; + Tue, 29 Aug 2006 12:06:20 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 88098-07 for + ; + Tue, 29 Aug 2006 12:06:16 -0300 (ADT) +X-Greylist: delayed 01:13:19.474725 by SQLgrey- +Received: from relay01.is.co.za (relay01.is.co.za [196.35.6.69]) + by postgresql.org (Postfix) with ESMTP id 7681A9FB253 + for ; + Tue, 29 Aug 2006 12:06:11 -0300 (ADT) +Received: from relay01.is.co.za (localhost [127.0.0.1]) + by relay01.is.co.za (Postfix) with ESMTP id 15CE731470C + for ; + Tue, 29 Aug 2006 17:06:10 +0200 (SAST) +Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) + by relay01.is.co.za (Postfix) with ESMTP id F17553146CA + for ; + Tue, 29 Aug 2006 17:06:09 +0200 (SAST) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp02.isdsl.net (Postfix) with ESMTP id B68002E083 + for ; + Tue, 29 Aug 2006 17:06:09 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Tue, 29 Aug 2006 17:09:57 +0200 +Message-ID: <44F457DA.7060200@studentvillage.co.za> +Date: Tue, 29 Aug 2006 17:06:02 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: "Joshua D. Drake" +Cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <44F446B2.2090900@studentvillage.co.za> + <000701c6cb7c$0027a820$0a00a8c0@svo.co.za> +In-Reply-To: <000701c6cb7c$0027a820$0a00a8c0@svo.co.za> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 29 Aug 2006 15:09:57.0312 (UTC) + FILETIME=[3095EC00:01C6CB7D] +X-Virus-Scanned: ClamAV using ClamSMTP at relay01.dial-up.net +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.95 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, ROUND_THE_WORLD +X-Spam-Level: +X-Archive-Number: 200608/457 +X-Sequence-Number: 20642 + +Joshua D. Drake wrote: +> +>> 4 1/2 seconds for a count(*) ? This seems a bit rough - is there +>> anything else I can try to optimize my Database? You can imagine that +>> slightly more complex queries goes out the roof. +> +> Well a couple of things. +> +> 1. You put all your money in the wrong place.. 1 hard drive!!??!! +Yes, I realize 1 hard drive could cause a bottle neck, but on average +I'm sitting on a 1-2% wait for IO. +> 2. What is your maintenance regimen? Vacuum, Analyze???? +I'm doing a daily VACUUM ANALYZE, but just to be on the safe side, I +performed one manually before I ran my test, thinking that I might have +to up the frequency. +> +> Joshua D. Drake +> +>> +>> Any help appreciated +>> +>> Regards +>> +>> Willo van der Merwe +>> +> +> + + +From pgsql-performance-owner@postgresql.org Tue Aug 29 12:13:10 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 4A6DA9FB261 + for ; + Tue, 29 Aug 2006 12:13:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 98892-08 for + ; + Tue, 29 Aug 2006 12:12:52 -0300 (ADT) +X-Greylist: delayed 00:06:38.628924 by SQLgrey- +Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) + by postgresql.org (Postfix) with ESMTP id 61FC39FB25A + for ; + Tue, 29 Aug 2006 12:12:45 -0300 (ADT) +Received: (qmail 31137 invoked from network); 29 Aug 2006 17:07:11 +0200 +Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) + by boutiquenumerique.com with SMTP; 29 Aug 2006 17:07:11 +0200 +Date: Tue, 29 Aug 2006 17:07:10 +0200 +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +From: PFC +Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 +MIME-Version: 1.0 +References: <44F446B2.2090900@studentvillage.co.za> +Content-Transfer-Encoding: 7bit +Message-ID: +In-Reply-To: <44F446B2.2090900@studentvillage.co.za> +User-Agent: Opera Mail/9.00 (Linux) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/459 +X-Sequence-Number: 20644 + + +> 4 1/2 seconds for a count(*) ? + + Is this a real website query ? Do you need this query ? + + +From pgsql-performance-owner@postgresql.org Tue Aug 29 12:11:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 260589FB256 + for ; + Tue, 29 Aug 2006 12:11:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 90120-10 for + ; + Tue, 29 Aug 2006 12:11:05 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from brmea-mail-4.sun.com (brmea-mail-4.Sun.COM [192.18.98.36]) + by postgresql.org (Postfix) with ESMTP id 3A8BC9FB25A + for ; + Tue, 29 Aug 2006 12:10:58 -0300 (ADT) +Received: from fe-amer-06.sun.com ([192.18.108.180]) + by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id + k7TFAwru020923 for ; + Tue, 29 Aug 2006 09:10:58 -0600 (MDT) +Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com + (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) + id <0J4R00D01LQRCN00@mail-amer.sun.com> (original mail from + J.K.Shah@Sun.COM) for pgsql-performance@postgresql.org; + Tue, 29 Aug 2006 09:10:58 -0600 (MDT) +Received: from [129.156.85.92] by mail-amer.sun.com + (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) + with ESMTPSA id <0J4R001CUM68HQC3@mail-amer.sun.com>; Tue, + 29 Aug 2006 09:10:58 -0600 (MDT) +Date: Tue, 29 Aug 2006 16:10:56 +0100 +From: "Jignesh K. Shah" +Subject: Re: slow i/o +In-reply-to: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> +To: Junaili Lie +Cc: pgsql-performance@postgresql.org +Message-id: <44F45900.4000702@sun.com> +MIME-version: 1.0 +Content-type: text/plain; format=flowed; charset=ISO-8859-1 +Content-transfer-encoding: 7BIT +X-Accept-Language: en-us, en +References: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> +User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050322) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/458 +X-Sequence-Number: 20643 + +Also to answer your real question: + +DTrace On Solaris 10: + +# dtrace -s /usr/demo/dtrace/whoio.d + +It will tell you the pids doing the io activity and on which devices. +There are more scripts in that directory like iosnoop.d, iotime.d and others which also will give +other details like file accessed, time it took for the io etc. + +Hope this helps. + +Regards, +Jignesh + + +Junaili Lie wrote: +> Hi everyone, +> We have a postgresql 8.1 installed on Solaris 10. It is running fine. +> However, for the past couple days, we have seen the i/o reports +> indicating that the i/o is busy most of the time. Before this, we only +> saw i/o being busy occasionally (very rare). So far, there has been no +> performance complaints by customers, and the slow query reports doesn't +> indicate anything out of the ordinary. +> There's no code changes on the applications layer and no database +> configuration changes. +> I am wondering if there's a tool out there on Solaris to tell which +> process is doing most of the i/o activity? +> Thank you in advance. +> +> J +> + +From pgsql-performance-owner@postgresql.org Tue Aug 29 12:16:13 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 21FB89FB263 + for ; + Tue, 29 Aug 2006 12:16:11 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 89497-09 for + ; + Tue, 29 Aug 2006 12:15:42 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from moutng.kundenserver.de (moutng.kundenserver.de + [212.227.126.171]) + by postgresql.org (Postfix) with ESMTP id 333899FB261 + for ; + Tue, 29 Aug 2006 12:15:39 -0300 (ADT) +Received: from [194.25.154.138] (helo=webserv.wug.de) + by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), + id 0MKwh2-1GI5JO0MXl-0003t0; Tue, 29 Aug 2006 17:15:34 +0200 +Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) + id 1GI5JN-0001zC-00; Tue, 29 Aug 2006 17:15:33 +0200 +Date: Tue, 29 Aug 2006 17:15:33 +0200 +From: "A. Kretschmer" +To: Willo van der Merwe , + pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +Message-ID: <20060829151533.GA7586@localhost.localdomain> +References: <44F446B2.2090900@studentvillage.co.za> + <20060829144636.GA6796@localhost.localdomain> + <44F4554F.40906@studentvillage.co.za> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <44F4554F.40906@studentvillage.co.za> +User-Agent: Mutt/1.5.9i +X-Provags-ID: kundenserver.de abuse@kundenserver.de + login:51ea9561fc3f6d9539a2acd743e4748c +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.705 tagged_above=0 required=5 tests=AWL, + SPF_HELO_PASS +X-Spam-Level: +X-Archive-Number: 200608/460 +X-Sequence-Number: 20645 + +am Tue, dem 29.08.2006, um 16:55:11 +0200 mailte Willo van der Merwe folgendes: +> >>4 1/2 seconds for a count(*) ? This seems a bit rough - is there anything +> >>else +> >> +> > +> >Because of MVCC. +> >http://www.thescripts.com/forum/thread173678.html +> >http://www.varlena.com/GeneralBits/120.php +> >http://www.varlena.com/GeneralBits/49.php +> > +> > +> >Andreas +> > +> Hi Andreas, +> +> Thanks for your prompt reply. I understand why this is a sequential +> scan, I'm just a bit perturbed that it takes 4.5 seconds to execute said +> scan. The table is only 750,000 records big. What happens when this +> table 7 million records big? Will this query then take 45 seconds to +> execute? + +How often do you need a 'select count(*) from big_table'? + +I assume, not frequently. And if you need realy this, you can write a +trigger or read the statistics for the table. + + +Andreas +-- +Andreas Kretschmer +Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) +GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net + +From pgsql-performance-owner@postgresql.org Tue Aug 29 18:36:31 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 18B189FB2D3 + for ; + Tue, 29 Aug 2006 18:36:31 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 97362-05 for + ; + Tue, 29 Aug 2006 18:31:59 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) + by postgresql.org (Postfix) with ESMTP id D08529FB2FB + for ; + Tue, 29 Aug 2006 14:56:51 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so2058107ugc + for ; + Tue, 29 Aug 2006 10:56:50 -0700 (PDT) +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:references; + b=ZjfEKkyQOho7qxqFl47xf/+dqpnXgHv4zv0GcBym8hw5rW2JEsYrXRWbVvVgJ3kDG/CFUCjow59RljYTcFHLDjtZpn/MOvi42kuZkTjsAeZ3+ZZfNuttGnKAfiNXwTbVm8OXtR1Tb4z8OxzQhlbJBBjTkAYEJAgWJV+h4cfDNkk= +Received: by 10.66.224.19 with SMTP id w19mr4731489ugg; + Tue, 29 Aug 2006 10:56:50 -0700 (PDT) +Received: by 10.67.31.16 with HTTP; Tue, 29 Aug 2006 10:56:50 -0700 (PDT) +Message-ID: <8d04ce990608291056la088194n84280509528a909d@mail.gmail.com> +Date: Tue, 29 Aug 2006 10:56:50 -0700 +From: "Junaili Lie" +To: "Jignesh K. Shah" +Subject: Re: slow i/o +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44F45900.4000702@sun.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_18706_22664600.1156874210443" +References: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> + <44F45900.4000702@sun.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=HTML_MESSAGE, + SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/461 +X-Sequence-Number: 20646 + +------=_Part_18706_22664600.1156874210443 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hi Jignesh, +Thank you for my reply. +I have the setting just like what you described: + +wal_sync_method = fsync +wal_buffers = 128 +checkpoint_segments = 128 +bgwriter_all_percent = 0 +bgwriter_maxpages = 0 + + +I ran the dtrace script and found the following: +During the i/o busy time, there are postgres processes that has very high +BYTES count. During that non i/o busy time, this same process doesn't do a +lot of i/o activity. I checked the pg_stat_activity but couldn't found this +process. Doing ps revealed that this process is started at the same time +since the postgres started, which leads me to believe that it maybe +background writer or some other internal process. This process are not +autovacuum because it doesn't disappear when I tried turning autovacuum +off. +Except for the ones mentioned above, I didn't modify the other background +setting: +MONSOON=# show bgwriter_delay ; + bgwriter_delay +---------------- + 200 +(1 row) + +MONSOON=# show bgwriter_lru_maxpages ; bgwriter_lru_maxpages +----------------------- + 5 +(1 row) + +MONSOON=# show bgwriter_lru_percent ; + bgwriter_lru_percent +---------------------- + 1 +(1 row) + +This i/o spike only happens at minute 1 and minute 6 (ie. 10.51, 10.56) . If +I do select * from pg_stat_activity during this time, I will see a lot of +write queries waiting to be processed. After a few seconds, everything seems +to be gone. All writes that are not happening at the time of this i/o jump +are being processed very fast, thus do not show on pg_stat_activity. + +Thanks in advance for the reply, +Best, + +J + +On 8/29/06, Jignesh K. Shah wrote: +> +> Also to answer your real question: +> +> DTrace On Solaris 10: +> +> # dtrace -s /usr/demo/dtrace/whoio.d +> +> It will tell you the pids doing the io activity and on which devices. +> There are more scripts in that directory like iosnoop.d, iotime.d and +> others which also will give +> other details like file accessed, time it took for the io etc. +> +> Hope this helps. +> +> Regards, +> Jignesh +> +> +> Junaili Lie wrote: +> > Hi everyone, +> > We have a postgresql 8.1 installed on Solaris 10. It is running fine. +> > However, for the past couple days, we have seen the i/o reports +> > indicating that the i/o is busy most of the time. Before this, we only +> > saw i/o being busy occasionally (very rare). So far, there has been no +> > performance complaints by customers, and the slow query reports doesn't +> > indicate anything out of the ordinary. +> > There's no code changes on the applications layer and no database +> > configuration changes. +> > I am wondering if there's a tool out there on Solaris to tell which +> > process is doing most of the i/o activity? +> > Thank you in advance. +> > +> > J +> > +> + +------=_Part_18706_22664600.1156874210443 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Hi Jignesh,
+Thank you for my reply.
+I have the setting just like what you described:
+
wal_sync_method = fsync
wal_buffers = 128
checkpoint_segments = 128
bgwriter_all_percent = 0
bgwriter_maxpages = 0
+
+I ran the dtrace script and found the following:
+During the i/o busy time, there are postgres processes that has very +high BYTES count. During that non i/o busy time, this same process +doesn't do a lot of i/o activity. I checked the pg_stat_activity but +couldn't found this process. Doing ps revealed that this process is +started at the same time since the postgres started, which leads me to +believe that it maybe background writer or some other internal process. + +This process are not autovacuum because it doesn't disappear when I  tried turning autovacuum off.
+Except for the ones mentioned above, I didn't modify the other background setting:
+ +MONSOON=# show bgwriter_delay ;
+ + bgwriter_delay
+ +----------------
+ + 200
+ +(1 row)
+ +
+ +MONSOON=# show bgwriter_lru_maxpages ;  bgwriter_lru_maxpages
+ +-----------------------
+ + 5
+ +(1 row)
+ +
+ +MONSOON=# show bgwriter_lru_percent ;
+ + bgwriter_lru_percent
+ +----------------------
+ + 1
+ +(1 row)
+
This +i/o spike only happens at minute 1 and minute 6 (ie. 10.51, 10.56) . If +I do select * from pg_stat_activity during this time, I will see a lot +of write queries waiting to be processed. After a few seconds, +everything seems to be gone. All writes that are not happening at the +time of this i/o jump are being processed very fast, thus do not show on pg_stat_activity.
+
+Thanks in advance for the reply,
+Best,
+
+J
+
On 8/29/06, Jignesh K. Shah <J.K.Shah@sun.com +> wrote:
+Also to answer your real question:

DTrace On Solaris 10:

# dtrace -s /usr/demo/dtrace/whoio.d

It will tell you the pids doing the io activity and  on which devices.
There are more scripts in that directory like +iosnoop.d, iotime.d and others which also will give
other details like file accessed, time it took for the io etc.

Hope this helps.

Regards,
Jignesh


Junaili Lie wrote:
> Hi everyone,
+ +> We have a postgresql 8.1 installed on Solaris 10. It is running fine.
> However, for the past couple days, we have seen the i/o reports
> indicating that the i/o is busy most of the time. Before this, we only +
> saw i/o being busy occasionally (very rare). So far, there has been no
> performance complaints by customers, and the slow query reports doesn't
> indicate anything out of the ordinary.
> There's no code changes on the applications layer and no database +
> configuration changes.
> I am wondering if there's a tool out there on Solaris to tell which
> process is doing most of the i/o activity?
> Thank you in advance.
>
> J
>
+ +

+ +------=_Part_18706_22664600.1156874210443-- + +From pgsql-performance-owner@postgresql.org Tue Aug 29 20:12:03 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 4AED09FB2F1 + for ; + Tue, 29 Aug 2006 20:12:02 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 87967-04-3 + for ; + Tue, 29 Aug 2006 23:11:51 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.infogears.com (mail.infogears.com [69.51.90.143]) + by postgresql.org (Postfix) with ESMTP id 648619FB3E6 + for ; + Tue, 29 Aug 2006 18:47:21 -0300 (ADT) +Received: from mail.infogears.com (localhost.localdomain [127.0.0.1]) + by mail.infogears.com (Postfix) with ESMTP id EAC4330980A3; + Tue, 29 Aug 2006 15:47:19 -0600 (MDT) +Received: from (HELO [69.51.88.19]) () + (smtp-auth username rconover, mechanism plain) + by mail.infogears.com (qpsmtpd/0.31-dev) with ESMTP; + Tue, 29 Aug 2006 15:47:19 -0600 +In-Reply-To: <44F446B2.2090900@studentvillage.co.za> +References: <44F446B2.2090900@studentvillage.co.za> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: multipart/alternative; boundary=Apple-Mail-103-339695047 +Message-Id: <9A079B52-0D1D-4682-A841-AA856439698E@infogears.com> +Cc: pgsql-performance@postgresql.org +From: Rusty Conover +Subject: Re: PostgreSQL performance issues +Date: Tue, 29 Aug 2006 15:47:17 -0600 +To: Willo van der Merwe +X-Mailer: Apple Mail (2.752.2) +X-Virus-Checked: Checked by ClamAV on mail.infogears.com +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/462 +X-Sequence-Number: 20647 + + +--Apple-Mail-103-339695047 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 29, 2006, at 7:52 AM, Willo van der Merwe wrote: + +> Hi, +> +> We're running PostgreSQL 8.1.4 on CentOS 4 (Linux version +> 2.6.9-34.0.1.ELsmp). Hardware specs: +> 2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 Cache Socket +> 940 +> 4 GB Registered ECC PC3200 DDR RAM +> SuperMicro Server-Class 1U AS1020S series system +> Dual-channel Ultra320 SCSI controller +> 1 x 73 GB 10,000rpm Ultra320 SCSI drive with 8MB cache +> I use it to drive a web application. Everything was working fine +> when all of a sudden today, things went belly up. Load on the +> server started increasing and query speeds decreased rapidly. After +> dropping all the clients I did some quick tests and found the +> following: +> +> I have a log table looking like this: +> Table "public.log" +> Column | Type | Modifiers +> ---------+----------------------------- +> +--------------------------------- +> site | bigint | not null +> stamp | timestamp without time zone | default now() +> type | character(8) | not null default +> 'log'::bpchar +> user | text | not null default +> 'public'::text +> message | text | +> Indexes: +> "fki_log_sites" btree (site) +> "ix_log_stamp" btree (stamp) +> "ix_log_type" btree ("type") +> "ix_log_user" btree ("user") +> Foreign-key constraints: +> "log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE +> CASCADE ON DELETE CASCADE +> +> and it has 743321 rows and a explain analyze select count(*) from +> property_values; +> QUERY PLAN +> ---------------------------------------------------------------------- +> ------------------------------------------------------------ +> Aggregate (cost=55121.95..55121.96 rows=1 width=0) (actual +> time=4557.797..4557.798 rows=1 loops=1) +> -> Seq Scan on property_values (cost=0.00..51848.56 +> rows=1309356 width=0) (actual time=0.026..2581.418 rows=1309498 +> loops=1) +> Total runtime: 4557.978 ms +> (3 rows) +> +> 4 1/2 seconds for a count(*) ? This seems a bit rough - is there +> anything else I can try to optimize my Database? You can imagine +> that slightly more complex queries goes out the roof. +> +> Any help appreciated +> +> Regards +> +> Willo van der Merwe + + +Hi, + +What about doing a little bit of normalization? + +With 700k rows you could probably gain some improvements by: + +* normalizing the type and user columns to integer keys (dropping the +8 byte overhead for storing the field lengths) +* maybe change the type column so that its a smallint if there is +just a small range of possible values (emulating a enum type in other +databases) rather the joining to another table. +* maybe move message (if the majority of the rows are big and not +null but not big enough to be TOASTed, ergo causing only a small +number of rows to fit onto a 8k page) out of this table into a +separate table that is joined only when you need the column's content. + +Doing these things would fit more rows onto each page, making the +scan less intensive by not causing the drive to seek as much. Of +course all of these suggestions depend on your workload. + +Cheers, + +Rusty +-- +Rusty Conover +InfoGears Inc. + + +--Apple-Mail-103-339695047 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; + charset=ISO-8859-1 + +
On Aug 29, 2006, = +at 7:52 AM, Willo van der Merwe wrote:

Hi,

We're running = +PostgreSQL 8.1.4 on CentOS 4 (Linux version 2.6.9-34.0.1.ELsmp). = +Hardware specs:
2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 =
+Cache Socket 940
+4 GB Registered ECC PC3200 DDR =
+RAM
+SuperMicro Server-Class 1U =
+AS1020S series system
+Dual-channel Ultra320 SCSI =
+controller
+1 x 73 GB 10,000rpm Ultra320 =
+SCSI drive with 8MB cache
I use it to drive a web application. Everything was working fine when = +all of a sudden today, things went belly up. Load on the server started = +increasing and query speeds decreased rapidly. After dropping all the = +clients I did some quick tests and found the following:

I have = +a log table looking like this:
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0 Table "public.log"
=A0Column=A0 = +|=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Type=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= + |=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Modifiers
= +---------+-----------------------------+---------------------------------<= +BR> =A0site=A0=A0=A0 | bigint=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0 | not null
=A0stamp=A0=A0 | timestamp without = +time zone | default now()
=A0type=A0=A0=A0 | = +character(8)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | not null = +default 'log'::bpchar
=A0user=A0=A0=A0 | text=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | not null default = +'public'::text
=A0message | text=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |
Indexes:
=A0=A0=A0 = +"fki_log_sites" btree (site)
=A0=A0=A0 "ix_log_stamp" btree = +(stamp)
=A0=A0=A0 "ix_log_type" btree ("type")
=A0=A0=A0 = +"ix_log_user" btree ("user")
Foreign-key constraints:
=A0=A0=A0 = +"log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE CASCADE ON = +DELETE CASCADE

and it has 743321 rows and a = +explain analyze select count(*) from property_values;
= +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0=A0 QUERY = +PLAN=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0
= +--------------------------------------------------------------------------= +--------------------------------------------------------
=A0Aggregate=A0= + (cost=3D55121.95..55121.96 rows=3D1 width=3D0) (actual = +time=3D4557.797..4557.798 rows=3D1 loops=3D1)
=A0=A0 ->=A0 Seq = +Scan on property_values=A0 (cost=3D0.00..51848.56 rows=3D1309356 = +width=3D0) (actual time=3D0.026..2581.418 rows=3D1309498 loops=3D1)
= +=A0Total runtime: 4557.978 ms
(3 rows)

4 1/2 seconds for a = +count(*) ? This seems a bit rough - is there anything else I can try to = +optimize my Database? You can imagine that slightly more complex queries = +goes out the roof.

Any help appreciated

Regards
= +
Willo van der Merwe


Hi,

What about doing a little = +bit of normalization?=A0

With 700k rows you could = +probably gain some improvements by:

*=A0normalizing the type = +and user columns to integer keys (dropping the 8 byte overhead for = +storing the field lengths)
* maybe change the type column so = +that its a smallint if there is just a small range of possible values = +(emulating a enum type in other databases) rather the joining to another = +table.
* maybe move message (if the majority of the rows are = +big and not null but not big enough to be TOASTed, ergo causing only a = +small number of rows to fit onto a 8k page) out of this table into = +a=A0separate table that is joined only when you need the column's = +content.

Doing = +these things would fit more rows onto each page, making the scan less = +intensive by not causing the drive to seek as much.=A0 Of course all of = +these suggestions depend on your workload.

Cheers,

Rusty
--
Rusty = +Conover
InfoGears = +Inc.
<= +/DIV>
= + +--Apple-Mail-103-339695047-- + +From pgsql-performance-owner@postgresql.org Tue Aug 29 20:58:18 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id BEFCD9FB2CA + for ; + Tue, 29 Aug 2006 20:58:17 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 94953-01-9 + for ; + Tue, 29 Aug 2006 20:58:14 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.176]) + by postgresql.org (Postfix) with ESMTP id 639469FA5FE + for ; + Tue, 29 Aug 2006 20:39:59 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so2681pyd + for ; + Tue, 29 Aug 2006 16:39:58 -0700 (PDT) +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=lmp0QWmGU0Nix/S75UgNh3YPGDE/LvRUAg/ePjeKJKdRTWynvnTBAsc7PvQRBGV0DbcUyhn4HDaAYSO8nqGn+Hgr5Gjx/c5CCOQ4YCbSdQhzMbtx5RER6+NjhnmglmtBBSLaBDS/xz9ExDo6iPekojI1XF9WKm8aIIPKd07S8Zs= +Received: by 10.64.143.12 with SMTP id q12mr182063qbd; + Tue, 29 Aug 2006 16:39:57 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Tue, 29 Aug 2006 16:39:57 -0700 (PDT) +Message-ID: +Date: Tue, 29 Aug 2006 19:39:57 -0400 +From: "Merlin Moncure" +To: "Willo van der Merwe" +Subject: Re: PostgreSQL performance issues +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44F446B2.2090900@studentvillage.co.za> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44F446B2.2090900@studentvillage.co.za> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.314 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/464 +X-Sequence-Number: 20649 + +On 8/29/06, Willo van der Merwe wrote: + +> and it has 743321 rows and a explain analyze select count(*) from +> property_values; +> + +you have a number of options: +1. keep a sequence on the property values and query it. if you want +exact count you must do some clever locking however. this can be made +to be exact and very fast. +2. analyze the table periodically and query pg_class (inexact) +3. keep a control record and update it in a transaction. this has +concurrency issues vs. #1 but is a bit easier to control +4. normalize + +other databases for example mysql optimize the special case select +count(*). because of mvcc, postgresql cannot do this easily. you +will find that applying any where condition to the count will slow +those servers down substantially becuase the special case optimization +does not apply. + +I am curious why you need to query the count of records in the log +table to six digits of precision. + +merlin + +From pgsql-performance-owner@postgresql.org Tue Aug 29 20:34:07 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 3D5C69FB359 + for ; + Tue, 29 Aug 2006 20:34:06 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 81674-01-3 + for ; + Tue, 29 Aug 2006 20:34:01 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from py-out-1112.google.com (py-out-1112.google.com + [64.233.166.180]) + by postgresql.org (Postfix) with ESMTP id 3812B9FB4BD + for ; + Tue, 29 Aug 2006 20:02:23 -0300 (ADT) +Received: by py-out-1112.google.com with SMTP id d80so3002398pyd + for ; + Tue, 29 Aug 2006 16:02:21 -0700 (PDT) +DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; + h=received:subject:from:reply-to:to:cc:in-reply-to:references:content-type:organization:date:message-id:mime-version:x-mailer:content-transfer-encoding; + b=lJWLwSYHeP8UgPPcDGcG76ZGBvbwYR7/MrtcaeEryEUAMM7RWVWbofdB381MdqQKXo+n7n6mhXII8ROqRQBIK7aKrw5sZgeeeuWh5ddch5DFLJsjTeeePIb+7qqnavT+eUlKP8RQb+tI5NbXiwRj1/x0PmjsM7YzM0x0NHYgm9M= +Received: by 10.35.121.2 with SMTP id y2mr248470pym; + Tue, 29 Aug 2006 16:02:21 -0700 (PDT) +Received: from ?10.50.0.225? ( [216.184.8.18]) + by mx.gmail.com with ESMTP id c1sm7035016nzd.2006.08.29.16.02.21; + Tue, 29 Aug 2006 16:02:21 -0700 (PDT) +Subject: Re: PostgreSQL performance issues +From: Codelogic +Reply-To: codelogic@gmail.com +To: Willo van der Merwe +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44F446B2.2090900@studentvillage.co.za> +References: <44F446B2.2090900@studentvillage.co.za> +Content-Type: text/plain +Organization: codelogic@gmail.com +Date: Tue, 29 Aug 2006 17:16:36 -0700 +Message-Id: <1156896996.21893.85.camel@santafe> +Mime-Version: 1.0 +X-Mailer: Evolution 2.6.1 +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/463 +X-Sequence-Number: 20648 + +On Tue, 2006-08-29 at 15:52 +0200, Willo van der Merwe wrote: +> (cost=0.00..51848.56 rows=1309356 width=0) + +It is going through way more number of rows than what is returned by the +count(*). + +It appears that you need to VACUUM the table (not VACUUM ANALYZE). + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 07:30:44 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 397C99FA147 + for ; + Wed, 30 Aug 2006 07:30:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 13544-07-2 + for ; + Wed, 30 Aug 2006 07:30:31 -0300 (ADT) +X-Greylist: delayed 01:00:03.640238 by SQLgrey- +Received: from frankenstein.isux.com (mailbox.isux.com [203.173.10.51]) + by postgresql.org (Postfix) with SMTP id D307B9FA5DC + for ; + Wed, 30 Aug 2006 07:30:30 -0300 (ADT) +Received: from [203.173.10.53] by frankenstein.isux.com + (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) + with ESMTPA id <0J4T004DQ0T61600@frankenstein.isux.com> for + pgsql-performance@postgresql.org; Wed, 30 Aug 2006 19:24:46 +1000 (EST) +Date: Wed, 30 Aug 2006 19:29:35 +1000 +From: Matthew Sullivan +Subject: performance problems. +To: pgsql-performance@postgresql.org +Message-id: <44F55A7F.40305@sorbs.net> +MIME-version: 1.0 +Content-type: text/plain; charset=ISO-8859-1; format=flowed +Content-transfer-encoding: 7BIT +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) + Gecko/20060516 SeaMonkey/1.0.2 +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.069 tagged_above=0 required=5 tests=SPF_NEUTRAL +X-Spam-Level: * +X-Archive-Number: 200608/466 +X-Sequence-Number: 20651 + +All, + +Got a little bit of a performance problem I hope that can be resolved. + +All the files/info I believe you are going to ask for are here: + +http://www.au.sorbs.net/~matthew/postgres/30.8.06/ + +The odd thing was it originally was fast (1-2 seconds) which is all I +need - the query is a permissions check and I added a permissions +caching engine to the client code. However, I was testing part of my +new interface and added and "expired" some rows in the permissions, and +authorisation tables (taking the row count to ~15) the performance +dropped to 86seconds (ish) which is unusable... :-( + +Unfortunately I do not have a query plan from before the performance issue. + +work_mem has been adjusted from 512 to 8192, 65536 and 1000000 with no +apparent effect. +random_page_cost has been 4 and 2 - 2 results in 89seconds for the query. + +The hardware is a Compaq 6400r with 4G of EDO RAM, 4x500MHz Xeons and a +Compaq RAID 3200 in RAID 5 configuration running across 3 spindles (34G +total space). + +The OS is FreeBSD 5.4-RELEASE-p14 +The PG Version is 8.1.3 + +Solutions/tips greatly appreciated. + +Regards, + +Mat + +From pgsql-performance-owner@postgresql.org Wed Aug 30 07:21:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 291A89FA621 + for ; + Wed, 30 Aug 2006 07:21:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 13292-05-5 + for ; + Wed, 30 Aug 2006 07:21:44 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 64F119FB314 + for ; + Wed, 30 Aug 2006 07:20:06 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from smtp01.isdsl.net (smtp01.isdsl.net [196.26.208.190]) + by svr4.postgresql.org (Postfix) with ESMTP id 32DD95AF043 + for ; + Wed, 30 Aug 2006 10:20:05 +0000 (GMT) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp01.isdsl.net (Postfix) with ESMTP id 6AE162FDD2 + for ; + Wed, 30 Aug 2006 12:20:01 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 12:24:21 +0200 +Message-ID: <44F56649.9050604@studentvillage.co.za> +Date: Wed, 30 Aug 2006 12:19:53 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Merlin Moncure +Cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <44F446B2.2090900@studentvillage.co.za> + +In-Reply-To: +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 30 Aug 2006 10:24:21.0359 (UTC) + FILETIME=[752CBFF0:01C6CC1E] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.407 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/465 +X-Sequence-Number: 20650 + +Merlin Moncure wrote: +> On 8/29/06, Willo van der Merwe wrote: +> +>> and it has 743321 rows and a explain analyze select count(*) from +>> property_values; +>> +> +> you have a number of options: +All good ideas and I'll be sure to implement them later. + +> I am curious why you need to query the count of records in the log +> table to six digits of precision. +I'm not with you you here. +I'm drawing statistic for the my users on a per user basis in real-time, +so there are a couple of where clauses attached. +> +> merlin +> +Hi Merlin, + +This was just an example. All queries have slowed down. Could it be that +I've reached some cut-off and now my disk is thrashing? + +Currently the load looks like this: +Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 1.0% si +Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si + + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 07:32:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id C76789FA603 + for ; + Wed, 30 Aug 2006 07:32:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 42718-04 for + ; + Wed, 30 Aug 2006 10:32:46 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) + by postgresql.org (Postfix) with ESMTP id C9D6F9FA5F3 + for ; + Wed, 30 Aug 2006 07:32:45 -0300 (ADT) +Received: from 172.16.1.148 by mail.Mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D1)); Wed, 30 Aug 2006 06:32:36 -0400 +X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01HOST02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug + 2006 06:32:36 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: PostgreSQL performance issues +Date: Wed, 30 Aug 2006 06:34:03 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D04392D1A@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] PostgreSQL performance issues +Thread-Index: AcbMHjwVhGA+9sPCTHupGXk/fGJUKAAAXQmQ +From: "Luke Lonergan" +To: "Willo van der Merwe" , + "Merlin Moncure" +cc: pgsql-performance@postgresql.org +X-OriginalArrivalTime: 30 Aug 2006 10:32:36.0171 (UTC) + FILETIME=[9C1B11B0:01C6CC1F] +X-WSS-ID: 68EBB6CE08G1943149-01-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/467 +X-Sequence-Number: 20652 + +> Currently the load looks like this: +> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, =20 +> 0.0% hi, 1.0% si +> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, =20 +> 0.0% hi, 0.3% si +> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, =20 +> 0.0% hi, 0.3% si +> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, =20 +> 0.0% hi, 0.3% si + +All four CPUs are hammered busy - check "top" and look for runaway +processes. + +- Luke + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 07:48:29 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 1EDAE9FB21E + for ; + Wed, 30 Aug 2006 07:48:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 46807-09 for + ; + Wed, 30 Aug 2006 10:48:25 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from relay02.is.co.za (relay02.is.co.za [196.35.6.70]) + by postgresql.org (Postfix) with ESMTP id D02C09FAA6E + for ; + Wed, 30 Aug 2006 07:48:20 -0300 (ADT) +Received: from relay02.is.co.za (localhost [127.0.0.1]) + by relay02.is.co.za (Postfix) with ESMTP id B21F531562A + for ; + Wed, 30 Aug 2006 12:48:18 +0200 (SAST) +Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) + by relay02.is.co.za (Postfix) with ESMTP id 979F4315619 + for ; + Wed, 30 Aug 2006 12:48:18 +0200 (SAST) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp02.isdsl.net (Postfix) with ESMTP id 6042D2E209 + for ; + Wed, 30 Aug 2006 12:48:17 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 12:52:38 +0200 +Message-ID: <44F56CE9.6060602@studentvillage.co.za> +Date: Wed, 30 Aug 2006 12:48:09 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Rusty Conover +Cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <44F446B2.2090900@studentvillage.co.za> + <9A079B52-0D1D-4682-A841-AA856439698E@infogears.com> +In-Reply-To: <9A079B52-0D1D-4682-A841-AA856439698E@infogears.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 30 Aug 2006 10:52:38.0156 (UTC) + FILETIME=[688B6CC0:01C6CC22] +X-Virus-Scanned: ClamAV using ClamSMTP at relay02.dial-up.net +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.63 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, + ROUND_THE_WORLD +X-Spam-Level: * +X-Archive-Number: 200608/468 +X-Sequence-Number: 20653 + +Rusty Conover wrote: +> +> On Aug 29, 2006, at 7:52 AM, Willo van der Merwe wrote: +> +>> Hi, +>> +>> We're running PostgreSQL 8.1.4 on CentOS 4 (Linux version +>> 2.6.9-34.0.1.ELsmp). Hardware specs: +>> 2x AMD Dual-Core Opteron 270 Italy 1Ghz HT 2 x 1MB L2 Cache Socket 940 +>> 4 GB Registered ECC PC3200 DDR RAM +>> SuperMicro Server-Class 1U AS1020S series system +>> Dual-channel Ultra320 SCSI controller +>> 1 x 73 GB 10,000rpm Ultra320 SCSI drive with 8MB cache +>> I use it to drive a web application. Everything was working fine when +>> all of a sudden today, things went belly up. Load on the server +>> started increasing and query speeds decreased rapidly. After dropping +>> all the clients I did some quick tests and found the following: +>> +>> I have a log table looking like this: +>> Table "public.log" +>> Column | Type | Modifiers +>> ---------+-----------------------------+--------------------------------- +>> site | bigint | not null +>> stamp | timestamp without time zone | default now() +>> type | character(8) | not null default 'log'::bpchar +>> user | text | not null default 'public'::text +>> message | text | +>> Indexes: +>> "fki_log_sites" btree (site) +>> "ix_log_stamp" btree (stamp) +>> "ix_log_type" btree ("type") +>> "ix_log_user" btree ("user") +>> Foreign-key constraints: +>> "log_sites" FOREIGN KEY (site) REFERENCES sites(id) ON UPDATE +>> CASCADE ON DELETE CASCADE +>> +>> and it has 743321 rows and a explain analyze select count(*) from +>> property_values; +>> QUERY +>> PLAN +>> ---------------------------------------------------------------------------------------------------------------------------------- +>> Aggregate (cost=55121.95..55121.96 rows=1 width=0) (actual +>> time=4557.797..4557.798 rows=1 loops=1) +>> -> Seq Scan on property_values (cost=0.00..51848.56 rows=1309356 +>> width=0) (actual time=0.026..2581.418 rows=1309498 loops=1) +>> Total runtime: 4557.978 ms +>> (3 rows) +>> +>> 4 1/2 seconds for a count(*) ? This seems a bit rough - is there +>> anything else I can try to optimize my Database? You can imagine that +>> slightly more complex queries goes out the roof. +>> +>> Any help appreciated +>> +>> Regards +>> +>> Willo van der Merwe +> +> +> Hi, +> +> What about doing a little bit of normalization? +> +> With 700k rows you could probably gain some improvements by: +> +> * normalizing the type and user columns to integer keys (dropping the +> 8 byte overhead for storing the field lengths) +> * maybe change the type column so that its a smallint if there is just +> a small range of possible values (emulating a enum type in other +> databases) rather the joining to another table. +> * maybe move message (if the majority of the rows are big and not null +> but not big enough to be TOASTed, ergo causing only a small number of +> rows to fit onto a 8k page) out of this table into a separate table +> that is joined only when you need the column's content. +> +> Doing these things would fit more rows onto each page, making the scan +> less intensive by not causing the drive to seek as much. Of course +> all of these suggestions depend on your workload. +> +> Cheers, +> +> Rusty +> -- +> Rusty Conover +> InfoGears Inc. +> +Hi Rusty, + +Good ideas and I've implemented some of them, and gained about 10%. I'm +still sitting on a load avg of about 60. + +Any ideas on optimizations on my postgresql.conf, that might have an effect? + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 08:52:42 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 959D79FB265 + for ; + Wed, 30 Aug 2006 08:52:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 59234-03-7 + for ; + Wed, 30 Aug 2006 11:52:17 +0000 (UTC) +X-Greylist: delayed 00:27:15.922561 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 3B0A69FB2F9 + for ; + Wed, 30 Aug 2006 08:49:57 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from wumpus.mythic-beasts.com (wumpus.mythic-beasts.com + [212.69.37.9]) + by svr4.postgresql.org (Postfix) with ESMTP id C36EC5AF03F + for ; + Wed, 30 Aug 2006 11:22:40 +0000 (GMT) +Received: from sphinx.mythic-beasts.com ([212.69.37.6]) + by wumpus.mythic-beasts.com with esmtp (Exim 4.50) + id 1GIO9W-000627-14 + for pgsql-performance@postgresql.org; Wed, 30 Aug 2006 12:22:38 +0100 +Received: from xelah (helo=localhost) + by sphinx.mythic-beasts.com with local-esmtp (Exim 4.51) + id 1GIO9V-0003kL-Qo + for pgsql-performance@postgresql.org; Wed, 30 Aug 2006 12:22:37 +0100 +Date: Wed, 30 Aug 2006 12:22:37 +0100 (BST) +From: Alex Hayward +X-X-Sender: xelah@sphinx.mythic-beasts.com +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +In-Reply-To: <44F56649.9050604@studentvillage.co.za> +Message-ID: +References: <44F446B2.2090900@studentvillage.co.za> + + <44F56649.9050604@studentvillage.co.za> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/471 +X-Sequence-Number: 20656 + +On Wed, 30 Aug 2006, Willo van der Merwe wrote: + +> Merlin Moncure wrote: +> > On 8/29/06, Willo van der Merwe wrote: +> > +> >> and it has 743321 rows and a explain analyze select count(*) from +> >> property_values; +> >> +> > +> > you have a number of options: +> All good ideas and I'll be sure to implement them later. +> +> > I am curious why you need to query the count of records in the log +> > table to six digits of precision. +> I'm not with you you here. +> I'm drawing statistic for the my users on a per user basis in real-time, +> so there are a couple of where clauses attached. + +Most of the advice so far has been aimed at improving the performance of +the query you gave. If this query isn't representative of your load then +you'll get better advice if you post the queries you are actually making +along with EXPLAIN ANALYZE output. + +> Hi Merlin, +> +> This was just an example. All queries have slowed down. Could it be that +> I've reached some cut-off and now my disk is thrashing? +> +> Currently the load looks like this: +> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 1.0% si +> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si + +It seems to be a sort of standing assumption on this list that databases +are much larger than memory and that database servers are almost always IO +bound. This isn't always true, but as we don't know the size of your +database or working set we can't tell. You'd have to look at your OS's IO +statistics to be sure, but it doesn't look to me to be likely that you're +IO bound. + +If there are significant writes going on then it may also be interesting +to know your context switch rate and whether dropping your foreign key +constraint makes any difference. IIRC your foreign key constraint will +result in the row in log_sites being locked FOR UPDATE and cause updates +and inserts into your log table for a particular site to be serialized (I +may be out of date on this, it's a while since I heavily used foreign +keys). + +From pgsql-performance-owner@postgresql.org Wed Aug 30 08:37:11 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 8CD359FAA6E + for ; + Wed, 30 Aug 2006 08:37:10 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 20343-01-6 + for ; + Wed, 30 Aug 2006 08:37:00 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from relay01.is.co.za (relay01.is.co.za [196.35.6.69]) + by postgresql.org (Postfix) with ESMTP id B9AEC9FA61D + for ; + Wed, 30 Aug 2006 08:35:30 -0300 (ADT) +Received: from relay01.is.co.za (localhost [127.0.0.1]) + by relay01.is.co.za (Postfix) with ESMTP id BDF043159C8 + for ; + Wed, 30 Aug 2006 13:35:28 +0200 (SAST) +Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) + by relay01.is.co.za (Postfix) with ESMTP id A3A4B3158EF + for ; + Wed, 30 Aug 2006 13:35:28 +0200 (SAST) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp02.isdsl.net (Postfix) with ESMTP id 630F42E1D7 + for ; + Wed, 30 Aug 2006 13:35:28 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 13:39:49 +0200 +Message-ID: <44F577F8.5070307@studentvillage.co.za> +Date: Wed, 30 Aug 2006 13:35:20 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Luke Lonergan +Cc: Merlin Moncure , + pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <3E37B936B592014B978C4415F90D662D04392D1A@MI8NYCMAIL06.Mi8.com> +In-Reply-To: <3E37B936B592014B978C4415F90D662D04392D1A@MI8NYCMAIL06.Mi8.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 30 Aug 2006 11:39:49.0890 (UTC) + FILETIME=[0063BE20:01C6CC29] +X-Virus-Scanned: ClamAV using ClamSMTP at relay01.dial-up.net +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.035 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, ROUND_THE_WORLD +X-Spam-Level: * +X-Archive-Number: 200608/469 +X-Sequence-Number: 20654 + +Luke Lonergan wrote: +>> Currently the load looks like this: +>> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, +>> 0.0% hi, 1.0% si +>> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, +>> 0.0% hi, 0.3% si +>> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, +>> 0.0% hi, 0.3% si +>> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, +>> 0.0% hi, 0.3% si +>> +> +> All four CPUs are hammered busy - check "top" and look for runaway +> processes. +> +> - Luke +> +> +> +Yes, the first 463 process are all postgres. In the meanwhile I've done: +Dropped max_connections from 500 to 250 and +Upped shared_buffers = 50000 + +Without any apparent effect. + +From pgsql-performance-owner@postgresql.org Wed Aug 30 08:44:40 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 8C3029FA621 + for ; + Wed, 30 Aug 2006 08:44:40 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 57344-02 for + ; + Wed, 30 Aug 2006 11:44:17 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from mail.mi8.com (d01gw02.mi8.com [63.240.6.46]) + by postgresql.org (Postfix) with ESMTP id C7B309FB1C5 + for ; + Wed, 30 Aug 2006 08:40:39 -0300 (ADT) +Received: from 172.16.1.112 by mail.mi8.com with ESMTP (- Welcome to Mi8 + Corporation www.Mi8.com (D2)); Wed, 30 Aug 2006 07:40:24 -0400 +X-Server-Uuid: 7829E76E-BB9E-4995-8473-3C0929DF7DD1 +Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.160]) by + D01SMTP02.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug + 2006 07:40:24 -0400 +X-MimeOLE: Produced By Microsoft Exchange V6.5 +Content-class: urn:content-classes:message +MIME-Version: 1.0 +Subject: Re: PostgreSQL performance issues +Date: Wed, 30 Aug 2006 07:41:51 -0400 +Message-ID: <3E37B936B592014B978C4415F90D662D04392D2B@MI8NYCMAIL06.Mi8.com> +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +Thread-Topic: [PERFORM] PostgreSQL performance issues +Thread-Index: AcbMKG2mravF31jsQEKRAMY2AvE/3gAAHnAA +From: "Luke Lonergan" +To: "Willo van der Merwe" +cc: "Merlin Moncure" , + pgsql-performance@postgresql.org +X-OriginalArrivalTime: 30 Aug 2006 11:40:24.0351 (UTC) + FILETIME=[14EE12F0:01C6CC29] +X-WSS-ID: 68EBA6A22MS4870220-10-01 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: quoted-printable +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/470 +X-Sequence-Number: 20655 + +Interesting - in this quick snapshot there is no I/O happening at all. +What happens when you track the activity for a longer period of time? + +How about just capturing vmstat during a period when the queries are +slow? + +Has the load average been this high forever or are you experiencing a +growth in workload? 463 processes all doing CPU work will take 100x as +long as one query on a 4 CPU box, have you worked through how long you +should expect the queries to take? + +- Luke=20 + +> -----Original Message----- +> From: Willo van der Merwe [mailto:willo@studentvillage.co.za]=20 +> Sent: Wednesday, August 30, 2006 4:35 AM +> To: Luke Lonergan +> Cc: Merlin Moncure; pgsql-performance@postgresql.org +> Subject: Re: [PERFORM] PostgreSQL performance issues +>=20 +> Luke Lonergan wrote: +> >> Currently the load looks like this: +> >> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa,=20 +> 0.0% hi, =20 +> >> 1.0% si +> >> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa,=20 +> 0.0% hi, =20 +> >> 0.3% si +> >> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa,=20 +> 0.0% hi, =20 +> >> 0.3% si +> >> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa,=20 +> 0.0% hi, =20 +> >> 0.3% si +> >> =20 +> > +> > All four CPUs are hammered busy - check "top" and look for runaway=20 +> > processes. +> > +> > - Luke +> > +> > +> > =20 +> Yes, the first 463 process are all postgres. In the meanwhile=20 +> I've done: +> Dropped max_connections from 500 to 250 and Upped=20 +> shared_buffers =3D 50000 +>=20 +> Without any apparent effect. +>=20 +>=20 + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 08:58:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 149649FAA6E + for ; + Wed, 30 Aug 2006 08:58:30 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 61174-04-4 + for ; + Wed, 30 Aug 2006 11:58:15 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from relay01.is.co.za (relay01.is.co.za [196.35.6.69]) + by postgresql.org (Postfix) with ESMTP id AB2209FB264 + for ; + Wed, 30 Aug 2006 08:55:40 -0300 (ADT) +Received: from relay01.is.co.za (localhost [127.0.0.1]) + by relay01.is.co.za (Postfix) with ESMTP id ACA9F314AC3 + for ; + Wed, 30 Aug 2006 13:55:38 +0200 (SAST) +Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) + by relay01.is.co.za (Postfix) with ESMTP id 7B97D314AAC + for ; + Wed, 30 Aug 2006 13:55:38 +0200 (SAST) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp02.isdsl.net (Postfix) with ESMTP id 2BCD32E251 + for ; + Wed, 30 Aug 2006 13:55:38 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 14:00:00 +0200 +Message-ID: <44F57CB2.4030808@studentvillage.co.za> +Date: Wed, 30 Aug 2006 13:55:30 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Luke Lonergan +Cc: Merlin Moncure , + pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <3E37B936B592014B978C4415F90D662D04392D2B@MI8NYCMAIL06.Mi8.com> +In-Reply-To: <3E37B936B592014B978C4415F90D662D04392D2B@MI8NYCMAIL06.Mi8.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 30 Aug 2006 12:00:00.0421 (UTC) + FILETIME=[D1EC1D50:01C6CC2B] +X-Virus-Scanned: ClamAV using ClamSMTP at relay01.dial-up.net +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.63 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, + ROUND_THE_WORLD +X-Spam-Level: * +X-Archive-Number: 200608/472 +X-Sequence-Number: 20657 + +That's exactly what I'm experiencing. + +Everything was fine until yesterday, when we noticed a considerable site +slow-down. Graphs showed the server suddenly spiking to a load of 67. At +first I thought somebody executed a ran-away query, so I restarted +postgres, but after it came back up, it climbed back up to this load. + +In the meanwhile I've applied some table level optimizations and the +postgres.conf optimizatrions ... nothing + +Here's the vmstat output, since reboot last night + +[root@srv1 ~]# vmstat -a +procs -----------memory---------- ---swap-- -----io---- --system-- +----cpu---- + r b swpd free inact active si so bi bo in cs us sy +id wa +27 0 0 595312 248100 2962764 0 0 8 31 105 7 63 +2 35 0 +[root@srv1 ~]# vmstat -d +disk- ------------reads------------ ------------writes----------- +-----IO------ + total merged sectors ms total merged sectors ms +cur sec +ram0 0 0 0 0 0 0 0 0 +0 0 +ram1 0 0 0 0 0 0 0 0 +0 0 +ram2 0 0 0 0 0 0 0 0 +0 0 +ram3 0 0 0 0 0 0 0 0 +0 0 +ram4 0 0 0 0 0 0 0 0 +0 0 +ram5 0 0 0 0 0 0 0 0 +0 0 +ram6 0 0 0 0 0 0 0 0 +0 0 +ram7 0 0 0 0 0 0 0 0 +0 0 +ram8 0 0 0 0 0 0 0 0 +0 0 +ram9 0 0 0 0 0 0 0 0 +0 0 +ram10 0 0 0 0 0 0 0 0 +0 0 +ram11 0 0 0 0 0 0 0 0 +0 0 +ram12 0 0 0 0 0 0 0 0 +0 0 +ram13 0 0 0 0 0 0 0 0 +0 0 +ram14 0 0 0 0 0 0 0 0 +0 0 +ram15 0 0 0 0 0 0 0 0 +0 0 +sda 197959 38959 4129737 952923 777438 1315162 16839981 +39809324 0 2791 +fd0 0 0 0 0 0 0 0 0 +0 0 +md0 0 0 0 0 0 0 0 0 +0 0 + + + +Luke Lonergan wrote: +> Interesting - in this quick snapshot there is no I/O happening at all. +> What happens when you track the activity for a longer period of time? +> +> How about just capturing vmstat during a period when the queries are +> slow? +> +> Has the load average been this high forever or are you experiencing a +> growth in workload? 463 processes all doing CPU work will take 100x as +> long as one query on a 4 CPU box, have you worked through how long you +> should expect the queries to take? +> +> - Luke +> +> +>> -----Original Message----- +>> From: Willo van der Merwe [mailto:willo@studentvillage.co.za] +>> Sent: Wednesday, August 30, 2006 4:35 AM +>> To: Luke Lonergan +>> Cc: Merlin Moncure; pgsql-performance@postgresql.org +>> Subject: Re: [PERFORM] PostgreSQL performance issues +>> +>> Luke Lonergan wrote: +>> +>>>> Currently the load looks like this: +>>>> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, +>>>> +>> 0.0% hi, +>> +>>>> 1.0% si +>>>> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, +>>>> +>> 0.0% hi, +>> +>>>> 0.3% si +>>>> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, +>>>> +>> 0.0% hi, +>> +>>>> 0.3% si +>>>> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, +>>>> +>> 0.0% hi, +>> +>>>> 0.3% si +>>>> +>>>> +>>> All four CPUs are hammered busy - check "top" and look for runaway +>>> processes. +>>> +>>> - Luke +>>> +>>> +>>> +>>> +>> Yes, the first 463 process are all postgres. In the meanwhile +>> I've done: +>> Dropped max_connections from 500 to 250 and Upped +>> shared_buffers = 50000 +>> +>> Without any apparent effect. +>> +>> +>> +> +> +> + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 09:04:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 634529FB298 + for ; + Wed, 30 Aug 2006 09:04:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 19638-09 for + ; + Wed, 30 Aug 2006 09:03:54 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from relay01.is.co.za (relay01.is.co.za [196.35.6.69]) + by postgresql.org (Postfix) with ESMTP id 8AC7E9FB273 + for ; + Wed, 30 Aug 2006 09:03:53 -0300 (ADT) +Received: from relay01.is.co.za (localhost [127.0.0.1]) + by relay01.is.co.za (Postfix) with ESMTP id A0F113153BD + for ; + Wed, 30 Aug 2006 14:03:51 +0200 (SAST) +Received: from smtp02.isdsl.net (smtp02.isdsl.net [196.26.208.200]) + by relay01.is.co.za (Postfix) with ESMTP id 6F3D8315315 + for ; + Wed, 30 Aug 2006 14:03:51 +0200 (SAST) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp02.isdsl.net (Postfix) with ESMTP id 35F312E1F1 + for ; + Wed, 30 Aug 2006 14:03:51 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 14:08:13 +0200 +Message-ID: <44F57E9F.2020604@studentvillage.co.za> +Date: Wed, 30 Aug 2006 14:03:43 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Alex Hayward +Cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <44F446B2.2090900@studentvillage.co.za> + + <44F56649.9050604@studentvillage.co.za> + <000801c6cc2b$fcb9e8a0$0a00a8c0@svo.co.za> +In-Reply-To: <000801c6cc2b$fcb9e8a0$0a00a8c0@svo.co.za> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 30 Aug 2006 12:08:13.0812 (UTC) + FILETIME=[F8019B40:01C6CC2C] +X-Virus-Scanned: ClamAV using ClamSMTP at relay01.dial-up.net +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.09 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, ROUND_THE_WORLD +X-Spam-Level: * +X-Archive-Number: 200608/473 +X-Sequence-Number: 20658 + +Alex Hayward wrote: +> On Wed, 30 Aug 2006, Willo van der Merwe wrote: +> +> +>> Merlin Moncure wrote: +>> +>>> On 8/29/06, Willo van der Merwe wrote: +>>> +>>> +>>>> and it has 743321 rows and a explain analyze select count(*) from +>>>> property_values; +>>>> +>>>> +>>> you have a number of options: +>>> +>> All good ideas and I'll be sure to implement them later. +>> +>> +>>> I am curious why you need to query the count of records in the log +>>> table to six digits of precision. +>>> +>> I'm not with you you here. +>> I'm drawing statistic for the my users on a per user basis in real-time, +>> so there are a couple of where clauses attached. +>> +> +> Most of the advice so far has been aimed at improving the performance of +> the query you gave. If this query isn't representative of your load then +> you'll get better advice if you post the queries you are actually making +> along with EXPLAIN ANALYZE output. +> +> +>> Hi Merlin, +>> +>> This was just an example. All queries have slowed down. Could it be that +>> I've reached some cut-off and now my disk is thrashing? +>> +>> Currently the load looks like this: +>> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 1.0% si +>> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +>> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +>> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +>> +> +> It seems to be a sort of standing assumption on this list that databases +> are much larger than memory and that database servers are almost always IO +> bound. This isn't always true, but as we don't know the size of your +> database or working set we can't tell. You'd have to look at your OS's IO +> statistics to be sure, but it doesn't look to me to be likely that you're +> IO bound. +> +> If there are significant writes going on then it may also be interesting +> to know your context switch rate and whether dropping your foreign key +> constraint makes any difference. IIRC your foreign key constraint will +> result in the row in log_sites being locked FOR UPDATE and cause updates +> and inserts into your log table for a particular site to be serialized (I +> may be out of date on this, it's a while since I heavily used foreign +> keys). +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that your +> message can get through to the mailing list cleanly +> + +Hi Alex, + +Yes, I haven't noticed any major I/O waits either. The crazy thing here +is that all the queries were running an an acceptable time limit, but +then suddenly it went haywire. I did not change any of the queries or +fiddle with the server in any way. Previously we've experienced 1 or 2 +spikes a day (where load would suddenly spike to 67 or so, but then +quickly drop down to below 4) but in this case it stayed up. So I +restarted the service and started fiddling with options, with no +apparent effect. + +From pgsql-performance-owner@postgresql.org Wed Aug 30 09:45:12 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 218979FA61D + for ; + Wed, 30 Aug 2006 09:45:12 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 25598-02-6 + for ; + Wed, 30 Aug 2006 09:44:51 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from net2.micro-automation.com (net2.micro-automation.com + [64.7.141.29]) by postgresql.org (Postfix) with SMTP id A35CD9FB328 + for ; + Wed, 30 Aug 2006 09:35:11 -0300 (ADT) +Received: (qmail 13361 invoked from network); 30 Aug 2006 12:35:10 -0000 +Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) + by net2.micro-automation.com with SMTP; 30 Aug 2006 12:35:10 -0000 +In-Reply-To: <44F577F8.5070307@studentvillage.co.za> +References: <3E37B936B592014B978C4415F90D662D04392D1A@MI8NYCMAIL06.Mi8.com> + <44F577F8.5070307@studentvillage.co.za> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Cc: Luke Lonergan , + Merlin Moncure , pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Dave Cramer +Subject: Re: PostgreSQL performance issues +Date: Wed, 30 Aug 2006 08:35:08 -0400 +To: Willo van der Merwe +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.042 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/474 +X-Sequence-Number: 20659 + + +On 30-Aug-06, at 7:35 AM, Willo van der Merwe wrote: + +> Luke Lonergan wrote: +>>> Currently the load looks like this: +>>> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>> hi, 1.0% si +>>> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>> hi, 0.3% si +>>> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>> hi, 0.3% si +>>> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>> hi, 0.3% si +>>> +>> +>> All four CPUs are hammered busy - check "top" and look for runaway +>> processes. +>> +>> - Luke +>> +>> +>> +> Yes, the first 463 process are all postgres. In the meanwhile I've +> done: +> Dropped max_connections from 500 to 250 and +> Upped shared_buffers = 50000 + +With 4G of memory you can push shared buffers to double that. +effective_cache should be 3/4 of available memory. + +Can you also check vmstat 1 for high context switches during this +query, high being over 100k + +Dave +> +> Without any apparent effect. +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 9: In versions below 8.0, the planner will ignore your desire to +> choose an index scan if your joining column's datatypes do not +> match +> + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 10:13:58 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id AF79A9FA61D + for ; + Wed, 30 Aug 2006 10:13:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28463-03-3 + for ; + Wed, 30 Aug 2006 10:13:32 -0300 (ADT) +X-Greylist: delayed 02:52:48.673501 by SQLgrey- +Received: from smtp01.isdsl.net (smtp01.isdsl.net [196.26.208.190]) + by postgresql.org (Postfix) with ESMTP id 9CA999FB2FC + for ; + Wed, 30 Aug 2006 10:12:54 -0300 (ADT) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp01.isdsl.net (Postfix) with ESMTP id EC7802F13B + for ; + Wed, 30 Aug 2006 15:12:48 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 15:17:13 +0200 +Message-ID: <44F58EC9.9090703@studentvillage.co.za> +Date: Wed, 30 Aug 2006 15:12:41 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Dave Cramer +Cc: Luke Lonergan , + Merlin Moncure , pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <3E37B936B592014B978C4415F90D662D04392D1A@MI8NYCMAIL06.Mi8.com> + <44F577F8.5070307@studentvillage.co.za> + +In-Reply-To: +Content-Type: multipart/alternative; + boundary="------------010008040400090901050000" +X-OriginalArrivalTime: 30 Aug 2006 13:17:13.0546 (UTC) + FILETIME=[9B7AE2A0:01C6CC36] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.444 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/475 +X-Sequence-Number: 20660 + +This is a multi-part message in MIME format. +--------------010008040400090901050000 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit + +Dave Cramer wrote: +> +> On 30-Aug-06, at 7:35 AM, Willo van der Merwe wrote: +> +>> Luke Lonergan wrote: +>>>> Currently the load looks like this: +>>>> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>>> hi, 1.0% si +>>>> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>>> hi, 0.3% si +>>>> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>>> hi, 0.3% si +>>>> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% +>>>> hi, 0.3% si +>>>> +>>> +>>> All four CPUs are hammered busy - check "top" and look for runaway +>>> processes. +>>> +>>> - Luke +>>> +>>> +>>> +>> Yes, the first 463 process are all postgres. In the meanwhile I've done: +>> Dropped max_connections from 500 to 250 and +>> Upped shared_buffers = 50000 +> +> With 4G of memory you can push shared buffers to double that. +> effective_cache should be 3/4 of available memory. +> +> Can you also check vmstat 1 for high context switches during this +> query, high being over 100k +> +> Dave +>> +>> Without any apparent effect. +>> +>> ---------------------------(end of broadcast)--------------------------- +>> TIP 9: In versions below 8.0, the planner will ignore your desire to +>> choose an index scan if your joining column's datatypes do not +>> match +>> +> +> +Hi Dave, + +Ok, I've upped shared_buffers = 150000 +and effective_cache_size = 100000 + +and restarted the service +top now reads: + +top - 15:08:28 up 20:12, 1 user, load average: 19.55, 22.48, 26.59 +Tasks: 132 total, 24 running, 108 sleeping, 0 stopped, 0 zombie +Cpu0 : 97.0% us, 1.0% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.3% hi, 1.3% si +Cpu1 : 98.3% us, 1.7% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si +Cpu2 : 98.0% us, 1.7% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.3% si +Cpu3 : 96.7% us, 3.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si +Mem: 4060084k total, 2661772k used, 1398312k free, 108152k buffers +Swap: 4192956k total, 0k used, 4192956k free, 2340936k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND +11446 postgres 17 0 1280m 97m 95m R 28.9 2.5 0:03.63 postmaster +11435 postgres 16 0 1279m 120m 117m R 26.9 3.0 0:05.18 postmaster +11438 postgres 16 0 1279m 31m 30m R 24.6 0.8 0:04.43 postmaster +11163 postgres 16 0 1279m 120m 118m R 23.2 3.0 0:42.61 postmaster +11167 postgres 16 0 1279m 120m 118m R 23.2 3.0 0:41.04 postmaster +11415 postgres 15 0 1279m 299m 297m R 22.2 7.5 0:07.07 postmaster +11428 postgres 15 0 1279m 34m 32m R 21.9 0.9 0:05.53 postmaster +11225 postgres 16 0 1279m 31m 30m R 21.6 0.8 0:34.95 postmaster +11298 postgres 16 0 1279m 118m 117m R 21.6 3.0 0:23.82 postmaster +11401 postgres 15 0 1279m 31m 30m R 21.6 0.8 0:08.18 postmaster +11377 postgres 15 0 1279m 122m 120m R 20.9 3.1 0:09.54 postmaster +11357 postgres 17 0 1280m 126m 123m R 19.9 3.2 0:13.98 postmaster +11415 postgres 16 0 1279m 299m 297m R 17.1 7.5 0:06.40 postmaster +11461 postgres 17 0 1279m 81m 78m R 17.1 2.0 0:00.77 postmaster +11357 postgres 15 0 1279m 120m 118m S 16.8 3.0 0:13.38 postmaster +11458 postgres 16 0 1279m 31m 30m R 15.8 0.8 0:00.97 postmaster +11446 postgres 15 0 1279m 31m 30m S 15.5 0.8 0:02.76 postmaster +11428 postgres 15 0 1279m 34m 32m S 15.2 0.9 0:04.87 postmaster +11435 postgres 16 0 1279m 120m 117m R 14.2 3.0 0:04.37 postmaster +11466 postgres 16 0 1279m 33m 32m S 7.9 0.9 0:00.24 postmaster + +load avg is climbing... + +vmstat 1 + +I don't see any cs > 100k + +procs -----------memory---------- ---swap-- -----io---- --system-- +----cpu---- + r b swpd free buff cache si so bi bo in cs us sy +id wa +33 0 0 1352128 108248 2352604 0 0 7 33 147 26 65 +2 33 0 +19 0 0 1348360 108264 2352656 0 0 0 348 3588 1408 98 +2 0 0 +26 0 0 1346024 108264 2352996 0 0 0 80 3461 1154 98 +2 0 0 +27 0 0 1349496 108264 2352996 0 0 0 100 3611 1199 98 +2 0 0 +31 0 0 1353872 108264 2353064 0 0 0 348 3329 1227 97 +2 0 0 +21 0 0 1352528 108264 2353064 0 0 0 80 3201 1437 97 +2 0 0 +28 0 0 1352096 108280 2353184 0 0 0 64 3579 1073 98 +2 0 0 +29 0 0 1352096 108284 2353180 0 0 0 0 3538 1293 98 +2 0 0 +28 0 0 1351776 108288 2353244 0 0 0 36 3339 1313 99 +1 0 0 +22 0 0 1366392 108288 2353244 0 0 0 588 3663 1303 99 +1 0 0 +27 0 0 1366392 108288 2353312 0 0 0 84 3276 1028 99 +1 0 0 +28 0 0 1365504 108296 2353372 0 0 0 140 3500 1164 98 +2 0 0 +26 0 0 1368272 108296 2353372 0 0 0 68 3268 1082 98 +2 0 0 +25 0 0 1372232 108296 2353508 0 0 0 260 3261 1278 97 +3 0 0 +26 0 0 1366056 108296 2353644 0 0 0 0 3268 1178 98 +2 0 0 +24 1 0 1368704 108296 2353780 0 0 0 1788 3548 1614 97 +3 0 0 +29 0 0 1367728 108296 2353304 0 0 0 60 3637 1105 99 +1 0 0 +21 0 0 1365224 108300 2353640 0 0 0 12 3257 918 99 +1 0 0 +27 0 0 1363944 108300 2354116 0 0 0 72 3052 1365 98 +2 0 0 +25 0 0 1366968 108300 2354184 0 0 0 212 3314 1696 99 +1 0 0 +30 0 0 1363552 108300 2354184 0 0 0 72 3147 1420 97 +2 0 0 +27 0 0 1367792 108300 2354184 0 0 0 184 3245 1310 97 +2 0 0 +21 0 0 1369088 108308 2354380 0 0 0 140 3306 987 98 +2 0 0 +11 1 0 1366056 108308 2354448 0 0 0 88 3210 1183 98 +1 0 0 +27 0 0 1361104 108308 2354516 0 0 0 0 3598 1015 98 +2 0 0 +28 0 0 1356808 108308 2354584 0 0 0 64 2835 1326 98 +2 0 0 + 3 0 0 1352888 108308 2354856 0 0 0 88 2829 1111 97 +3 0 0 +29 0 0 1351408 108316 2354848 0 0 0 180 2916 939 97 +3 0 0 +30 0 0 1352568 108316 2354848 0 0 0 112 2962 1122 98 +2 0 0 +29 0 0 1356936 108316 2355052 0 0 0 176 2987 976 98 +2 0 0 +27 0 0 1363816 108316 2355188 0 0 0 220 2990 1809 98 +2 0 0 +24 0 0 1361944 108316 2355256 0 0 0 0 3043 1213 98 +2 0 0 +24 0 0 1368808 108324 2355248 0 0 0 112 3168 1464 98 +2 0 0 +24 0 0 1370120 108324 2355248 0 0 0 112 3179 997 99 +1 0 0 +12 0 0 1370752 108324 2355248 0 0 0 16 3255 1081 97 +3 0 0 +26 0 0 1372752 108324 2355248 0 0 0 112 3416 1169 98 +2 0 0 +27 0 0 1369088 108324 2355248 0 0 0 0 3011 828 98 +2 0 0 +20 0 0 1366848 108324 2355316 0 0 0 64 3062 959 98 +2 0 0 +26 0 0 1368064 108328 2355312 0 0 0 264 3069 1064 97 +3 0 0 +24 0 0 1365624 108328 2355448 0 0 0 152 2940 1344 98 +2 0 0 +26 0 0 1363880 108328 2355584 0 0 0 128 3294 1122 98 +2 0 0 +26 0 0 1370048 108328 2355652 0 0 0 152 3198 1340 97 +3 0 0 +procs -----------memory---------- ---swap-- -----io---- --system-- +----cpu---- + r b swpd free buff cache si so bi bo in cs us sy +id wa +12 0 0 1369344 108328 2355720 0 0 0 184 2994 1030 98 +2 0 0 + + + +--------------010008040400090901050000 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit + + + + + + + +Dave Cramer wrote: +

+On 30-Aug-06, at 7:35 AM, Willo van der Merwe wrote: +
+
+
Luke Lonergan wrote: +
+
+
Currently the load looks like this: +
+Cpu0  : 96.8% us,  1.9% sy,  0.0% ni,  0.3% id,  0.0% wa,  0.0% hi,  +1.0% si +
+Cpu1  : 97.8% us,  1.6% sy,  0.0% ni,  0.3% id,  0.0% wa,  0.0% hi,  +0.3% si +
+Cpu2  : 96.8% us,  2.6% sy,  0.0% ni,  0.3% id,  0.0% wa,  0.0% hi,  +0.3% si +
+Cpu3  : 96.2% us,  3.2% sy,  0.0% ni,  0.3% id,  0.0% wa,  0.0% hi,  +0.3% si +
+
+
+
+All four CPUs are hammered busy - check "top" and look for runaway +
+processes. +
+
+- Luke +
+
+
+
+
+Yes, the first 463 process are all postgres. In the meanwhile I've +done: +
+Dropped max_connections from 500 to 250 and +
+Upped shared_buffers = 50000 +
+
+
+With 4G of memory you can push shared buffers to double that. +
+effective_cache should be 3/4 of available memory. +
+
+Can you also check vmstat 1 for high context switches during this +query, high being over 100k +
+
+Dave +
+

+Without any apparent effect. +
+
+---------------------------(end of +broadcast)--------------------------- +
+TIP 9: In versions below 8.0, the planner will ignore your desire to +
+      choose an index scan if your joining column's datatypes do not +
+      match +
+
+
+
+
+
+Hi Dave,
+
+Ok, I've upped shared_buffers = 150000
+and effective_cache_size = 100000
+
+and restarted the service
+top now reads:
+
+top - 15:08:28 up +20:12,  1 user,  load average: 19.55, 22.48, 26.59
+Tasks: 132 total,  24 running, 108 sleeping,   0 stopped,   0 zombie
+Cpu0  : 97.0% us,  1.0% sy,  0.0% ni,  0.3% id,  0.0% wa,  0.3% hi,  +1.3% si
+Cpu1  : 98.3% us,  1.7% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  +0.0% si
+Cpu2  : 98.0% us,  1.7% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  +0.3% si
+Cpu3  : 96.7% us,  3.3% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.0% hi,  +0.0% si
+Mem:   4060084k total,  2661772k used,  1398312k free,   108152k buffers
+Swap:  4192956k total,        0k used,  4192956k free,  2340936k cached
+
+  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
+11446 postgres  17   0 1280m  97m  95m R 28.9  2.5   0:03.63 postmaster
+11435 postgres  16   0 1279m 120m 117m R 26.9  3.0   0:05.18 postmaster
+11438 postgres  16   0 1279m  31m  30m R 24.6  0.8   0:04.43 postmaster
+11163 postgres  16   0 1279m 120m 118m R 23.2  3.0   0:42.61 postmaster
+11167 postgres  16   0 1279m 120m 118m R 23.2  3.0   0:41.04 postmaster
+11415 postgres  15   0 1279m 299m 297m R 22.2  7.5   0:07.07 postmaster
+11428 postgres  15   0 1279m  34m  32m R 21.9  0.9   0:05.53 postmaster
+11225 postgres  16   0 1279m  31m  30m R 21.6  0.8   0:34.95 postmaster
+11298 postgres  16   0 1279m 118m 117m R 21.6  3.0   0:23.82 postmaster
+11401 postgres  15   0 1279m  31m  30m R 21.6  0.8   0:08.18 postmaster
+11377 postgres  15   0 1279m 122m 120m R 20.9  3.1   0:09.54 postmaster
+11357 postgres  17   0 1280m 126m 123m R 19.9  3.2   0:13.98 postmaster
+11415 postgres  16   0 1279m 299m 297m R 17.1  7.5   0:06.40 postmaster
+11461 postgres  17   0 1279m  81m  78m R 17.1  2.0   0:00.77 postmaster
+11357 postgres  15   0 1279m 120m 118m S 16.8  3.0   0:13.38 postmaster
+11458 postgres  16   0 1279m  31m  30m R 15.8  0.8   0:00.97 postmaster
+11446 postgres  15   0 1279m  31m  30m S 15.5  0.8   0:02.76 postmaster
+11428 postgres  15   0 1279m  34m  32m S 15.2  0.9   0:04.87 postmaster
+11435 postgres  16   0 1279m 120m 117m R 14.2  3.0   0:04.37 postmaster
+11466 postgres  16   0 1279m  33m  32m S  7.9  0.9   0:00.24 postmaster
+

+load avg is climbing...
+
+vmstat 1
+
+I don't see any cs > 100k
+
+procs +-----------memory---------- ---swap-- -----io---- --system-- ----cpu----
+ r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us +sy id wa
+33  0      0 1352128 108248 2352604    0    0     7    33  147    26 +65  2 33  0
+19  0      0 1348360 108264 2352656    0    0     0   348 3588  1408 +98  2  0  0
+26  0      0 1346024 108264 2352996    0    0     0    80 3461  1154 +98  2  0  0
+27  0      0 1349496 108264 2352996    0    0     0   100 3611  1199 +98  2  0  0
+31  0      0 1353872 108264 2353064    0    0     0   348 3329  1227 +97  2  0  0
+21  0      0 1352528 108264 2353064    0    0     0    80 3201  1437 +97  2  0  0
+28  0      0 1352096 108280 2353184    0    0     0    64 3579  1073 +98  2  0  0
+29  0      0 1352096 108284 2353180    0    0     0     0 3538  1293 +98  2  0  0
+28  0      0 1351776 108288 2353244    0    0     0    36 3339  1313 +99  1  0  0
+22  0      0 1366392 108288 2353244    0    0     0   588 3663  1303 +99  1  0  0
+27  0      0 1366392 108288 2353312    0    0     0    84 3276  1028 +99  1  0  0
+28  0      0 1365504 108296 2353372    0    0     0   140 3500  1164 +98  2  0  0
+26  0      0 1368272 108296 2353372    0    0     0    68 3268  1082 +98  2  0  0
+25  0      0 1372232 108296 2353508    0    0     0   260 3261  1278 +97  3  0  0
+26  0      0 1366056 108296 2353644    0    0     0     0 3268  1178 +98  2  0  0
+24  1      0 1368704 108296 2353780    0    0     0  1788 3548  1614 +97  3  0  0
+29  0      0 1367728 108296 2353304    0    0     0    60 3637  1105 +99  1  0  0
+21  0      0 1365224 108300 2353640    0    0     0    12 3257   918 +99  1  0  0
+27  0      0 1363944 108300 2354116    0    0     0    72 3052  1365 +98  2  0  0
+25  0      0 1366968 108300 2354184    0    0     0   212 3314  1696 +99  1  0  0
+30  0      0 1363552 108300 2354184    0    0     0    72 3147  1420 +97  2  0  0
+27  0      0 1367792 108300 2354184    0    0     0   184 3245  1310 +97  2  0  0
+21  0      0 1369088 108308 2354380    0    0     0   140 3306   987 +98  2  0  0
+11  1      0 1366056 108308 2354448    0    0     0    88 3210  1183 +98  1  0  0
+27  0      0 1361104 108308 2354516    0    0     0     0 3598  1015 +98  2  0  0
+28  0      0 1356808 108308 2354584    0    0     0    64 2835  1326 +98  2  0  0
+ 3  0      0 1352888 108308 2354856    0    0     0    88 2829  1111 +97  3  0  0
+29  0      0 1351408 108316 2354848    0    0     0   180 2916   939 +97  3  0  0
+30  0      0 1352568 108316 2354848    0    0     0   112 2962  1122 +98  2  0  0
+29  0      0 1356936 108316 2355052    0    0     0   176 2987   976 +98  2  0  0
+27  0      0 1363816 108316 2355188    0    0     0   220 2990  1809 +98  2  0  0
+24  0      0 1361944 108316 2355256    0    0     0     0 3043  1213 +98  2  0  0
+24  0      0 1368808 108324 2355248    0    0     0   112 3168  1464 +98  2  0  0
+24  0      0 1370120 108324 2355248    0    0     0   112 3179   997 +99  1  0  0
+12  0      0 1370752 108324 2355248    0    0     0    16 3255  1081 +97  3  0  0
+26  0      0 1372752 108324 2355248    0    0     0   112 3416  1169 +98  2  0  0
+27  0      0 1369088 108324 2355248    0    0     0     0 3011   828 +98  2  0  0
+20  0      0 1366848 108324 2355316    0    0     0    64 3062   959 +98  2  0  0
+26  0      0 1368064 108328 2355312    0    0     0   264 3069  1064 +97  3  0  0
+24  0      0 1365624 108328 2355448    0    0     0   152 2940  1344 +98  2  0  0
+26  0      0 1363880 108328 2355584    0    0     0   128 3294  1122 +98  2  0  0
+26  0      0 1370048 108328 2355652    0    0     0   152 3198  1340 +97  3  0  0
+procs -----------memory---------- ---swap-- -----io---- --system-- +----cpu----
+ r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us +sy id wa
+12  0      0 1369344 108328 2355720    0    0     0   184 2994  1030 +98  2  0  0
+
+

+ + + +--------------010008040400090901050000-- + +From pgsql-performance-owner@postgresql.org Wed Aug 30 11:03:55 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id C8CB79FB31D + for ; + Wed, 30 Aug 2006 11:03:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 31449-04-3 + for ; + Wed, 30 Aug 2006 11:03:33 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) + by postgresql.org (Postfix) with ESMTP id A4C499FB309 + for ; + Wed, 30 Aug 2006 11:03:05 -0300 (ADT) +X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway +X-GR-Acctd: YES +Received: from [67.90.96.2] (HELO DaveEMachine) + by globalrelay.com (CommuniGate Pro SMTP 4.2.3) + with ESMTP id 102326943; Wed, 30 Aug 2006 07:03:01 -0700 +From: "Dave Dutcher" +To: "'Willo van der Merwe'" +Cc: +Subject: Re: PostgreSQL performance issues +Date: Wed, 30 Aug 2006 09:03:01 -0500 +Message-ID: <007501c6cc3d$01e1e290$8300a8c0@tridecap.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0076_01C6CC13.190BDA90" +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook, Build 10.0.6626 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 +In-Reply-To: <44F58EC9.9090703@studentvillage.co.za> +Importance: Normal +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.202 tagged_above=0 required=5 tests=AWL, + HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/476 +X-Sequence-Number: 20661 + +This is a multi-part message in MIME format. + +------=_NextPart_000_0076_01C6CC13.190BDA90 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +That's an interesting situation. Your CPU's are pegged, and you're = +hardly +doing any IO. I wonder if there is some ineficient query, or if its = +just +very high query volume. Maybe you could try setting +log_min_duration_statement to try to track down the slowest of the = +queries. +Then post the slow queries with an explain analyze to the list. +=20 +Here is some info on setting up logging: +http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.htm= +l +=20 +Are your queries standard SQL or do you call functions you wrote in = +PL/pgSQl +or PL/Python or anything? +=20 +=20 + +------=_NextPart_000_0076_01C6CC13.190BDA90 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + +Message + + + +
That's an=20 +interesting situation.  Your CPU's are pegged, and you're hardly = +doing any=20 +IO.  I wonder if there is some ineficient query, or if its just = +very high=20 +query volume.  Maybe you could try setting = +log_min_duration_statement to=20 +try to track down the slowest of the queries.  Then post the slow = +queries=20 +with an explain analyze to the list.
+
 
+
Here = +is some info=20 +on setting up logging:
+
http://www.postgresql.org/docs/8.1/interactive/runtime-config-= +logging.html
+
 
+
+
Are = +your queries=20 +standard SQL or do you call functions you wrote in PL/pgSQl or PL/Python = +or=20 +anything?
+
 
+
 
+ +------=_NextPart_000_0076_01C6CC13.190BDA90-- + + +From pgsql-performance-owner@postgresql.org Wed Aug 30 11:11:52 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (unknown [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 32D3F9FB30E + for ; + Wed, 30 Aug 2006 11:11:51 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 33833-01-7 + for ; + Wed, 30 Aug 2006 11:11:26 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 7676D9FB2F0 + for ; + Wed, 30 Aug 2006 11:10:31 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id 6122EB80F; + Wed, 30 Aug 2006 10:10:29 -0400 (EDT) +In-Reply-To: <44F55A7F.40305@sorbs.net> +References: <44F55A7F.40305@sorbs.net> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-4-398685960; + protocol="application/pkcs7-signature" +Message-Id: +Cc: pgsql-performance@postgresql.org +From: Vivek Khera +Subject: Re: performance problems. +Date: Wed, 30 Aug 2006 10:10:28 -0400 +To: Matthew Sullivan +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.013 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/477 +X-Sequence-Number: 20662 + + +--Apple-Mail-4-398685960 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 30, 2006, at 5:29 AM, Matthew Sullivan wrote: + +> The hardware is a Compaq 6400r with 4G of EDO RAM, 4x500MHz Xeons +> and a Compaq RAID 3200 in RAID 5 configuration running across 3 +> spindles (34G total space). +> +> The OS is FreeBSD 5.4-RELEASE-p14 +> The PG Version is 8.1.3 + +What else does this box do? + +I think you should try these settings, which I use on 4GB dual +Opteron boxes running FreeBSD 6.x dedicated to Postgres only. Your +effective_cache_size seems overly optimistic for freebsd. cranking +up the shared buffers seems to be one of the best bangs for the buck +under pg 8.1. I recently doubled them and nearly tripled my +performance on a massive write-mostly (insert/update) load. Unless +your disk system is *really* slow, random_page_cost should be reduced +from the default 4. + +As you can see, I change *very* little from the default config. + + +shared_buffers = 70000 # min 16 or +max_connections*2, 8KB each +work_mem = 262144 # min 64, size in KB +maintenance_work_mem = 524288 # min 1024, size in KB + +checkpoint_segments = 256 +checkpoint_timeout = 900 + +effective_cache_size = 27462 # `sysctl -n +vfs.hibufspace` / 8192 (BLKSZ) +random_page_cost = 2 + +if you're feeling adventurous try these to reduce the checkpoint +impact on the system: + +bgwriter_lru_percent = 2.0 +bgwriter_lru_maxpages = 40 +bgwriter_all_percent = 0.666 +bgwriter_all_maxpages = 40 + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +Vivek Khera, Ph.D. MailerMailer, LLC Rockville, MD +http://www.MailerMailer.com/ +1-301-869-4449 x806 + + + +--Apple-Mail-4-398685960 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MzAxNDEwMjla +MCMGCSqGSIb3DQEJBDEWBBSg596BsNa229CaJajjh/q+pAsvhDCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAdR4kPpLWQ58AZ7FA +wNI8U9RFcrav+TpmpIe4MPVa1LvL5wZqHuOJIDKkeAvC2oP4I6nQG/P7+gNmXOcKB8X+KmVtl2lu +G/7+ISG8pJA1TVt0GIFXiC7IBeZM23/iH8IgmWgu87DykvTxYDlgBw/7KXRrByr7LUPh2SH1SYpc +kyPsPRLQSRXmv6T1SRcj1eZUtxNv+vQt8rel4NGXd6/YhdW/0bDhpSVEBL4NXFQPO8sMipIn8U/N +p2JUeT9feKyd8tL3c7mBwA4w9vdVYCmh5ZMOcDYh8cKkamce0Nh215o9PAYnAY/NT7oP8HjSMisw +RCzFpoeLrg5Cz8p4aTETQAAAAAAAAA== + +--Apple-Mail-4-398685960-- + +From pgsql-performance-owner@postgresql.org Wed Aug 30 11:49:22 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id A02A39FB310 + for ; + Wed, 30 Aug 2006 11:49:21 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 35682-06 for + ; + Wed, 30 Aug 2006 11:49:08 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from smtp01.isdsl.net (smtp01.isdsl.net [196.26.208.190]) + by postgresql.org (Postfix) with ESMTP id 4DB229FB303 + for ; + Wed, 30 Aug 2006 11:49:08 -0300 (ADT) +Received: from server.svo.co.za (c1-52-10.rrba.isadsl.co.za [196.209.57.52]) + by smtp01.isdsl.net (Postfix) with ESMTP id 6CB142EE9E + for ; + Wed, 30 Aug 2006 16:49:05 +0200 (SAST) +Received: from [192.168.0.11] ([192.168.0.11]) by server.svo.co.za with + Microsoft SMTPSVC(6.0.3790.1830); Wed, 30 Aug 2006 16:53:32 +0200 +Message-ID: <44F5A559.9050701@studentvillage.co.za> +Date: Wed, 30 Aug 2006 16:48:57 +0200 +From: Willo van der Merwe +User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) +MIME-Version: 1.0 +To: Dave Dutcher +Cc: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +References: <007501c6cc3d$01e1e290$8300a8c0@tridecap.com> +In-Reply-To: <007501c6cc3d$01e1e290$8300a8c0@tridecap.com> +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +X-OriginalArrivalTime: 30 Aug 2006 14:53:32.0921 (UTC) + FILETIME=[10418690:01C6CC44] +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.36 tagged_above=0 required=5 tests=AWL, + FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/478 +X-Sequence-Number: 20663 + +Dave Dutcher wrote: +> That's an interesting situation. Your CPU's are pegged, and you're +> hardly doing any IO. I wonder if there is some ineficient query, or +> if its just very high query volume. Maybe you could try setting +> log_min_duration_statement to try to track down the slowest of the +> queries. Then post the slow queries with an explain analyze to the list. +> +> Here is some info on setting up logging: +> http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.html +> +> Are your queries standard SQL or do you call functions you wrote in +> PL/pgSQl or PL/Python or anything? +> +> +It might be a combo of queries and load. My queries use almost +exclusively functions, but on an unloaded dev machine performs its +queries in aprox 10ms. When is it appropriate to start clustering +database servers? + +From pgsql-performance-owner@postgresql.org Wed Aug 30 12:08:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 347F79FB2F8 + for ; + Wed, 30 Aug 2006 12:08:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 39289-02 for + ; + Wed, 30 Aug 2006 12:08:09 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.206]) + by postgresql.org (Postfix) with ESMTP id 48E339FB2F2 + for ; + Wed, 30 Aug 2006 12:08:09 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so128764nzn + for ; + Wed, 30 Aug 2006 08:08:08 -0700 (PDT) +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=oVIELlgV+t45MJAtZj3B/W2YQXjDqTHL0o81B0cuslg1oxFNzfnrjReqVI71SdqIWa3Vcw5T6M5rZtS15qmsskZyXkvIeA2K1U5B1Jx5CChb0bsDWfXFvs/LODCgVgDc3t7CAtGB6OSSX55JLgBZRs4OrVJMgNS4Yl+vtEJhJbU= +Received: by 10.64.184.14 with SMTP id h14mr810742qbf; + Wed, 30 Aug 2006 08:08:07 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Wed, 30 Aug 2006 08:08:07 -0700 (PDT) +Message-ID: +Date: Wed, 30 Aug 2006 11:08:07 -0400 +From: "Merlin Moncure" +To: "Willo van der Merwe" +Subject: Re: PostgreSQL performance issues +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44F56649.9050604@studentvillage.co.za> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44F446B2.2090900@studentvillage.co.za> + + <44F56649.9050604@studentvillage.co.za> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.312 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/479 +X-Sequence-Number: 20664 + +On 8/30/06, Willo van der Merwe wrote: +> This was just an example. All queries have slowed down. Could it be that +> I've reached some cut-off and now my disk is thrashing? +> +> Currently the load looks like this: +> Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 1.0% si +> Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +> Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +> Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si +> +I don't think so, it looks like you are cpu bound. Your server has a +(fairly high) budget of records per second it can crunch through. You +have hit that limit and backpressure is building up and server load is +escalating. This almost certainly due to inefficient sql, which is +very easy to do especially if you are using some type of middleware +which writes the sql for you. The trick here would be to turn all sql +logging on and find out where your budget is getting spent. solving +the problem may be a simple matter of adding an index or crafting a +stored procedure. + +merlin + +From pgsql-performance-owner@postgresql.org Wed Aug 30 13:45:04 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 7E1779FA435 + for ; + Wed, 30 Aug 2006 13:45:03 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 50279-08 for + ; + Wed, 30 Aug 2006 13:44:59 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id D2D519FB26E + for ; + Wed, 30 Aug 2006 13:24:31 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from skynet.simkin.ca (skynet.simkin.ca [199.175.137.210]) + by svr4.postgresql.org (Postfix) with ESMTP id 27FEC5AF89D + for ; + Wed, 30 Aug 2006 16:24:31 +0000 (GMT) +Received: from hal.simkin.ca (S0106000c6eb33e73.vc.shawcable.net + [24.80.120.141]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by skynet.simkin.ca (Postfix) with ESMTP id C9B21FA82 + for ; + Wed, 30 Aug 2006 09:24:28 -0700 (PDT) +From: Alan Hodgson +Organization: Simkin Network Consulting +To: pgsql-performance@postgresql.org +Subject: Re: PostgreSQL performance issues +Date: Wed, 30 Aug 2006 09:24:26 -0700 +User-Agent: KMail/1.9.1 +References: <44F446B2.2090900@studentvillage.co.za> + <9A079B52-0D1D-4682-A841-AA856439698E@infogears.com> + <44F56CE9.6060602@studentvillage.co.za> +In-Reply-To: <44F56CE9.6060602@studentvillage.co.za> +MIME-Version: 1.0 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +Message-Id: <200608300924.26151@hal.medialogik.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.277 tagged_above=0 required=5 + tests=FORGED_RCVD_HELO, SPF_FAIL +X-Spam-Level: * +X-Archive-Number: 200608/481 +X-Sequence-Number: 20666 + +On Wednesday 30 August 2006 03:48, Willo van der Merwe + wrote: +> Hi Rusty, +> +> Good ideas and I've implemented some of them, and gained about 10%. I'm +> still sitting on a load avg of about 60. +> +> Any ideas on optimizations on my postgresql.conf, that might have an +> effect? + +If all of those sessions are truly doing a select count(*) from a .75 +million row table (plus half a million dead rows), then I'm not suprised +it's bogged down. Every query has to loop through the cache of the full +table in memory every time it's run. + +Your CPU is doing something. I doubt that postgresql.conf settings are +going to help. What exactly are all those high CPU usage sessions doing? + +-- +"Government big enough to supply everything you need is big enough to take +everything you have ... the course of history shows that as a government +grows, liberty decreases." -- Thomas Jefferson + +From pgsql-performance-owner@postgresql.org Wed Aug 30 13:27:19 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 18F139FA6B1 + for ; + Wed, 30 Aug 2006 13:27:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 37441-07 for + ; + Wed, 30 Aug 2006 16:27:08 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) + by postgresql.org (Postfix) with ESMTP id 48A179FA4A5 + for ; + Wed, 30 Aug 2006 13:27:00 -0300 (ADT) +Received: by noel.decibel.org (Postfix, from userid 1001) + id 513E45643F; Wed, 30 Aug 2006 11:26:59 -0500 (CDT) +Received: (hashcash-sendmail, from uid 1001); Wed, 30 Aug 2006 11:26:58 -0500 +Date: Wed, 30 Aug 2006 11:26:57 -0500 +From: "Jim C. Nasby" +To: Vivek Khera +Cc: Matthew Sullivan , pgsql-performance@postgresql.org +Subject: Re: performance problems. +Message-ID: <20060830162657.GD81373@pervasive.com> +References: <44F55A7F.40305@sorbs.net> + +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: +X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 +X-Distributed: Join the Effort! http://www.distributed.net +User-Agent: Mutt/1.5.11 +X-Hashcash: 1:20:060830:vivek@khera.org::86xGpwA0dFMl7/fw:00ERS7 +X-Hashcash: + 1:20:060830:matthew@sorbs.net::JyjSeXGmkfOLT2nr:00000000000000000000 + 0000000000000000000000000orW +X-Hashcash: + 1:20:060830:pgsql-performance@postgresql.org::pcorom3hJGvizjc9:00000 + 0000000000000000000000003lLT +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/480 +X-Sequence-Number: 20665 + +On Wed, Aug 30, 2006 at 10:10:28AM -0400, Vivek Khera wrote: +> effective_cache_size = 27462 # `sysctl -n +> vfs.hibufspace` / 8192 (BLKSZ) +> random_page_cost = 2 + +You misunderstand how effective_cache_size is used. It's the *only* +memory factor that plays a role in cost estimator functions. This means +it should include the memory set aside for caching in shared_buffers. + +Also, hibufspace is only talking about filesystem buffers in FreeBSD, +which AFAIK has nothing to do with total memory available for caching, +since VM pages are also used to cache data. + +Basically, your best bet for setting effective_cache_size is to use the +total memory in the machine, and substract some overhead for the OS and +other processes. I'll typically subtract 1G. +-- +Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com +Pervasive Software http://pervasive.com work: 512-231-6117 +vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 + +From pgsql-performance-owner@postgresql.org Wed Aug 30 15:20:30 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 514D09FB335 + for ; + Wed, 30 Aug 2006 15:20:29 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 61385-05-3 + for ; + Wed, 30 Aug 2006 15:20:17 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from brmea-mail-2.sun.com (brmea-mail-2.Sun.COM [192.18.98.43]) + by postgresql.org (Postfix) with ESMTP id AA2359FB34D + for ; + Wed, 30 Aug 2006 15:17:05 -0300 (ADT) +Received: from fe-amer-05.sun.com ([192.18.108.179]) + by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id + k7UIH4fK008191 for ; + Wed, 30 Aug 2006 12:17:04 -0600 (MDT) +Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com + (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) + id <0J4T00301OW4G000@mail-amer.sun.com> (original mail from + J.K.Shah@Sun.COM) for pgsql-performance@postgresql.org; + Wed, 30 Aug 2006 12:17:04 -0600 (MDT) +Received: from [129.156.85.92] by mail-amer.sun.com + (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) + with ESMTPSA id <0J4T009ODPGFANE7@mail-amer.sun.com>; Wed, + 30 Aug 2006 12:17:04 -0600 (MDT) +Date: Wed, 30 Aug 2006 19:17:02 +0100 +From: "Jignesh K. Shah" +Subject: Re: slow i/o +In-reply-to: <8d04ce990608291056la088194n84280509528a909d@mail.gmail.com> +To: Junaili Lie +Cc: pgsql-performance@postgresql.org +Message-id: <44F5D61E.6090103@sun.com> +MIME-version: 1.0 +Content-type: text/plain; format=flowed; charset=ISO-8859-1 +Content-transfer-encoding: 7BIT +X-Accept-Language: en-us, en +References: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> + <44F45900.4000702@sun.com> + <8d04ce990608291056la088194n84280509528a909d@mail.gmail.com> +User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050322) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.026 tagged_above=0 required=5 tests=AWL, + UNPARSEABLE_RELAY +X-Spam-Level: +X-Archive-Number: 200608/482 +X-Sequence-Number: 20667 + +The bgwriter parameters changed in 8.1 + +Try + +bgwriter_lru_maxpages=0 +bgwriter_lru_percent=0 + +to turn off bgwriter and see if there is any change. + +-Jignesh + + +Junaili Lie wrote: +> Hi Jignesh, +> Thank you for my reply. +> I have the setting just like what you described: +> +> wal_sync_method = fsync +> wal_buffers = 128 +> checkpoint_segments = 128 +> bgwriter_all_percent = 0 +> bgwriter_maxpages = 0 +> +> +> I ran the dtrace script and found the following: +> During the i/o busy time, there are postgres processes that has very +> high BYTES count. During that non i/o busy time, this same process +> doesn't do a lot of i/o activity. I checked the pg_stat_activity but +> couldn't found this process. Doing ps revealed that this process is +> started at the same time since the postgres started, which leads me to +> believe that it maybe background writer or some other internal process. +> This process are not autovacuum because it doesn't disappear when I +> tried turning autovacuum off. +> Except for the ones mentioned above, I didn't modify the other +> background setting: +> MONSOON=# show bgwriter_delay ; +> bgwriter_delay +> ---------------- +> 200 +> (1 row) +> +> MONSOON=# show bgwriter_lru_maxpages ; bgwriter_lru_maxpages +> ----------------------- +> 5 +> (1 row) +> +> MONSOON=# show bgwriter_lru_percent ; +> bgwriter_lru_percent +> ---------------------- +> 1 +> (1 row) +> +> This i/o spike only happens at minute 1 and minute 6 (ie. 10.51, 10.56) +> . If I do select * from pg_stat_activity during this time, I will see a +> lot of write queries waiting to be processed. After a few seconds, +> everything seems to be gone. All writes that are not happening at the +> time of this i/o jump are being processed very fast, thus do not show on +> pg_stat_activity. +> +> Thanks in advance for the reply, +> Best, +> +> J +> +> On 8/29/06, *Jignesh K. Shah* > wrote: +> +> Also to answer your real question: +> +> DTrace On Solaris 10: +> +> # dtrace -s /usr/demo/dtrace/whoio.d +> +> It will tell you the pids doing the io activity and on which devices. +> There are more scripts in that directory like iosnoop.d, iotime.d +> and others which also will give +> other details like file accessed, time it took for the io etc. +> +> Hope this helps. +> +> Regards, +> Jignesh +> +> +> Junaili Lie wrote: +> > Hi everyone, +> > We have a postgresql 8.1 installed on Solaris 10. It is running fine. +> > However, for the past couple days, we have seen the i/o reports +> > indicating that the i/o is busy most of the time. Before this, we +> only +> > saw i/o being busy occasionally (very rare). So far, there has +> been no +> > performance complaints by customers, and the slow query reports +> doesn't +> > indicate anything out of the ordinary. +> > There's no code changes on the applications layer and no database +> > configuration changes. +> > I am wondering if there's a tool out there on Solaris to tell which +> > process is doing most of the i/o activity? +> > Thank you in advance. +> > +> > J +> > +> +> + +From pgsql-performance-owner@postgresql.org Wed Aug 30 15:22:45 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id D00DF9FB348 + for ; + Wed, 30 Aug 2006 15:22:44 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 60667-03-2 + for ; + Wed, 30 Aug 2006 15:22:35 -0300 (ADT) +X-Greylist: delayed 06:59:39.938057 by SQLgrey- +Received: from wumpus.mythic-beasts.com (wumpus.mythic-beasts.com + [212.69.37.9]) by postgresql.org (Postfix) with ESMTP id 1410E9FB333 + for ; + Wed, 30 Aug 2006 15:22:20 -0300 (ADT) +Received: from sphinx.mythic-beasts.com ([212.69.37.6]) + by wumpus.mythic-beasts.com with esmtp (Exim 4.50) + id 1GIUhf-0003rm-7O + for pgsql-performance@postgresql.org; Wed, 30 Aug 2006 19:22:19 +0100 +Received: from xelah (helo=localhost) + by sphinx.mythic-beasts.com with local-esmtp (Exim 4.51) + id 1GIUhe-0002F8-UG + for pgsql-performance@postgresql.org; Wed, 30 Aug 2006 19:22:18 +0100 +Date: Wed, 30 Aug 2006 19:22:18 +0100 (BST) +From: Alex Hayward +X-X-Sender: xelah@sphinx.mythic-beasts.com +To: pgsql-performance@postgresql.org +Subject: Re: performance problems. +In-Reply-To: <20060830162657.GD81373@pervasive.com> +Message-ID: +References: <44F55A7F.40305@sorbs.net> + + <20060830162657.GD81373@pervasive.com> +MIME-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/483 +X-Sequence-Number: 20668 + +On Wed, 30 Aug 2006, Jim C. Nasby wrote: + +> On Wed, Aug 30, 2006 at 10:10:28AM -0400, Vivek Khera wrote: +> > effective_cache_size = 27462 # `sysctl -n +> > vfs.hibufspace` / 8192 (BLKSZ) +> > random_page_cost = 2 +> +> You misunderstand how effective_cache_size is used. It's the *only* +> memory factor that plays a role in cost estimator functions. This means +> it should include the memory set aside for caching in shared_buffers. +> +> Also, hibufspace is only talking about filesystem buffers in FreeBSD, +> which AFAIK has nothing to do with total memory available for caching, +> since VM pages are also used to cache data. + +I believe it's not talking about quantities of buffers at all, but about +kernel virtual address space. It's something like the amount of kernel +virtual address space available for mapping buffer-cache pages in to +kernel memory. It certainly won't tell you (or even approximate) how much +PostgreSQL data is being cached by the OS. Cached PostgreSQL data will +appear in the active, inactive and cached values - and (AFAIK) there isn't +any distinction between file-backed pages and swap-backed pages amongst +those. + +From pgsql-performance-owner@postgresql.org Wed Aug 30 15:53:53 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 385109FB33E + for ; + Wed, 30 Aug 2006 15:53:53 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 63644-05 for + ; + Wed, 30 Aug 2006 15:53:43 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) + by postgresql.org (Postfix) with ESMTP id 4888C9FB323 + for ; + Wed, 30 Aug 2006 15:53:42 -0300 (ADT) +Received: by ug-out-1314.google.com with SMTP id m3so286521ugc + for ; + Wed, 30 Aug 2006 11:53:41 -0700 (PDT) +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:references; + b=iXEGr2Z0AVPB3nioOgaGN0145QRfrgCAyTbwWDGSJuDjzz3gHJWZyhxZS7D+Z+R16PSMLTvgxZec7Iqnl29D7Sq+DrdFtbquvdeIjtyyd5798e9+z7cVIMd9Ve+CtogMIHWHIHMyPREaoRHIPRuNZ9UvKUjmimi8yRlRy6lGfOY= +Received: by 10.66.219.11 with SMTP id r11mr583906ugg; + Wed, 30 Aug 2006 11:53:41 -0700 (PDT) +Received: by 10.67.31.16 with HTTP; Wed, 30 Aug 2006 11:53:41 -0700 (PDT) +Message-ID: <8d04ce990608301153t29f414a0r9f6a42d0cfcfade5@mail.gmail.com> +Date: Wed, 30 Aug 2006 11:53:41 -0700 +From: "Junaili Lie" +To: "Jignesh K. Shah" +Subject: Re: slow i/o +Cc: pgsql-performance@postgresql.org +In-Reply-To: <44F5D61E.6090103@sun.com> +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_48038_1487039.1156964021224" +References: <8d04ce990608281606r153ed796xcf5d9d3a44d8e632@mail.gmail.com> + <44F45900.4000702@sun.com> + <8d04ce990608291056la088194n84280509528a909d@mail.gmail.com> + <44F5D61E.6090103@sun.com> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.337 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/484 +X-Sequence-Number: 20669 + +------=_Part_48038_1487039.1156964021224 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +I have tried this to no avail. +I have also tried changing the bg_writer_delay parameter to 10. The spike in +i/o still occurs although not in a consistent basis and it is only happening +for a few seconds. + + + + +On 8/30/06, Jignesh K. Shah wrote: +> +> The bgwriter parameters changed in 8.1 +> +> Try +> +> bgwriter_lru_maxpages=0 +> bgwriter_lru_percent=0 +> +> to turn off bgwriter and see if there is any change. +> +> -Jignesh +> +> +> Junaili Lie wrote: +> > Hi Jignesh, +> > Thank you for my reply. +> > I have the setting just like what you described: +> > +> > wal_sync_method = fsync +> > wal_buffers = 128 +> > checkpoint_segments = 128 +> > bgwriter_all_percent = 0 +> > bgwriter_maxpages = 0 +> > +> > +> > I ran the dtrace script and found the following: +> > During the i/o busy time, there are postgres processes that has very +> > high BYTES count. During that non i/o busy time, this same process +> > doesn't do a lot of i/o activity. I checked the pg_stat_activity but +> > couldn't found this process. Doing ps revealed that this process is +> > started at the same time since the postgres started, which leads me to +> > believe that it maybe background writer or some other internal process. +> > This process are not autovacuum because it doesn't disappear when I +> > tried turning autovacuum off. +> > Except for the ones mentioned above, I didn't modify the other +> > background setting: +> > MONSOON=# show bgwriter_delay ; +> > bgwriter_delay +> > ---------------- +> > 200 +> > (1 row) +> > +> > MONSOON=# show bgwriter_lru_maxpages ; bgwriter_lru_maxpages +> > ----------------------- +> > 5 +> > (1 row) +> > +> > MONSOON=# show bgwriter_lru_percent ; +> > bgwriter_lru_percent +> > ---------------------- +> > 1 +> > (1 row) +> > +> > This i/o spike only happens at minute 1 and minute 6 (ie. 10.51, 10.56) +> > . If I do select * from pg_stat_activity during this time, I will see a +> > lot of write queries waiting to be processed. After a few seconds, +> > everything seems to be gone. All writes that are not happening at the +> > time of this i/o jump are being processed very fast, thus do not show on +> > pg_stat_activity. +> > +> > Thanks in advance for the reply, +> > Best, +> > +> > J +> > +> > On 8/29/06, *Jignesh K. Shah* > > wrote: +> > +> > Also to answer your real question: +> > +> > DTrace On Solaris 10: +> > +> > # dtrace -s /usr/demo/dtrace/whoio.d +> > +> > It will tell you the pids doing the io activity and on which +> devices. +> > There are more scripts in that directory like iosnoop.d, iotime.d +> > and others which also will give +> > other details like file accessed, time it took for the io etc. +> > +> > Hope this helps. +> > +> > Regards, +> > Jignesh +> > +> > +> > Junaili Lie wrote: +> > > Hi everyone, +> > > We have a postgresql 8.1 installed on Solaris 10. It is running +> fine. +> > > However, for the past couple days, we have seen the i/o reports +> > > indicating that the i/o is busy most of the time. Before this, we +> > only +> > > saw i/o being busy occasionally (very rare). So far, there has +> > been no +> > > performance complaints by customers, and the slow query reports +> > doesn't +> > > indicate anything out of the ordinary. +> > > There's no code changes on the applications layer and no database +> > > configuration changes. +> > > I am wondering if there's a tool out there on Solaris to tell +> which +> > > process is doing most of the i/o activity? +> > > Thank you in advance. +> > > +> > > J +> > > +> > +> > +> + +------=_Part_48038_1487039.1156964021224 +Content-Type: text/html; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +
I have tried this to no avail.
+
I have also tried changing the bg_writer_delay parameter to 10. The spike in i/o still occurs although not in a consistent basis and it is only happening for a few seconds.
+
 
+


 
+
On 8/30/06, Jignesh K. Shah <J.K.Shah@sun.com> wrote: +
The bgwriter parameters changed in 8.1

Try

bgwriter_lru_maxpages=0
bgwriter_lru_percent=0 +

to turn off bgwriter and see if there is any change.

-Jignesh


Junaili Lie wrote:
> Hi Jignesh,
> Thank you for my reply.
> I have the setting just like what you described:
> +
> wal_sync_method = fsync
> wal_buffers = 128
> checkpoint_segments = 128
> bgwriter_all_percent = 0
> bgwriter_maxpages = 0
>
>
> I ran the dtrace script and found the following: +
> During the i/o busy time, there are postgres processes that has very
> high BYTES count. During that non i/o busy time, this same process
> doesn't do a lot of i/o activity. I checked the pg_stat_activity but +
> couldn't found this process. Doing ps revealed that this process is
> started at the same time since the postgres started, which leads me to
> believe that it maybe background writer or some other internal process. +
> This process are not autovacuum because it doesn't disappear when I
> tried turning autovacuum off.
> Except for the ones mentioned above, I didn't modify the other
> background setting:
> MONSOON=# show bgwriter_delay ; +
>  bgwriter_delay
> ----------------
>  200
> (1 row)
>
> MONSOON=# show bgwriter_lru_maxpages ;  bgwriter_lru_maxpages
> -----------------------
>  5
> (1 row)
> +
> MONSOON=# show bgwriter_lru_percent ;
>  bgwriter_lru_percent
> ----------------------
>  1
> (1 row)
>
> This i/o spike only happens at minute 1 and minute 6 (ie. 10.51, 10.56 +)
> . If I do select * from pg_stat_activity during this time, I will see a
> lot of write queries waiting to be processed. After a few seconds,
> everything seems to be gone. All writes that are not happening at the +
> time of this i/o jump are being processed very fast, thus do not show on
> pg_stat_activity.
>
> Thanks in advance for the reply,
> Best,
>
> J
>
> On 8/29/06, *Jignesh K. Shah* < +J.K.Shah@sun.com
> <mailto:J.K.Shah@sun.com>> wrote:
>
>     Also to answer your real question:
>
>     DTrace On Solaris 10: +
>
>     # dtrace -s /usr/demo/dtrace/whoio.d
>
>     It will tell you the pids doing the io activity and  on which devices.
>     There are more scripts in that directory like iosnoop.d, iotime.d +
>     and others which also will give
>     other details like file accessed, time it took for the io etc.
>
>     Hope this helps.
>
>     Regards,
>     Jignesh
>
> +
>     Junaili Lie wrote:
>      > Hi everyone,
>      > We have a postgresql 8.1 installed on Solaris 10. It is running fine.
>      > However, for the past couple days, we have seen the i/o reports +
>      > indicating that the i/o is busy most of the time. Before this, we
>     only
>      > saw i/o being busy occasionally (very rare). So far, there has
>     been no
>      > performance complaints by customers, and the slow query reports +
>     doesn't
>      > indicate anything out of the ordinary.
>      > There's no code changes on the applications layer and no database
>      > configuration changes.
>      > I am wondering if there's a tool out there on Solaris to tell which +
>      > process is doing most of the i/o activity?
>      > Thank you in advance.
>      >
>      > J
>      >
>
>

+ +------=_Part_48038_1487039.1156964021224-- + +From pgsql-performance-owner@postgresql.org Wed Aug 30 19:56:49 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 50D759FB316 + for ; + Wed, 30 Aug 2006 19:56:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 52043-02 for + ; + Wed, 30 Aug 2006 22:56:37 +0000 (UTC) +X-Greylist: delayed 00:31:21.654698 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id BFA1A9FB35F + for ; + Wed, 30 Aug 2006 19:56:35 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from scorpion.sorbs.net (scorpion.sorbs.net [203.15.51.56]) + by svr4.postgresql.org (Postfix) with ESMTP id 96A5B5AF887 + for ; + Wed, 30 Aug 2006 22:25:12 +0000 (GMT) +Received: from scorpion.sorbs.net (localhost [127.0.0.1]) + by scorpion.sorbs.net (Postfix) with ESMTP id 1F786A6CA2 + for ; + Thu, 31 Aug 2006 08:24:59 +1000 (EST) +Received: from mail.sorbs.net (mail.sorbs.net [203.15.51.62]) + by scorpion.sorbs.net (Postfix) with ESMTP id C24B4A6C2D + for ; + Thu, 31 Aug 2006 08:24:58 +1000 (EST) +Received: from [10.200.254.98] (oblivion.isux.com [203.173.10.62]) + by nemesis.sorbs.net + (iPlanet Messaging Server 5.2 HotFix 2.05 (built Mar 3 2005)) + with ESMTPSA id <0J4U00L050XHWS@nemesis.sorbs.net> for + pgsql-performance@postgresql.org; Thu, 31 Aug 2006 08:24:58 +1000 (EST) +Date: Thu, 31 Aug 2006 08:17:46 +1000 +From: Matthew Sullivan +Subject: Re: performance problems. +In-reply-to: +To: pgsql-performance@postgresql.org +Message-id: <44F60E8A.9090700@sorbs.net> +MIME-version: 1.0 +Content-type: text/plain; charset=ISO-8859-1; format=flowed +Content-transfer-encoding: 7BIT +X-Accept-Language: en +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050415 +References: <44F55A7F.40305@sorbs.net> + +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=1.069 tagged_above=0 required=5 tests=SPF_NEUTRAL +X-Spam-Level: * +X-Archive-Number: 200608/485 +X-Sequence-Number: 20670 + +Vivek Khera wrote: + +> +> On Aug 30, 2006, at 5:29 AM, Matthew Sullivan wrote: +> +>> The hardware is a Compaq 6400r with 4G of EDO RAM, 4x500MHz Xeons +>> and a Compaq RAID 3200 in RAID 5 configuration running across 3 +>> spindles (34G total space). +>> +>> The OS is FreeBSD 5.4-RELEASE-p14 +>> The PG Version is 8.1.3 +> +> +> What else does this box do? + +Notihing - it's the developement DB and is dedicated to the development +website - which has a total number of users of '1' ;-) + +> I think you should try these settings, which I use on 4GB dual +> Opteron boxes running FreeBSD 6.x dedicated to Postgres only. Your +> effective_cache_size seems overly optimistic for freebsd. cranking +> up the shared buffers seems to be one of the best bangs for the buck +> under pg 8.1. I recently doubled them and nearly tripled my +> performance on a massive write-mostly (insert/update) load. Unless +> your disk system is *really* slow, random_page_cost should be reduced +> from the default 4. + +I'll give this a try. + +> +> As you can see, I change *very* little from the default config. +> +> +> shared_buffers = 70000 # min 16 or +> max_connections*2, 8KB each +> work_mem = 262144 # min 64, size in KB +> maintenance_work_mem = 524288 # min 1024, size in KB +> +> checkpoint_segments = 256 +> checkpoint_timeout = 900 +> +> effective_cache_size = 27462 # `sysctl -n vfs.hibufspace` +> / 8192 (BLKSZ) +> random_page_cost = 2 +> +> if you're feeling adventurous try these to reduce the checkpoint +> impact on the system: +> +> bgwriter_lru_percent = 2.0 +> bgwriter_lru_maxpages = 40 +> bgwriter_all_percent = 0.666 +> bgwriter_all_maxpages = 40 +> +That might have some impact on the production server (which is also +running PG - but the old DB and RT3) however the new DB is only me in +devel, so I think that it will not have much of an effect (I'll still +try it though) + +Regards, + +Mat + +From pgsql-performance-owner@postgresql.org Wed Aug 30 20:38:10 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id E03439FB3A4 + for ; + Wed, 30 Aug 2006 20:38:08 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 88443-01-5 + for ; + Wed, 30 Aug 2006 20:37:59 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from linda-3.paradise.net.nz (bm-3a.paradise.net.nz + [203.96.152.182]) + by postgresql.org (Postfix) with ESMTP id 4D9F99FB37D + for ; + Wed, 30 Aug 2006 20:37:20 -0300 (ADT) +Received: from smtp-2.paradise.net.nz + (tclsnelb1-src-1.paradise.net.nz [203.96.152.172]) by + linda-3.paradise.net.nz (Paradise.net.nz) with ESMTP id + <0J4U00CSG4A0YB@linda-3.paradise.net.nz> for + pgsql-performance@postgresql.org; Thu, 31 Aug 2006 11:37:13 +1200 (NZST) +Received: from [192.168.1.11] + (218-101-29-170.dsl.clear.net.nz [218.101.29.170]) by + smtp-2.paradise.net.nz (Postfix) with ESMTP id 55CC5323B25; + Thu, 31 Aug 2006 11:36:26 +1200 (NZST) +Date: Thu, 31 Aug 2006 11:36:11 +1200 +From: Mark Kirkwood +Subject: Re: performance problems. +In-reply-to: <44F55A7F.40305@sorbs.net> +To: Matthew Sullivan +Cc: pgsql-performance@postgresql.org +Message-id: <44F620EB.6020206@paradise.net.nz> +MIME-version: 1.0 +Content-type: text/plain; format=flowed; charset=ISO-8859-1 +Content-transfer-encoding: 7bit +User-Agent: Thunderbird 1.5.0.4 (X11/20060704) +References: <44F55A7F.40305@sorbs.net> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.029 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/486 +X-Sequence-Number: 20671 + +Matthew Sullivan wrote: + +> +> The OS is FreeBSD 5.4-RELEASE-p14 +> The PG Version is 8.1.3 +> +> Solutions/tips greatly appreciated. +> + +This won't help this particular query, but 6.1-RELEASE will possibly be +a better performer generally, in particular for your SMP system - e.g. +the vfs layer is no longer under the Giant lock in the 6.x series, so +parallel io should be much better! + +Cheers + +Mark + +From pgsql-performance-owner@postgresql.org Wed Aug 30 21:08:28 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 2306A9FB260 + for ; + Wed, 30 Aug 2006 21:08:28 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 91039-01 for + ; + Wed, 30 Aug 2006 21:08:15 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from net2.micro-automation.com (net2.micro-automation.com + [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 6D8D79FB2FA + for ; + Wed, 30 Aug 2006 20:48:15 -0300 (ADT) +Received: (qmail 25903 invoked from network); 30 Aug 2006 23:48:13 -0000 +Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) + by net2.micro-automation.com with SMTP; 30 Aug 2006 23:48:13 -0000 +In-Reply-To: +References: <44F55A7F.40305@sorbs.net> + +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: +Cc: Matthew Sullivan , + pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Dave Cramer +Subject: Re: performance problems. +Date: Wed, 30 Aug 2006 19:48:12 -0400 +To: Vivek Khera +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.035 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/487 +X-Sequence-Number: 20672 + + +On 30-Aug-06, at 10:10 AM, Vivek Khera wrote: + +> +> On Aug 30, 2006, at 5:29 AM, Matthew Sullivan wrote: +> +>> The hardware is a Compaq 6400r with 4G of EDO RAM, 4x500MHz Xeons +>> and a Compaq RAID 3200 in RAID 5 configuration running across 3 +>> spindles (34G total space). +>> +>> The OS is FreeBSD 5.4-RELEASE-p14 +>> The PG Version is 8.1.3 +> +> What else does this box do? +> +> I think you should try these settings, which I use on 4GB dual +> Opteron boxes running FreeBSD 6.x dedicated to Postgres only. Your +> effective_cache_size seems overly optimistic for freebsd. cranking +> up the shared buffers seems to be one of the best bangs for the +> buck under pg 8.1. I recently doubled them and nearly tripled my +> performance on a massive write-mostly (insert/update) load. Unless +> your disk system is *really* slow, random_page_cost should be +> reduced from the default 4. +> +Actually unless you have a ram disk you should probably leave +random_page_cost at 4, shared buffers should be 2x what you have +here, maintenance work mem is pretty high +effective cache should be much larger 3/4 of 4G or about 360000 + +Setting work _mem this high should be done with caution. From the +manual "Note that for a complex query, several sort or hash +operations might be running in parallel; each one will be allowed to +use as much memory as this value specifies before it starts to put +data into temporary files. Also, several running sessions could be +doing such operations concurrently. So the total memory used could be +many times the value of work_mem" +> As you can see, I change *very* little from the default config. +> +> +> shared_buffers = 70000 # min 16 or +> max_connections*2, 8KB each +> work_mem = 262144 # min 64, size in KB +> maintenance_work_mem = 524288 # min 1024, size in KB +> +> checkpoint_segments = 256 +> checkpoint_timeout = 900 +> +> effective_cache_size = 27462 # `sysctl -n +> vfs.hibufspace` / 8192 (BLKSZ) +> random_page_cost = 2 +> +> if you're feeling adventurous try these to reduce the checkpoint +> impact on the system: +> +> bgwriter_lru_percent = 2.0 +> bgwriter_lru_maxpages = 40 +> bgwriter_all_percent = 0.666 +> bgwriter_all_maxpages = 40 +> +> +> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +> Vivek Khera, Ph.D. MailerMailer, LLC Rockville, MD +> http://www.MailerMailer.com/ +1-301-869-4449 x806 +> +> + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 13:38:15 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id BE3AE9FB300 + for ; + Thu, 31 Aug 2006 13:38:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 15474-03 for + ; + Thu, 31 Aug 2006 13:38:05 -0300 (ADT) +X-Greylist: delayed 00:53:08.678646 by SQLgrey- +Received: from ebrsrv01.ebravo.it + (host53-205-static.34-85-b.business.telecomitalia.it [85.34.205.53]) + by postgresql.org (Postfix) with ESMTP id 9F1609FB303 + for ; + Thu, 31 Aug 2006 13:38:03 -0300 (ADT) +Received: from [192.168.11.103] ([192.168.11.103]) + by ebrsrv01.ebravo.it (8.11.6/8.12.5) with ESMTP id k7VFilh24942 + for ; Thu, 31 Aug 2006 17:44:51 +0200 +Message-ID: <44F7040E.7040805@streppone.it> +Date: Thu, 31 Aug 2006 17:45:18 +0200 +From: Cosimo Streppone +User-Agent: Mozilla Thunderbird 1.5 (X11/20051201) +MIME-Version: 1.0 +To: Pg Performance list +Subject: High concurrency OLTP database performance tuning +Content-Type: text/plain; charset=ISO-8859-15; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO +X-Spam-Level: +X-Archive-Number: 200608/488 +X-Sequence-Number: 20673 + +Good morning, + +I'd like to ask you some advice on pg tuning in a high +concurrency OLTP-like environment. +The application I'm talking about is running on Pg 8.0.1. +Under average users load, iostat and vmstat show that iowait stays +well under 1%. Tables and indexes scan and seek times are also good. +I can be reasonably sure that disk I/O is not the *main* bottleneck +here. + +These OLTP transactions are composed each of 50-1000+ small queries, on +single tables or 2/3 joined tables. Write operations are very frequent, +and done concurrently by many users on the same data. + +Often there are also queries which involve record lookups like: + + SELECT DISTINCT rowid2 FROM table + WHERE rowid1 IN () OR + refrowid1 IN () + +These files are structured with rowid fields which link +other external tables, and the links are fairly complex to follow. +SQL queries and indexes have been carefully(?) built and tested, +each with its own "explain analyze". + +The problem is that under peak load, when n. of concurrent transactions +raises, there is a sensible performance degradation. +I'm looking for tuning ideas/tests. I plan to concentrate, +in priority order, on: + +- postgresql.conf, especially: + effective_cache_size (now 5000) + bgwriter_delay (500) + commit_delay/commit_siblings (default) +- start to use tablespaces for most intensive tables +- analyze the locks situation while queries run +- upgrade to 8.1.n +- convert db partition filesystem to ext2/xfs? + (now ext3+noatime+data=writeback) +- ??? + +Server specs: + 2 x P4 Xeon 2.8 Ghz + 4 Gb RAM + LSI Logic SCSI 2x U320 controller + 6 disks in raid 1 for os, /var, WAL + 14 disks in raid 10 for db on FC connected storage + +Current config is now (the rest is like the default): + max_connections = 100 + shared_buffers = 8192 + work_mem = 8192 + maintenance_work_mem = 262144 + max_fsm_pages = 200000 + max_fsm_relations = 1000 + bgwriter_delay = 500 + fsync = false + wal_buffers = 256 + checkpoint_segments = 32 + effective_cache_size = 5000 + random_page_cost = 2 + +Thanks for your ideas... + +-- +Cosimo + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 14:22:54 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 013AE9FB2A3 + for ; + Thu, 31 Aug 2006 14:22:54 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 21120-01 for + ; + Thu, 31 Aug 2006 14:22:40 -0300 (ADT) +X-Greylist: delayed 00:31:00.54097 by SQLgrey- +Received: from omta18.mta.everyone.net (sitemail2.everyone.net + [216.200.145.36]) + by postgresql.org (Postfix) with ESMTP id 6CA6A9FB3F4 + for ; + Thu, 31 Aug 2006 14:22:38 -0300 (ADT) +Received: from dm17.mta.everyone.net (bigiplb-dsnat [172.16.0.19]) + by omta18.mta.everyone.net (Postfix) with ESMTP id E823A424F6 + for ; + Thu, 31 Aug 2006 09:51:36 -0700 (PDT) +X-Eon-Dm: dm17 +Received: by dm17.mta.everyone.net (EON-AUTHRELAY2 - cbbd48ba) id + dm17.44ee3978.10d462 + for ; Thu, 31 Aug 2006 09:51:34 -0700 +X-Eon-Sig: AQJKldRE9xOW7yxdNAIAAAAB,e7ce9f4ddbc3c7d0d1010dd09032c6b2 +From: "Indika Maligaspe" +To: +Subject: Postgress memory leak with JBoss3.2.6 and large DB +Date: Thu, 31 Aug 2006 22:22:48 +0530 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0009_01C6CD4B.FF2EDB60" +X-Mailer: Microsoft Office Outlook, Build 11.0.5510 +X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 +Thread-Index: AcbNHeN6SitDIZqRQiqu/iuIeYIAkQ== +Message-Id: <20060831095135.4292E9D7@dm17.mta.everyone.net> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE +X-Spam-Level: +X-Archive-Number: 200608/490 +X-Sequence-Number: 20675 + +This is a multi-part message in MIME format. + +------=_NextPart_000_0009_01C6CD4B.FF2EDB60 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit + +Hey guys, + + We are running a Linux 2.4 enterprise edition box with 6GB of RAM, +Postgres 8.0.3. Our applications are running on JBoss 3.2.6. We are having a +Database of over 22GB in size. + +The problem is when we are querying a specific set of table (which all +tables having over 100K of rows), the Postgres user process takes over or +close 700MB of memory. This is just to return 3000 odd rows. Even though we +have lot of data we still do not have that much to eat up this much of +memory. + + + +What I would like to know is, is there any setting in the Postgres or in +Linux that we can tune this with? + + + +Our Postgres.conf file has the following settings, we have been playing +around wit this but still no success. + + + +shared_buffers = 5000 + +effective_cache_size = 10000 + +work_mem = 2048 + +random_page_cost = 2 + + + +A sample of the top command is given below. + + + +12:38:05 up 136 days, 7:06, 10 users, load average: 7.69, 4.83, 3.78 + +459 processes: 458 sleeping, 1 running, 0 zombie, 0 stopped + +CPU states: cpu user nice system irq softirq iowait idle + + total 9.6% 0.0% 1.8% 0.0% 0.0% 88.3% 0.0% + + cpu00 11.3% 0.0% 0.3% 0.0% 0.1% 88.0% 0.0% + + cpu01 8.9% 0.0% 2.5% 0.0% 0.0% 88.4% 0.0% + + cpu02 14.1% 0.0% 2.9% 0.0% 0.0% 82.9% 0.0% + + cpu03 4.1% 0.0% 1.5% 0.1% 0.1% 93.8% 0.0% + +Mem: 6153976k av, 6092084k used, 61892k free, 0k shrd, 6232k +buff + + 4769364k actv, 916224k in_d, 111336k in_c + +Swap: 1052216k av, 761912k used, 290304k free 3036700k +cached + + + + PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND + +19736 postgres 15 0 508M 448M 42840 D 0.9 7.4 0:22 0 postmaster + +19740 postgres 15 0 507M 441M 41428 D 0.8 7.3 0:21 0 postmaster + +19779 postgres 15 0 508M 472M 42828 D 0.8 7.8 0:21 0 postmaster + +19789 postgres 15 0 508M 477M 42412 D 0.6 7.9 0:21 0 postmaster + +19738 postgres 15 0 507M 438M 41852 D 0.4 7.3 0:21 0 postmaster + +14647 postgres 15 0 63948 56M 44236 D 0.1 0.9 0:41 3 postmaster + + + +As you can see the postmaster users are taking way over the memory that +should be taken. + + + +If any of you can give us some pointers we would really appreciate that and +thanks in advance. + + + +Regards + +Indika. + + +------=_NextPart_000_0009_01C6CD4B.FF2EDB60 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + + + + + + + + + +
+ +

Hey guys,

+ +

  We are running a Linux 2.4 enterprise edition = +box +with 6GB of RAM, Postgres 8.0.3. Our applications are running on JBoss = +3.2.6. +We are having a Database of over 22GB in = +size.

+ +

The problem is when we are querying a specific set of = +table +(which all tables having over 100K  of rows), the Postgres user = +process takes +over or close 700MB of memory. This is just to return 3000 odd rows. = +Even +though we have lot of data we still do not have that much to eat up this = +much +of memory.

+ +

 

+ +

What I would like to know is, is there any setting in = +the Postgres +or in Linux that we can tune this with?

+ +

 

+ +

Our Postgres.conf file has the following settings, we = +have +been playing around wit this but still no = +success.

+ +

 

+ +

shared_buffers =3D 5000    = +

+ +

effective_cache_size =3D = +10000    

+ +

work_mem =3D  = +2048           &nb= +sp;           &nbs= +p;       =20 +

+ +

random_page_cost =3D 2   = +

+ +

 

+ +

A sample of the top command is given = +below.

+ +

 

+ +

12:38:05  up 136 days,  7:06, 10 = +users,  load +average: 7.69, 4.83, 3.78

+ +

459 processes: 458 sleeping, 1 running, 0 zombie, 0 = +stopped

+ +

CPU states:  cpu    +user    nice  system    irq  +softirq  iowait    idle

+ +

         = +  +total    9.6%    0.0%    +1.8%   0.0%     0.0%   +88.3%    0.0%

+ +

         = +  +cpu00   11.3%    0.0%    +0.3%   0.0%     0.1%   +88.0%    0.0%

+ +

         = +  +cpu01    8.9%    0.0%    +2.5%   0.0%     0.0%   +88.4%    0.0%

+ +

         = +  +cpu02   14.1%    0.0%    +2.9%   0.0%     0.0%   +82.9%    0.0%

+ +

         = +  +cpu03    4.1%    0.0%    +1.5%   0.1%     0.1%   +93.8%    0.0%

+ +

Mem:  6153976k av, 6092084k used,   = +61892k +free,       0k shrd,    = +6232k buff

+ +

         = +          +4769364k actv,  916224k in_d,  111336k = +in_c

+ +

Swap: 1052216k av,  761912k used,  290304k +free           &nb= +sp;     +3036700k cached

+ +

 

+ +

  PID USER     PRI  = +NI  +SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU = +COMMAND

+ +

19736 postgres  15   0  508M 448M = +42840 +D     0.9  7.4   0:22   0 +postmaster

+ +

19740 postgres  15   0  507M 441M = +41428 +D     0.8  7.3   0:21   0 +postmaster

+ +

19779 postgres  15   0  508M 472M = +42828 +D     0.8  7.8   0:21   0 +postmaster

+ +

19789 postgres  15   0  508M 477M = +42412 +D     0.6  7.9   0:21   0 +postmaster

+ +

19738 postgres  15   0  507M 438M = +41852 +D     0.4  7.3   0:21   0 +postmaster

+ +

14647 postgres  15   0 63948  56M = +44236 +D     0.1  0.9   0:41   3 +postmaster

+ +

 

+ +

As you can see the postmaster users are taking way = +over the +memory that should be taken.

+ +

 

+ +

If any of you can give us some pointers we would = +really appreciate +that and thanks in advance.

+ +

 

+ +

Regards

+ +

Indika.

+ +
+ + + + + +------=_NextPart_000_0009_01C6CD4B.FF2EDB60-- + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 14:06:47 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 5FF129FB2FA + for ; + Thu, 31 Aug 2006 14:06:46 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 98047-10 for + ; + Thu, 31 Aug 2006 17:06:43 +0000 (UTC) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from wr-out-0506.google.com (wr-out-0506.google.com + [64.233.184.227]) + by postgresql.org (Postfix) with ESMTP id 6E5219FB210 + for ; + Thu, 31 Aug 2006 14:06:30 -0300 (ADT) +Received: by wr-out-0506.google.com with SMTP id i32so266203wra + for ; + Thu, 31 Aug 2006 10:06:29 -0700 (PDT) +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=uSS3vQSJx721ik2FzEaW3QsbZi0nWdvliZ68on/A9dvXib0AvwROUKlWJtRfWFGKluWUk/unow+4C2WiwvZrLe0hYOuLAVDFeNjglz3+N5zW12BXA7nN1BVFA2r1qb701Sah4i4dn3aDWfrFi7zsPy8dujmpBC4Z+u9fzdiVqkA= +Received: by 10.90.106.18 with SMTP id e18mr264158agc; + Thu, 31 Aug 2006 10:06:29 -0700 (PDT) +Received: by 10.90.27.1 with HTTP; Thu, 31 Aug 2006 10:06:29 -0700 (PDT) +Message-ID: <1d4e0c10608311006n259e2fabm5d70b420040ea2e0@mail.gmail.com> +Date: Thu, 31 Aug 2006 19:06:29 +0200 +From: "Guillaume Smet" +To: "Cosimo Streppone" +Subject: Re: High concurrency OLTP database performance tuning +Cc: "Pg Performance list" +In-Reply-To: <44F7040E.7040805@streppone.it> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44F7040E.7040805@streppone.it> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 + tests=DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/489 +X-Sequence-Number: 20674 + +Cosimo, + +On 8/31/06, Cosimo Streppone wrote: +> The problem is that under peak load, when n. of concurrent transactions +> raises, there is a sensible performance degradation. + +Could you give us more information about the performance degradation? +Especially cpu load/iostat/vmstat data when the problem occurs can be +interesting. + +-- +Guillaume + +From pgsql-performance-owner@postgresql.org Thu Aug 31 14:32:23 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 63AB19FB3FD + for ; + Thu, 31 Aug 2006 14:32:22 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 22418-01 for + ; + Thu, 31 Aug 2006 14:32:18 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 5E3FD9FB2FC + for ; + Thu, 31 Aug 2006 14:32:18 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from shell.wgops.com (free.wgops.com [69.51.116.66]) + by svr4.postgresql.org (Postfix) with ESMTP id 775D85AF8F9 + for ; + Thu, 31 Aug 2006 17:32:17 +0000 (GMT) +Received: from [10.1.2.206] (localhost [127.0.0.1]) + by shell.wgops.com (Postfix) with ESMTP id 655292570C; + Thu, 31 Aug 2006 11:32:03 -0600 (MDT) +Date: Thu, 31 Aug 2006 11:32:00 -0600 +From: Michael Loftis +To: Cosimo Streppone , + Pg Performance list +Subject: Re: High concurrency OLTP database performance tuning +Message-ID: +In-Reply-To: <44F7040E.7040805@streppone.it> +References: <44F7040E.7040805@streppone.it> +X-Mailer: Mulberry/4.0.4 (Mac OS X) +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +X-MailScanner-Information: Please contact support@wgops.com +X-MailScanner: WGOPS clean +X-MailScanner-From: mloftis@wgops.com +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.739 tagged_above=0 required=5 tests=AWL, SPF_FAIL +X-Spam-Level: +X-Archive-Number: 200608/491 +X-Sequence-Number: 20676 + + + +--On August 31, 2006 5:45:18 PM +0200 Cosimo Streppone + wrote: + +> Good morning, + +> - postgresql.conf, especially: +> effective_cache_size (now 5000) +> bgwriter_delay (500) +> commit_delay/commit_siblings (default) + +commit delay and siblings should be turned up, also you'll want to probably +increase log_segments, unless you're not getting any warnings about it. +also increase shared_buffers. i'd also make sure write caching is on on +the RAID arrays as long as they're battery backed caches. + +> - start to use tablespaces for most intensive tables +> - analyze the locks situation while queries run +> - upgrade to 8.1.n +> - convert db partition filesystem to ext2/xfs? +> (now ext3+noatime+data=writeback) +> - ??? +> +> Server specs: +> 2 x P4 Xeon 2.8 Ghz +> 4 Gb RAM +> LSI Logic SCSI 2x U320 controller +> 6 disks in raid 1 for os, /var, WAL +> 14 disks in raid 10 for db on FC connected storage +> +> Current config is now (the rest is like the default): +> max_connections = 100 +> shared_buffers = 8192 +> work_mem = 8192 +> maintenance_work_mem = 262144 +> max_fsm_pages = 200000 +> max_fsm_relations = 1000 +> bgwriter_delay = 500 +> fsync = false +> wal_buffers = 256 +> checkpoint_segments = 32 +> effective_cache_size = 5000 +> random_page_cost = 2 +> +> Thanks for your ideas... +> +> -- +> Cosimo +> +> +> ---------------------------(end of broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + + + +-- +"Genius might be described as a supreme capacity for getting its possessors +into trouble of all kinds." +-- Samuel Butler + +From pgsql-performance-owner@postgresql.org Thu Aug 31 14:46:37 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 693CE9FB416 + for ; + Thu, 31 Aug 2006 14:46:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 11288-08-2 + for ; + Thu, 31 Aug 2006 14:46:33 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey- +Received: from nz-out-0102.google.com (nz-out-0102.google.com + [64.233.162.195]) + by postgresql.org (Postfix) with ESMTP id 912BA9FB3F4 + for ; + Thu, 31 Aug 2006 14:42:07 -0300 (ADT) +Received: by nz-out-0102.google.com with SMTP id 14so527738nzn + for ; + Thu, 31 Aug 2006 10:42:06 -0700 (PDT) +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=YVnNGkLbQycwIjS0cqM0cJAvFAWwzbLITy9CuoIlSA8LVgMJYBjW6ppuk8IVq848EylR8KpkcR5IhCubj3dudW3kOTVOTMi+SHOtdn7VJqMANJJP/wdy2zwna8iu4EsArUuFn30oMiy4tns3otubY/R5/fzKDh0DBHKHYHMGu3w= +Received: by 10.65.219.4 with SMTP id w4mr1557799qbq; + Thu, 31 Aug 2006 10:42:06 -0700 (PDT) +Received: by 10.65.137.12 with HTTP; Thu, 31 Aug 2006 10:42:06 -0700 (PDT) +Message-ID: +Date: Thu, 31 Aug 2006 13:42:06 -0400 +From: "Merlin Moncure" +To: "Cosimo Streppone" +Subject: Re: High concurrency OLTP database performance tuning +Cc: "Pg Performance list" +In-Reply-To: <44F7040E.7040805@streppone.it> +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit +Content-Disposition: inline +References: <44F7040E.7040805@streppone.it> +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.305 tagged_above=0 required=5 tests=AWL, + DNS_FROM_RFC_ABUSE, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/492 +X-Sequence-Number: 20677 + +On 8/31/06, Cosimo Streppone wrote: +> Good morning, +> - postgresql.conf, especially: +> effective_cache_size (now 5000) +> bgwriter_delay (500) +> commit_delay/commit_siblings (default) + +while thse settings may help, don't expect too much. ditto shared +buffers. your fsync is false btw. the major gotcha in high +transaction volume systems is stats_command_string (leave it off). + +> - start to use tablespaces for most intensive tables +this is an i/o optimization mostly. again, dont expect much. + +> - analyze the locks situation while queries run +> - upgrade to 8.1.n +absolutely you want to do this. when I moved my converted isam +projects which dont sound too far from your workload, I saw a huge +speed increase with 8.1. + +> - convert db partition filesystem to ext2/xfs? +> (now ext3+noatime+data=writeback) +> - ??? + +meh. :-) + +I think application level improvements are the name of the game here. +Make sure your application or middleware is using the parameterized +query interface in libpq. + +Another possible optimiation is to attempt application level caching +in conjunction with some server side locking, Since details are +light, only general hints are possible :) + +consider move to opteron or intel woodcrest platform. a single opteron +170 will easily beat your two xeons, and 2x270 will be a whole new +world. woodcrests are great as well if you can get them. + +also, if you are not already on a *nix kernel, get yourself on one. + +Merlin + +From pgsql-performance-owner@postgresql.org Thu Aug 31 15:23:48 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 5A2479FB3F2 + for ; + Thu, 31 Aug 2006 15:23:48 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 43290-04-3 + for ; + Thu, 31 Aug 2006 15:23:37 -0300 (ADT) +X-Greylist: delayed 00:32:42.454281 by SQLgrey- +Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) + by postgresql.org (Postfix) with ESMTP id 52F859FB3CF + for ; + Thu, 31 Aug 2006 15:23:15 -0300 (ADT) +X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 +Received: from smtp.savagebeast.com (unknown [63.81.120.10]) + by svr4.postgresql.org (Postfix) with ESMTP id 726A55AF8AB + for ; + Thu, 31 Aug 2006 17:50:27 +0000 (GMT) +Received: from [172.16.100.6] (tailfly.SavageBeast.com [172.16.100.6]) + by smtp.savagebeast.com (Postfix) with ESMTP id 674487AE3; + Thu, 31 Aug 2006 10:50:17 -0700 (PDT) +In-Reply-To: <44F7040E.7040805@streppone.it> +References: <44F7040E.7040805@streppone.it> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <51B18701-D868-4705-9350-DFEED059D197@pandora.com> +Cc: Pg Performance list +Content-Transfer-Encoding: 7bit +From: Casey Duncan +Subject: Re: High concurrency OLTP database performance tuning +Date: Thu, 31 Aug 2006 10:50:14 -0700 +To: Cosimo Streppone +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/498 +X-Sequence-Number: 20683 + +It will be very important to determine if as performance degrades you +are either i/o bound, cpu bound or hindered by some other contention +(db locks, context switching, etc). + +Try turning on statement duration logging for all statments or "slow" +statments (like those over 100ms or some arbitrary threshold). Either +eyeball or write a script to see which statement(s) are frequently +slowest. This can greatly aid in tuning. + +You say the db is write intensive. In what way, inserts or updates? +The former tend to be much cheaper than the latter. If the latter are +things being adequately vacuumed? loss of dead tuple space can really +hurt performance. If you have lots of concurrent writes, commit_delay/ +commit_siblings can help, as can increasing checkpoint_segments +further. I see you have fsync off, are you feeling lucky? ;^) + +If you are i/o bound see what the disks are doing. How fast are they +reading/writing? How close are they to their max throughput? +Typically I find the disks are nowhere near that due to excessive +seeking. If that's the case you can typically only fix it by putting +more of the DB in RAM -- buy more RAM, crank up shared_buffers I +would say double what you have it, maybe more (much more with 8.1), +or by arranging the data better on disk (clustering, denormalizing +data, putting tables and indices on different disks, etc). + +-Casey + + +On Aug 31, 2006, at 8:45 AM, Cosimo Streppone wrote: + +> Good morning, +> +> I'd like to ask you some advice on pg tuning in a high +> concurrency OLTP-like environment. +> The application I'm talking about is running on Pg 8.0.1. +> Under average users load, iostat and vmstat show that iowait stays +> well under 1%. Tables and indexes scan and seek times are also good. +> I can be reasonably sure that disk I/O is not the *main* bottleneck +> here. +> +> These OLTP transactions are composed each of 50-1000+ small +> queries, on +> single tables or 2/3 joined tables. Write operations are very +> frequent, +> and done concurrently by many users on the same data. +> +> Often there are also queries which involve record lookups like: +> +> SELECT DISTINCT rowid2 FROM table +> WHERE rowid1 IN () OR +> refrowid1 IN () +> +> These files are structured with rowid fields which link +> other external tables, and the links are fairly complex to follow. +> SQL queries and indexes have been carefully(?) built and tested, +> each with its own "explain analyze". +> +> The problem is that under peak load, when n. of concurrent +> transactions +> raises, there is a sensible performance degradation. +> I'm looking for tuning ideas/tests. I plan to concentrate, +> in priority order, on: +> +> - postgresql.conf, especially: +> effective_cache_size (now 5000) +> bgwriter_delay (500) +> commit_delay/commit_siblings (default) +> - start to use tablespaces for most intensive tables +> - analyze the locks situation while queries run +> - upgrade to 8.1.n +> - convert db partition filesystem to ext2/xfs? +> (now ext3+noatime+data=writeback) +> - ??? +> +> Server specs: +> 2 x P4 Xeon 2.8 Ghz +> 4 Gb RAM +> LSI Logic SCSI 2x U320 controller +> 6 disks in raid 1 for os, /var, WAL +> 14 disks in raid 10 for db on FC connected storage +> +> Current config is now (the rest is like the default): +> max_connections = 100 +> shared_buffers = 8192 +> work_mem = 8192 +> maintenance_work_mem = 262144 +> max_fsm_pages = 200000 +> max_fsm_relations = 1000 +> bgwriter_delay = 500 +> fsync = false +> wal_buffers = 256 +> checkpoint_segments = 32 +> effective_cache_size = 5000 +> random_page_cost = 2 +> +> Thanks for your ideas... +> +> -- +> Cosimo +> +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 14:54:57 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6A49B9FB2FC + for ; + Thu, 31 Aug 2006 14:54:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 10851-05 for + ; + Thu, 31 Aug 2006 17:54:49 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id B74359FB210 + for ; + Thu, 31 Aug 2006 14:54:47 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7VHslVx021865; + Thu, 31 Aug 2006 13:54:47 -0400 (EDT) +To: "Indika Maligaspe" +cc: pgsql-performance@postgresql.org +Subject: Re: Postgress memory leak with JBoss3.2.6 and large DB +In-reply-to: <20060831095135.4292E9D7@dm17.mta.everyone.net> +References: <20060831095135.4292E9D7@dm17.mta.everyone.net> +Comments: In-reply-to "Indika Maligaspe" + message dated "Thu, 31 Aug 2006 22:22:48 +0530" +Date: Thu, 31 Aug 2006 13:54:47 -0400 +Message-ID: <21864.1157046887@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/493 +X-Sequence-Number: 20678 + +"Indika Maligaspe" writes: +> The problem is when we are querying a specific set of table (which all +> tables having over 100K of rows), the Postgres user process takes over or +> close 700MB of memory. This is just to return 3000 odd rows. Even though we +> have lot of data we still do not have that much to eat up this much of +> memory. + +Playing with server-side settings won't have the slightest effect on a +client-side problem. I'd suggest asking about this on the pgsql-jdbc +list; they are more likely to have useful suggestions than backend +hackers will. + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 31 15:11:20 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 30ECB9FB428 + for ; + Thu, 31 Aug 2006 15:11:19 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 36199-03-3 + for ; + Thu, 31 Aug 2006 15:11:07 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 272499FB425 + for ; + Thu, 31 Aug 2006 15:10:58 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id 5FB04B814 + for ; + Thu, 31 Aug 2006 14:10:56 -0400 (EDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <20060830162657.GD81373@pervasive.com> +References: <44F55A7F.40305@sorbs.net> + + <20060830162657.GD81373@pervasive.com> +Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-5-499513155; + protocol="application/pkcs7-signature" +Message-Id: +From: Vivek Khera +Subject: Re: performance problems. +Date: Thu, 31 Aug 2006 14:10:55 -0400 +To: "Pgsql-Performance ((((E-mail))))" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/494 +X-Sequence-Number: 20679 + + +--Apple-Mail-5-499513155 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 30, 2006, at 12:26 PM, Jim C. Nasby wrote: + +> You misunderstand how effective_cache_size is used. It's the *only* +> memory factor that plays a role in cost estimator functions. This +> means +> it should include the memory set aside for caching in shared_buffers. +> +> Also, hibufspace is only talking about filesystem buffers in FreeBSD, +> which AFAIK has nothing to do with total memory available for caching, +> since VM pages are also used to cache data. +> + +Curious... See Message-ID: <20031011092308.GA39942@perrin.nxad.com> +from the October 2003 archives. (I'd provide a full link to it, but +the http://archives.postgresql.org/pgsql-performance/ archives are +botched -- only some posts are on the browsable archive but it is all +in the raw mailbox download, so that's the only way to get the full +message.) It reads in part: + +From: Sean Chittenden +Date: Sat, 11 Oct 2003 02:23:08 -0700 + + [...] + > echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))" + > + > I've used it for my dedicated servers. Is this calculation correct? + +Yes, or it's real close at least. vfs.hibufspace is the amount of +kernel space that's used for caching IO operations (minus the +necessary space taken for the kernel). If you're real paranoid, you +could do some kernel profiling and figure out how much of the cache is +actually disk IO and multiply the above by some percentage, say 80%? +I haven't found it necessary to do so yet. Since hibufspace is all IO +and caching any net activity is kinda pointless and I assume that 100% +of it is used for a disk cache and don't use a multiplier. The 8192, +however, is the size of a PG page, so, if you tweak PG's page size, +you have to change this constant (*grumbles*). + +--END QUOTE-- + +Given who Sean is, I tend to believe him. Whether this is still +valid for FreeBSD 6.x, I'm unable to verify. + +> Basically, your best bet for setting effective_cache_size is to use +> the +> total memory in the machine, and substract some overhead for the OS +> and +> other processes. I'll typically subtract 1G. + +I'll give this a whirl and see if it helps. + +Any opinions on using the FreeBSD sysctl kern.ipc.shm_use_phys to +bypass the VM system for shared pages? + + +--Apple-Mail-5-499513155 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MzExODEwNTZa +MCMGCSqGSIb3DQEJBDEWBBTI79gpiyTXQoWoiDJEgYtjVuKr+jCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAF+Vr+ZD1jdKCM4XJ +cqghLTuaQoZvC9cdYxDKulneeYpmRL+zg0MClzjo/pd2hQokZQYg9wZfxrPOwAUmTTGirdIIf+tn +MkP0yoQL41GC0+XNGzIEL6ukdNZmoZaWNF+YOrGwzxRmnGuShirCoFIqTNo1//IFHXkl7AI2Z4VY +0CE5/l7y0v1VJJBZudp1Jn8E56HmhTVSbDoCrIUtoYmKERAwUZUoFlqQ/s74MOlAaPWq10Ba/oA1 +UeMy/Oe88A0ljCUxmUtHP0WEkTn/UMJwMnwFZJINNYIdW8sP6hw9niBKBuxIv2s6/ad5PoHFi5H6 +dJRnkC36i4rpz+2o+y9DFQAAAAAAAA== + +--Apple-Mail-5-499513155-- + +From pgsql-performance-owner@postgresql.org Thu Aug 31 15:11:26 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 229FA9FB421 + for ; + Thu, 31 Aug 2006 15:11:26 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 28076-07-2 + for ; + Thu, 31 Aug 2006 15:11:14 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from net2.micro-automation.com (net2.micro-automation.com + [64.7.141.29]) by postgresql.org (Postfix) with SMTP id DFB1B9FB415 + for ; + Thu, 31 Aug 2006 15:11:05 -0300 (ADT) +Received: (qmail 5314 invoked from network); 31 Aug 2006 18:11:05 -0000 +Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) + by net2.micro-automation.com with SMTP; 31 Aug 2006 18:11:05 -0000 +In-Reply-To: <21864.1157046887@sss.pgh.pa.us> +References: <20060831095135.4292E9D7@dm17.mta.everyone.net> + <21864.1157046887@sss.pgh.pa.us> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <7F1AB951-EF24-427A-A282-22684E520CA1@fastcrypt.com> +Cc: "Indika Maligaspe" , + pgsql-performance@postgresql.org +Content-Transfer-Encoding: 7bit +From: Dave Cramer +Subject: Re: Postgress memory leak with JBoss3.2.6 and large DB +Date: Thu, 31 Aug 2006 14:11:03 -0400 +To: Tom Lane +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.044 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/495 +X-Sequence-Number: 20680 + + +On 31-Aug-06, at 1:54 PM, Tom Lane wrote: + +> "Indika Maligaspe" writes: +>> The problem is when we are querying a specific set of table (which +>> all +>> tables having over 100K of rows), the Postgres user process takes +>> over or +>> close 700MB of memory. This is just to return 3000 odd rows. Even +>> though we +>> have lot of data we still do not have that much to eat up this +>> much of +>> memory. +> +> Playing with server-side settings won't have the slightest effect on a +> client-side problem. I'd suggest asking about this on the pgsql-jdbc +> list; they are more likely to have useful suggestions than backend +> hackers will. + +What is the query here. I doubt this is a client side problem, as we +are still looking at the server side processes, not the java +processes here. + +Also your memory settings are *way* too low +Dave +> +> regards, tom lane +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 1: if posting/reading through Usenet, please send an appropriate +> subscribe-nomail command to majordomo@postgresql.org so that +> your +> message can get through to the mailing list cleanly +> + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 15:13:57 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 0FD699FB2A3 + for ; + Thu, 31 Aug 2006 15:13:57 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 26003-04-7 + for ; + Thu, 31 Aug 2006 15:13:47 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from net2.micro-automation.com (net2.micro-automation.com + [64.7.141.29]) by postgresql.org (Postfix) with SMTP id CE9869FB3E6 + for ; + Thu, 31 Aug 2006 15:13:42 -0300 (ADT) +Received: (qmail 5394 invoked from network); 31 Aug 2006 18:13:41 -0000 +Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) + by net2.micro-automation.com with SMTP; 31 Aug 2006 18:13:41 -0000 +In-Reply-To: <44F7040E.7040805@streppone.it> +References: <44F7040E.7040805@streppone.it> +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <321C8D0A-243F-48A1-AF90-C4EE37E408B4@fastcrypt.com> +Cc: Pg Performance list +Content-Transfer-Encoding: 7bit +From: Dave Cramer +Subject: Re: High concurrency OLTP database performance tuning +Date: Thu, 31 Aug 2006 14:13:40 -0400 +To: Cosimo Streppone +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/496 +X-Sequence-Number: 20681 + + +On 31-Aug-06, at 11:45 AM, Cosimo Streppone wrote: + +> Good morning, +> +> I'd like to ask you some advice on pg tuning in a high +> concurrency OLTP-like environment. +> The application I'm talking about is running on Pg 8.0.1. +> Under average users load, iostat and vmstat show that iowait stays +> well under 1%. Tables and indexes scan and seek times are also good. +> I can be reasonably sure that disk I/O is not the *main* bottleneck +> here. +> +> These OLTP transactions are composed each of 50-1000+ small +> queries, on +> single tables or 2/3 joined tables. Write operations are very +> frequent, +> and done concurrently by many users on the same data. +> +> Often there are also queries which involve record lookups like: +> +> SELECT DISTINCT rowid2 FROM table +> WHERE rowid1 IN () OR +> refrowid1 IN () +> +> These files are structured with rowid fields which link +> other external tables, and the links are fairly complex to follow. +> SQL queries and indexes have been carefully(?) built and tested, +> each with its own "explain analyze". +> +> The problem is that under peak load, when n. of concurrent +> transactions +> raises, there is a sensible performance degradation. +> I'm looking for tuning ideas/tests. I plan to concentrate, +> in priority order, on: +> +> - postgresql.conf, especially: +> effective_cache_size (now 5000) +> bgwriter_delay (500) +> commit_delay/commit_siblings (default) +> - start to use tablespaces for most intensive tables +> - analyze the locks situation while queries run +> - upgrade to 8.1.n +> - convert db partition filesystem to ext2/xfs? +> (now ext3+noatime+data=writeback) +> - ??? +> +> Server specs: +> 2 x P4 Xeon 2.8 Ghz +> 4 Gb RAM +> LSI Logic SCSI 2x U320 controller +> 6 disks in raid 1 for os, /var, WAL +> 14 disks in raid 10 for db on FC connected storage +> +> Current config is now (the rest is like the default): +> max_connections = 100 +> shared_buffers = 8192 +way too low, shared buffers should be 50k +> work_mem = 8192 +> maintenance_work_mem = 262144 + +> max_fsm_pages = 200000 +why ? +> max_fsm_relations = 1000 +> bgwriter_delay = 500 +> fsync = false +you will lose data with this! +> wal_buffers = 256 +> checkpoint_segments = 32 +> effective_cache_size = 5000 +way too low should be on the order of 300k +> random_page_cost = 2 +again why ? +> +> Thanks for your ideas... +> +> -- +> Cosimo +> +> +> ---------------------------(end of +> broadcast)--------------------------- +> TIP 4: Have you searched our list archives? +> +> http://archives.postgresql.org +> + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 15:15:36 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 6FAD09FB413 + for ; + Thu, 31 Aug 2006 15:15:36 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 23124-07-2 + for ; + Thu, 31 Aug 2006 18:15:27 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 29B9C9FB42B + for ; + Thu, 31 Aug 2006 15:15:16 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id 8C1D5B814 + for ; + Thu, 31 Aug 2006 14:15:15 -0400 (EDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: +References: <44F55A7F.40305@sorbs.net> + + +Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-6-499772001; + protocol="application/pkcs7-signature" +Message-Id: +From: Vivek Khera +Subject: Re: performance problems. +Date: Thu, 31 Aug 2006 14:15:14 -0400 +To: "Pgsql-Performance ((((E-mail))))" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= +X-Spam-Level: +X-Archive-Number: 200608/497 +X-Sequence-Number: 20682 + + +--Apple-Mail-6-499772001 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 30, 2006, at 7:48 PM, Dave Cramer wrote: + +> Actually unless you have a ram disk you should probably leave +> random_page_cost at 4, shared buffers should be 2x what you have +> here, maintenance work mem is pretty high +> effective cache should be much larger 3/4 of 4G or about 360000 +> + +I've been pondering bumping up SHM settings more, but it is a very +big imposition to have to restart the production server to do so. +This weekend being a long weekend might be a good opportunity to try +it, though... + +As for maintenence mem, when you have HUGE tables, you want to give a +lot of memory to vacuum. With 4GB of RAM giving it 512MB is not an +issue. + +The effective cache size is the big issue with FreeBSD. There are +opposing claims of how much memory it will use for cache, and throw +in the kern.ipc.shm_use_phys sysctl which causes SHM to bypass the VM +system entirely, and who knows what's going on. + +> Setting work _mem this high should be done with caution. From the +> manual "Note that for a complex query, several sort or hash +> operations might be running in parallel; each one will be allowed +> to use as much memory as this value specifies before it starts to +> put data into temporary files. Also, several running sessions could +> be doing such operations concurrently. So the total memory used +> could be many times the value of work_mem" + +Again, with boat-loads of RAM why not let the queries use it? We +only have a handful of connections at a time so that's not eating up +much memory... + + +--Apple-Mail-6-499772001 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MzExODE1MTVa +MCMGCSqGSIb3DQEJBDEWBBRfFrvtyEfuq0tH8J91yGS9cBkGEDCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAbrKEoKDj8mG2qPU1 +AXinVSigOYx4XNqzzTQNHZqbaedp199yDpEMmXNglh7IY13UuuDrI9vzAOxt0f6Dl/pIg/K38p3q +ZkfsrZ7/k2Md6FOFsIUMOWxaOSwhK+WXeB3CR1tcIMW7LlUXHtwlpPRruSwcMTUpabhqo+YjE0jY +5cNs2Pm4NYAzmqdwHdFdmebmVQFMl0V4zI4PRUaHx4oD5xDPctOtOaLZLm+3uqPqiqVtl2bqid+k +XfQ5Kq7Jt2JWAz2/qcUsmVMFpAck3nOHqQLAzD9Xfuzps9LVV4pvC10Xw/1fwp5lRr+z6bi4DbI2 +JcSMLpZhHOuLIYcJqDUMSgAAAAAAAA== + +--Apple-Mail-6-499772001-- + +From pgsql-performance-owner@postgresql.org Thu Aug 31 15:28:41 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 1318E9FA418 + for ; + Thu, 31 Aug 2006 15:28:41 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 37526-06 for + ; + Thu, 31 Aug 2006 15:28:34 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from net2.micro-automation.com (net2.micro-automation.com + [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 1A9629FB3D6 + for ; + Thu, 31 Aug 2006 15:28:33 -0300 (ADT) +Received: (qmail 5557 invoked from network); 31 Aug 2006 18:28:33 -0000 +Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) + by net2.micro-automation.com with SMTP; 31 Aug 2006 18:28:33 -0000 +In-Reply-To: +References: <44F55A7F.40305@sorbs.net> + + + +Mime-Version: 1.0 (Apple Message framework v752.2) +Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +Message-Id: <43D1B021-7BDB-4CC4-BB7A-A6DFDAEF1537@fastcrypt.com> +Cc: "Pgsql-Performance ((((E-mail))))" +Content-Transfer-Encoding: 7bit +From: Dave Cramer +Subject: Re: performance problems. +Date: Thu, 31 Aug 2006 14:28:31 -0400 +To: Vivek Khera +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL, SPF_PASS +X-Spam-Level: +X-Archive-Number: 200608/499 +X-Sequence-Number: 20684 + + +On 31-Aug-06, at 2:15 PM, Vivek Khera wrote: + +> +> On Aug 30, 2006, at 7:48 PM, Dave Cramer wrote: +> +>> Actually unless you have a ram disk you should probably leave +>> random_page_cost at 4, shared buffers should be 2x what you have +>> here, maintenance work mem is pretty high +>> effective cache should be much larger 3/4 of 4G or about 360000 +>> +> +> I've been pondering bumping up SHM settings more, but it is a very +> big imposition to have to restart the production server to do so. +> This weekend being a long weekend might be a good opportunity to +> try it, though... +> +> As for maintenence mem, when you have HUGE tables, you want to give +> a lot of memory to vacuum. With 4GB of RAM giving it 512MB is not +> an issue. +> +> The effective cache size is the big issue with FreeBSD. There are +> opposing claims of how much memory it will use for cache, and throw +> in the kern.ipc.shm_use_phys sysctl which causes SHM to bypass the +> VM system entirely, and who knows what's going on. + +Yes, I have to admit, the setting I proposed works well for linux, +but may not for bsd. +> +>> Setting work _mem this high should be done with caution. From the +>> manual "Note that for a complex query, several sort or hash +>> operations might be running in parallel; each one will be allowed +>> to use as much memory as this value specifies before it starts to +>> put data into temporary files. Also, several running sessions +>> could be doing such operations concurrently. So the total memory +>> used could be many times the value of work_mem" +> +> Again, with boat-loads of RAM why not let the queries use it? We +> only have a handful of connections at a time so that's not eating +> up much memory... +> +As long as you are aware of the ramifications.... + + +From pgsql-performance-owner@postgresql.org Thu Aug 31 16:08:14 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (wm.hub.org [200.46.204.128]) + by postgresql.org (Postfix) with ESMTP id 0C5DE9FB3F6 + for ; + Thu, 31 Aug 2006 16:08:14 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) + with ESMTP id 73785-02 for + ; + Thu, 31 Aug 2006 19:08:06 +0000 (UTC) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) + by postgresql.org (Postfix) with ESMTP id 0BB699FB3ED + for ; + Thu, 31 Aug 2006 16:08:04 -0300 (ADT) +Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) + by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k7VJ83tv022782; + Thu, 31 Aug 2006 15:08:03 -0400 (EDT) +To: Vivek Khera +cc: "Pgsql-Performance ((((E-mail))))" +Subject: Re: performance problems. +In-reply-to: +References: <44F55A7F.40305@sorbs.net> + + <20060830162657.GD81373@pervasive.com> + +Comments: In-reply-to Vivek Khera + message dated "Thu, 31 Aug 2006 14:10:55 -0400" +Date: Thu, 31 Aug 2006 15:08:03 -0400 +Message-ID: <22781.1157051283@sss.pgh.pa.us> +From: Tom Lane +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Archive-Number: 200608/500 +X-Sequence-Number: 20685 + +Vivek Khera writes: +> Curious... See Message-ID: <20031011092308.GA39942@perrin.nxad.com> +> from the October 2003 archives. (I'd provide a full link to it, but +> the http://archives.postgresql.org/pgsql-performance/ archives are +> botched -- + +Still? I found it easily enough with a search for 'hibufspace': +http://archives.postgresql.org/pgsql-performance/2003-10/msg00383.php + + regards, tom lane + +From pgsql-performance-owner@postgresql.org Thu Aug 31 16:49:05 2006 +X-Original-To: pgsql-performance-postgresql.org@postgresql.org +Received: from localhost (mx1.hub.org [200.46.208.251]) + by postgresql.org (Postfix) with ESMTP id 102F09FB448 + for ; + Thu, 31 Aug 2006 16:49:04 -0300 (ADT) +Received: from postgresql.org ([200.46.204.71]) + by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) + with ESMTP id 74597-07-2 + for ; + Thu, 31 Aug 2006 16:48:49 -0300 (ADT) +X-Greylist: from auto-whitelisted by SQLgrey- +Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) + by postgresql.org (Postfix) with ESMTP id 8B9959FB46F + for ; + Thu, 31 Aug 2006 16:40:40 -0300 (ADT) +Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) + by yertle.kcilink.com (Postfix) with ESMTP id 15D81B80F + for ; + Thu, 31 Aug 2006 15:40:40 -0400 (EDT) +Mime-Version: 1.0 (Apple Message framework v752.2) +In-Reply-To: <22781.1157051283@sss.pgh.pa.us> +References: <44F55A7F.40305@sorbs.net> + + <20060830162657.GD81373@pervasive.com> + + <22781.1157051283@sss.pgh.pa.us> +Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-8-504896495; + protocol="application/pkcs7-signature" +Message-Id: <70E4013D-8F10-4FD6-B09A-64FF95B7F155@khera.org> +From: Vivek Khera +Subject: Re: performance problems. +Date: Thu, 31 Aug 2006 15:40:39 -0400 +To: "Pgsql-Performance ((((E-mail))))" +X-Mailer: Apple Mail (2.752.2) +X-Virus-Scanned: Maia Mailguard 1.0.1 +X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL +X-Spam-Level: +X-Archive-Number: 200608/501 +X-Sequence-Number: 20686 + + +--Apple-Mail-8-504896495 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + delsp=yes; + format=flowed + + +On Aug 31, 2006, at 3:08 PM, Tom Lane wrote: + +> Vivek Khera writes: +>> Curious... See Message-ID: <20031011092308.GA39942@perrin.nxad.com> +>> from the October 2003 archives. (I'd provide a full link to it, but +>> the http://archives.postgresql.org/pgsql-performance/ archives are +>> botched -- +> +> Still? I found it easily enough with a search for 'hibufspace': +> http://archives.postgresql.org/pgsql-performance/2003-10/msg00383.php +> +> regards, tom lane + +go to "view by thread" or "view by date" for October 2003. Or August +2003. Most messages are missing. +--Apple-Mail-8-504896495 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGlDCCAz8w +ggKooAMCAQICAQ0wDQYJKoZIhvcNAQEFBQAwgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcx +KDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0 +ZSBQZXJzb25hbCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxA +dGhhd3RlLmNvbTAeFw0wMzA3MTcwMDAwMDBaFw0xMzA3MTYyMzU5NTlaMGIxCzAJBgNVBAYTAlpB +MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg +UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA +xKY8VXNV+065yplaHmjAdQRwnd/p/6Me7L3N9VvyGna9fww6YfK/Uc4B1OVQCjDXAmNaLIkVcI7d +yfArhVqqP3FWy688Cwfn8R+RNiQqE88r1fOCdz0Dviv+uxg+B79AgAJk16emu59l0cUqVIUPSAR/ +p7bRPGEEQB5kGXJgt/sCAwEAAaOBlDCBkTASBgNVHRMBAf8ECDAGAQH/AgEAMEMGA1UdHwQ8MDow +OKA2oDSGMmh0dHA6Ly9jcmwudGhhd3RlLmNvbS9UaGF3dGVQZXJzb25hbEZyZWVtYWlsQ0EuY3Js +MAsGA1UdDwQEAwIBBjApBgNVHREEIjAgpB4wHDEaMBgGA1UEAxMRUHJpdmF0ZUxhYmVsMi0xMzgw +DQYJKoZIhvcNAQEFBQADgYEASIzRUIPqCy7MDaNmrGcPf6+svsIXoUOWlJ1/TCG4+DYfqi2fNi/A +9BxQIJNwPP2t4WFiw9k6GX6EsZkbAMUaC4J0niVQlGLH2ydxVyWN3amcOY6MIE9lX5Xa9/eH1sYI +Tq726jTlEBpbNU1341YheILcIRk13iSx0x1G/11fZU8wggNNMIICtqADAgECAhA6sDoA4m3lcimf +yUtGSQgmMA0GCSqGSIb3DQEBBAUAMGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29u +c3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNz +dWluZyBDQTAeFw0wNjA1MDIxNDEyNDdaFw0wNzA1MDIxNDEyNDdaMIGKMR8wHQYDVQQDExZUaGF3 +dGUgRnJlZW1haWwgTWVtYmVyMR4wHAYJKoZIhvcNAQkBFg92aXZla0BraGVyYS5vcmcxIDAeBgkq +hkiG9w0BCQEWEWtoZXJhQGtjaWxpbmsuY29tMSUwIwYJKoZIhvcNAQkBFhZ2aXZla0BtYWlsZXJt +YWlsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq+zHKYq9vZ4Dq1itNqT/ +OeJvWDvQ5JdQlRzwsJlvtJBknXsnOaJNabmjnu2s6XFMcP2srBZQ/WPvhsClajLQOcxnarrfB66N +DpMzXTxfYzX6m9TA/fEn64sNn+YnBZL6Dvid9kiAgP9LmqcTOIFdWUya3ZmQS5YTuLB+tkFSL8/h ++inDPN6dcsna8TcM1SAk+3upxOR7kyFM9T3vy25w62Nh1zK7Stp0vUZLU6GzzC1VvHGZHKGticD6 +o3uHaMr2LCFjptoIcfZL75LO/UaR9o7smgboW4yJyW5g9ZasyYQUXyvkitfyZuVWATb8ZSHOkjWJ +872Pyf5+HOevVUI0aQIDAQABo1cwVTBFBgNVHREEPjA8gQ92aXZla0BraGVyYS5vcmeBEWtoZXJh +QGtjaWxpbmsuY29tgRZ2aXZla0BtYWlsZXJtYWlsZXIuY29tMAwGA1UdEwEB/wQCMAAwDQYJKoZI +hvcNAQEEBQADgYEAYpaFKDj47pTQIUQi28MgtjKophopv4QJjvspXmy0qxd8t/M/zc7HuBy3i/9a +PrXDgKyNBzzlFTasTazAY53ntVpqw9k1NOeHmH6o3j/DBVa49bC6bbWfp9UGOwYChlDR0tngQZyC +MDMZEdYv4zpGfBTku5m1jb8Yz/qYqV4FWB4xggMQMIIDDAIBATB2MGIxCzAJBgNVBAYTAlpBMSUw +IwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVy +c29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQOrA6AOJt5XIpn8lLRkkIJjAJBgUrDgMCGgUAoIIB +bzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MzExOTQwMzla +MCMGCSqGSIb3DQEJBDEWBBT23fw15kC1kgoLx4MwIqMeYai4BjCBhQYJKwYBBAGCNxAEMXgwdjBi +MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoG +A1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJ +CCYwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENv +bnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIElz +c3VpbmcgQ0ECEDqwOgDibeVyKZ/JS0ZJCCYwDQYJKoZIhvcNAQEBBQAEggEAjsAxLVFNv054w6H+ +Jrcyi5Hj7iC2CbscfhkamdlQeXKgIiBE4FqpAixIj7rEqwMWMm0ABhAo3TKZZhU2BGRZ7GXVjsf6 +ox/QSnkLqu+DfdoBAreDdnwSbrHDMENZM8NxZe9y1CjZhIZdeEzLJOOfvTcz7f9/Ammn5ZY6L/Uf +Ki/FADn26R5ftMR611H52BJhHMWsnk6vPx0PluUiwfCPTE2RSTLRPNSiD6Khi3Zi4wZ2pwDBBcFJ +ayBS6dYAGCRAo0rk6TSZlYlmInT8OswFXWauQ4KA630EXRYsCDqWZR8NOVElrL7zNsWqHMvBzP/q +kH/b3Z1OnqwLtYGDVg0SAQAAAAAAAA== + +--Apple-Mail-8-504896495-- +