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 AA33332A191 for ; Tue, 28 Sep 2004 14:59:30 +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 42776-02 for ; Tue, 28 Sep 2004 13:59:17 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 42A5032A082 for ; Tue, 28 Sep 2004 14:59:20 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i8SDw1fl014084; Tue, 28 Sep 2004 09:58:02 -0400 (EDT) To: "Aaron Werman" Cc: "Iain" , "Jim C. Nasby" , pgsql-performance@postgresql.org Subject: Re: Caching of Queries In-reply-to: References: <20040923152925.18234.qmail@web41114.mail.yahoo.com> <20040927191836.GS1297@decibel.org> <00b201c4a4ff$bd73b8b0$7201a8c0@mst1x5r347kymb> <9617.1096341460@sss.pgh.pa.us> Comments: In-reply-to "Aaron Werman" message dated "Tue, 28 Sep 2004 09:04:34 -0400" Date: Tue, 28 Sep 2004 09:58:01 -0400 Message-ID: <14083.1096379881@sss.pgh.pa.us> From: Tom Lane 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/308 X-Sequence-Number: 8436 "Aaron Werman" writes: > I imagine a design where a shared plan cache would consist of the plans, > indexed by a statement hash and again by dependant objects. A statement to > be planned would be hashed and matched to the cache. DDL would need to > synchronously destroy all dependant plans. If each plan maintains a validity ^^^^^^^^^^^^^ > flag, changing the cache wouldn't have to block so I don't see where there ^^^^^^^^^^^^^^^^^^^^^^ > would be contention. You have contention to access a shared data structure *at all* -- for instance readers must lock out writers. Or didn't you notice the self- contradictions in what you just said? Our current scalability problems dictate reducing such contention, not adding whole new sources of it. regards, tom lane