X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D9E85329F0A for ; Mon, 27 Sep 2004 20:18:44 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03866-05 for ; Mon, 27 Sep 2004 19:18:38 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [66.143.173.58]) by svr1.postgresql.org (Postfix) with ESMTP id 984ED329F0C for ; Mon, 27 Sep 2004 20:18:38 +0100 (BST) Received: by flake.decibel.org (Postfix, from userid 1001) id E7B7F1C8F0; Mon, 27 Sep 2004 19:18:36 +0000 (GMT) Date: Mon, 27 Sep 2004 14:18:36 -0500 From: "Jim C. Nasby" To: Mr Pink Cc: Scott Kirkwood , pgsql-performance@postgresql.org Subject: Re: Caching of Queries Message-ID: <20040927191836.GS1297@decibel.org> References: <20040923152925.18234.qmail@web41114.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040923152925.18234.qmail@web41114.mail.yahoo.com> X-Operating-System: FreeBSD 4.10-RELEASE-p2 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/292 X-Sequence-Number: 8420 On Thu, Sep 23, 2004 at 08:29:25AM -0700, Mr Pink wrote: > Not knowing anything about the internals of pg, I don't know how this relates, but in theory, > query plan caching is not just about saving time re-planning queries, it's about scalability. > Optimizing queries requires shared locks on the database metadata, which, as I understand it > causes contention and serialization, which kills scalability. One of the guru's can correct me if I'm wrong here, but AFAIK metadata lookups use essentially the same access methods as normal queries. This means MVCC is used and no locking is required. Even if locks were required, they would be shared read locks which wouldn't block each other. -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"