Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EE7D36504E0 for ; Thu, 31 Jul 2008 17:20:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55364-02 for ; Thu, 31 Jul 2008 17:19:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id D205D6504C0 for ; Thu, 31 Jul 2008 17:19:56 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id m6VKJvR02505 for pgsql-www@postgresql.org; Thu, 31 Jul 2008 16:19:57 -0400 (EDT) From: Bruce Momjian Message-Id: <200807312019.m6VKJvR02505@momjian.us> Subject: Email search failure To: PostgreSQL www Date: Thu, 31 Jul 2008 16:19:57 -0400 (EDT) X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/156 X-Sequence-Number: 15586 Why is the email below now appearing in a search? http://search.postgresql.org/search?q=As+you+yourself+said%2C+this+patch+mostly+gets+the+machinery+to+count&m=1&l=&d=365&s=d --------------------------------------------------------------------------- ----- Forwarded message from Pavan Deolasee ----- On Tue, Jul 1, 2008 at 4:13 AM, Simon Riggs wrote: > > > The first "half" is actually quite large, but that makes it even more > sensible to commit this part now. > > The enclosed patch introduces the machinery by which we might later > optimise hint bit setting. It differentiates between hint bit setting > and block dirtying, when the distinction can safely be made. It acts > safely during VACUUM and correctly during checkpoint. In all other > respects it emulates current behaviour. > As you yourself said, this patch mostly gets the machinery to count hint bits in place and leaves the actual optimization for future. But I think we should try at least one or two possible optimizations and get some numbers before we jump and make substantial changes to the code. Also that would help us in testing the patch for correctness and performance. For example, the following hunk seems buggy to me: Index: src/backend/storage/buffer/bufmgr.c =================================================================== RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/backend/storage/buffer/bufmgr.c,v retrieving revision 1.232 diff -c -r1.232 bufmgr.c *** src/backend/storage/buffer/bufmgr.c 12 Jun 2008 09:12:31 -0000 1.232 --- src/backend/storage/buffer/bufmgr.c 30 Jun 2008 22:17:20 -0000 *************** *** 1460,1473 **** if (bufHdr->refcount == 0 && bufHdr->usage_count == 0) result |= BUF_REUSABLE; ! else if (skip_recently_used) { /* Caller told us not to write recently-used buffers */ UnlockBufHdr(bufHdr); return result; } ! if (!(bufHdr->flags & BM_VALID) || !(bufHdr->flags & BM_DIRTY)) { /* It's clean, so nothing to do */ UnlockBufHdr(bufHdr); --- 1462,1477 ---- if (bufHdr->refcount == 0 && bufHdr->usage_count == 0) result |= BUF_REUSABLE; ! else if (LRU_scan) { /* Caller told us not to write recently-used buffers */ UnlockBufHdr(bufHdr); return result; } ! if (!(bufHdr->flags & BM_VALID) || ! !(bufHdr->flags & BM_DIRTY || ! (LRU_scan && bufHdr->hint_count > 0))) { /* It's clean, so nothing to do */ UnlockBufHdr(bufHdr); In the "if" condition above, we would throw away a buffer if the hint_count is greater than zero, even if the buffer is dirty. This doesn't seem correct to me, unless I am missing something obvious. > The actual tuning patch can be discussed later, probably at length. > Later patches will be fairly small in comparison and so various people > can fairly easily come up with their own favoured modifications for > testing. > > I would suggest, let's have at least one tuning patch along with some tests and numbers, before we go ahead and commit anything. Thanks, Pavan -- Pavan Deolasee EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches ----- End of forwarded message from Pavan Deolasee ----- -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. +