Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A489E1337B80 for ; Tue, 26 Apr 2011 04:49:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 96346-09 for ; Tue, 26 Apr 2011 07:49:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) by mail.postgresql.org (Postfix) with ESMTP id B56BD1337B68 for ; Tue, 26 Apr 2011 04:49:39 -0300 (ADT) Received: by iyb14 with SMTP id 14so295165iyb.19 for ; Tue, 26 Apr 2011 00:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=nQe7ZEO3ff+zDKCmmYX9kZxVbdg9zi9I7x/39FhLly4=; b=EEma2OOts3u7ig4zRzOs6nIg9UZuksUrXCF9r9V3R4v1uuds3LWdlMcQfuJKaGa912 2QlZosyPsRzOnH8Fg6C3QumSCLQl4QHWVrtU+2Y8RhYrXgIoCA/hvDFygafmOHmEUZW1 Xa2JsbGC5av+5sJBBL0CcW/6cGVfxp4AO3rWM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=aC/AaPHNtxBrCZpTn+6GjIr9Z5NkgZwuO8j6THvsRGHOfjVhVRaYpyhI6OLdWyJNuM 3Nmjcf+z81TnwTrf71ppOSPyVnlV842w8Y9Y06HXoWv8cVUEwJs+1+RLIs9Q42pC+Nth wJ1eYpXsOc203m53UkuBOhHFEJ8MzUelM6ZnM= MIME-Version: 1.0 Received: by 10.42.66.147 with SMTP id p19mr501092ici.7.1303804179226; Tue, 26 Apr 2011 00:49:39 -0700 (PDT) Received: by 10.42.173.197 with HTTP; Tue, 26 Apr 2011 00:49:39 -0700 (PDT) In-Reply-To: References: <20110412171855.GA14292@tux> <4DA496FA.3070908@fuzzy.cz> <8F22D592-23C1-4A3C-94A5-48363332ADD3@darkstatic.com> <4DA4BFA2.5060601@fuzzy.cz> <4DA4D40A.4010200@fuzzy.cz> <4DA56DA8020000250003C783@gw.wicourts.gov> <4DA6216E.9020907@fuzzy.cz> <4DA63125.5070106@fuzzy.cz> Date: Tue, 26 Apr 2011 09:49:39 +0200 Message-ID: Subject: Re: Performance From: Claudio Freire To: Robert Haas Cc: Tomas Vondra , "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/351 X-Sequence-Number: 43413 On Tue, Apr 26, 2011 at 7:30 AM, Robert Haas wrote: > On Apr 14, 2011, at 2:49 AM, Claudio Freire wrote: >> This particular factor is not about an abstract and opaque "Workload" >> the server can't know about. It's about cache hit rate, and the server >> can indeed measure that. > > The server can and does measure hit rates for the PG buffer pool, but to my knowledge there is no clear-cut way for PG to know whether read() is satisfied from the OS cache or a drive cache or the platter. Isn't latency an indicator? If you plot latencies, you should see three markedly obvious clusters: OS cache (microseconds), Drive cache (slightly slower), platter (tail). I think I had seen a study of sorts somewhere[0]... Ok, that link is about sequential/random access, but I distinctively remember one about caches and CAV... [0] http://blogs.sun.com/brendan/entry/heat_map_analytics