X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D68419FA6B3 for ; Mon, 26 Jun 2006 16:34: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 83074-07 for ; Mon, 26 Jun 2006 16:33:48 -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 A2E9E9FA7BA for ; Mon, 26 Jun 2006 16:33:47 -0300 (ADT) Received: from [84.12.170.54] (helo=[192.168.0.2]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1Fuwq61eQt-0004BJ; Mon, 26 Jun 2006 21:33:43 +0200 Subject: Re: Some performance numbers, with thoughts From: Simon Riggs To: Brian Hurt Cc: pgsql-performance@postgresql.org In-Reply-To: <44973CC6.20309@janestcapital.com> References: <44973CC6.20309@janestcapital.com> Content-Type: text/plain Date: Mon, 26 Jun 2006 20:33:34 +0100 Message-Id: <1151350415.2479.66.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 (2.6.1-1.fc5.2) Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:726643fe08f41a451f0fe7fa43bce239 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/475 X-Sequence-Number: 19832 On Mon, 2006-06-19 at 20:09 -0400, Brian Hurt wrote: > 5) The performance of Postgres, at least on inserts, depends critically > on how you program it. One the same hardware, performance for me varied > over a factor of over 300-fold, 2.5 orders of magnitude. Programs which > are unaware of transactions and are designed to be highly portable are > likely to hit the abysmal side of performance, where the transaction > overhead kills performance. I'm quite interested in this comment. Transactions have always been part of the SQL standard, so being unaware of them when using SQL is strange to me. Can you talk more about what your expectations of what performance "should have been" - I don't want to flame you, just to understand that viewpoint. What are you implicitly comparing against? With which options enabled? How are you submitting these SQL statements? Through what API? > I'm not sure there is a fix for this (let > alone an easy fix)- simply dropping transactions is obviously not it. I'd like to see what other "fixes" we might think of. Perhaps we might consider a session-level mode that groups together atomic INSERTs into the same table into a single larger transaction. That might be something we can do at the client level, for example. > Programs that are transaction aware and willing to use > PostgreSQL-specific features can get surprisingly excellent > performance. Simply being transaction-aware and doing multiple inserts > per transaction greatly increases performance, giving an easy order of > magnitude increase (wrapping 10 inserts in a transaction gives a 10x > performance boost). This is exactly the same as most other transactional-RDBMS. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com