Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 947596402A7 for ; Thu, 14 Jan 2010 17:24:28 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 77271-03-3 for ; Thu, 14 Jan 2010 21:24:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mail.postgresql.org (Postfix) with ESMTP id 05847637426 for ; Thu, 14 Jan 2010 17:23:10 -0400 (AST) Received: by fg-out-1718.google.com with SMTP id e21so443066fga.1 for ; Thu, 14 Jan 2010 13:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=LyJjzk8VEGzH/F2sCeLIQQz1fQG65hM8Q+Qquhld0Cc=; b=n6w/LRU47CV48TyX7E2gb6Jlk9h4UJy21F9RfgXrE/Qs95xW0xFb3j4c0R6zeEslyj 6+oeCj0ElinqFSwOxiDGQKwfCeBvhSm/4ZcuLzvEho4h7GQuKaGP3jQT7Q7ucyj/q1r3 pNzWCp4P6dkpsNIWl6/cgr3MTtcOticzwbYQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=P+RnyDqC9Arrchz10bXc0BzlreHLc6eTGG6adimFAe4fWAb55UZpGT6gNzJd/sZRfs Qkj2nVZngTnnQUpQoOVLcaSOQ1J8pDq7z9QSbumU23+sFcT6GIuGI1d4ONwOjb3ygwOF fqt3d2enADr3I5VzG2lbaNWJg0eKbTiUOhofM= Received: by 10.87.19.5 with SMTP id w5mr1789171fgi.52.1263504189130; Thu, 14 Jan 2010 13:23:09 -0800 (PST) Received: from googlemail.com (port-87-193-148-114.static.qsc.de [87.193.148.114]) by mx.google.com with ESMTPS id 13sm619118fxm.5.2010.01.14.13.23.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 13:23:08 -0800 (PST) Received: by googlemail.com (nbSMTP-1.00) for uid 1100 (using TLSv1/SSLv3 with cipher RC4-MD5 (128/128 bits)) fkater@googlemail.com; Thu, 14 Jan 2010 22:23:08 +0100 (CET) Date: Thu, 14 Jan 2010 22:23:07 +0100 From: "fkater@googlemail.com" To: Aidan Van Dyk Cc: pgsql-performance@postgresql.org Subject: Re: Inserting 8MB bytea: just 25% of disk perf used? Message-ID: <20100114212307.GD2384@comppasch2> References: <20100114142903.GB2973@comppasch2> <20100114150735.GT18076@oak.highrise.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100114150735.GT18076@oak.highrise.ca> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.003 tagged_above=-10 required=5 tests=BAYES_40=-0.185, FH_DATE_PAST_20XX=3.188 X-Spam-Level: *** X-Archive-Number: 201001/311 X-Sequence-Number: 37191 Aidan Van Dyk: > So, your SATA disk can do 43MB/s of sequential writes, but you're example > is doing: > 1) Sequential writes to WAL > 2) Random writes to your index > 3) Sequential writes to table heap > 4) Sequential writes to table' toast heap > 5) Any other OS-based FS overhead Ok, I see. Thanks a lot for the detailed answer! Especially writing to WAL may eat up 50% as I've learned now. So, 16MB/s x 2 would in fact be 32 MB/s, plus some extras... However, does that mean: If I have a raw sequential performance of 100%, I will get a binary write (like in my example) which is about 33% as a general rule of thumb? Just to mention: * The system has two hard disks, the first for WinXP, the second purely for the postgres data. * I was doing nothing else simultanously on the newly installed OS. * The consumed time (50s, see my test case) were needed to 99.9 % just by PGexecParam() function. * No network connect to the postgres server (everything local). * No complex sql command; just inserting 100x times using PGexecParam(), as a transaction. * The binary data was marked as such in PGexecParam (Format = 1). * What I meant by 43 MB/s "worst case": I downloaded some hd benchmarks which showed a performance of 43-70 MB/s. (Whereas repetitions of my postgres test did never vary, but *constantly* performed at 16MB/s). Hm. Nevertheless: If your explanation covers all what can be said about it then replacing the hard disk by a faster one should increase the performance here (I'll try to check that out). Thanks again! Felix