Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B3AE11337B87 for ; Mon, 8 Nov 2010 11:57:33 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 23847-05 for ; Mon, 8 Nov 2010 15:57:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from acidenitrix.villemain.org (acidenitrix.villemain.org [91.121.90.165]) by mail.postgresql.org (Postfix) with ESMTP id 984571337999 for ; Mon, 8 Nov 2010 11:57:21 -0400 (AST) Received: from 89-158-241-48.rev.dartybox.com ([89.158.241.48] helo=DimIMac.local) by acidenitrix.villemain.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PFU5x-0007c5-FR; Mon, 08 Nov 2010 16:57:21 +0100 Received: by DimIMac.local (Postfix, from userid 501) id 408CA1177E4E; Mon, 8 Nov 2010 16:57:15 +0100 (CET) From: Dimitri Fontaine To: "Lello\, Nick" Cc: pgsql-performance@postgresql.org Subject: Re: Running PostgreSQL as fast as possible no matter the consequences Organization: 2ndQuadrant References: User-Mail-Address: dimitri@2ndQuadrant.fr Date: Mon, 08 Nov 2010 16:57:14 +0100 In-Reply-To: (Nick Lello's message of "Fri, 5 Nov 2010 12:26:40 +0000") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/111 X-Sequence-Number: 41135 "Lello, Nick" writes: > A bigger gain can probably be had if you have a tightly controlled > suite of queries that will be run against the database and you can > spend the time to tune each to ensure it performs no sequential scans > (ie: Every query uses index lookups). Given a fixed pool of queries, you can prepare them in advance so that you don't usually pay the parsing and planning costs. I've found that the planning is easily more expensive than the executing when all data fits in RAM. Enter pgbouncer and preprepare=C2=A0: http://wiki.postgresql.org/wiki/PgBouncer http://preprepare.projects.postgresql.org/README.html Regards, --=20 Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support