Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7F4781337B93 for ; Wed, 13 Apr 2011 20:10:18 -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 74066-03 for ; Wed, 13 Apr 2011 23:10:07 +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 BC7791337B8B for ; Wed, 13 Apr 2011 20:10:05 -0300 (ADT) Received: by iyb14 with SMTP id 14so957465iyb.19 for ; Wed, 13 Apr 2011 16:10:05 -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=upVzq4ltzLJWa3UvMZZ8CembdQ5neP7kV9Y/w0VAHtE=; b=fJUSMvdOMV3vcxPaHeqZ9NtwRxhOLXfZWk5iE4MniB0vkSNs/5aizhxQhjv2Q1dQ/h 5ZK/Bh92tCVOCqf3bWqBZhKi/Y8nqZo7xHuUkM5/xtK7xzlkHLzWxo60z4teGOVUkCy1 8Qs6Hovfksy3WEgA750mgl2o4xo9jLc1JSw3Q= 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=XLiI6pCdQaL3MP0LZU4aUTtyxgyP9hT/AoPAT3shdQk+lu5d2qzyv9fhdqjON3p9eQ XnCuu2Z+owkHs1GqTlY54S/vys1d6md22aIIUSFdKNZHkzU6+kkjZzo4gZusXN3K2OS9 Yvf6MHogmbrED1ZED+Au1eNUWc5DysoTb450I= MIME-Version: 1.0 Received: by 10.42.146.196 with SMTP id k4mr101622icv.105.1302736205781; Wed, 13 Apr 2011 16:10:05 -0700 (PDT) Received: by 10.42.206.201 with HTTP; Wed, 13 Apr 2011 16:10:05 -0700 (PDT) In-Reply-To: <4DA6216E.9020907@fuzzy.cz> 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> Date: Thu, 14 Apr 2011 01:10:05 +0200 Message-ID: Subject: Re: Performance From: Claudio Freire To: Tomas Vondra Cc: 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.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201104/203 X-Sequence-Number: 43265 On Thu, Apr 14, 2011 at 12:19 AM, Tomas Vondra wrote: > > Another issue is that when measuring multiple values (processing of > different requests), the decisions may be contradictory so it really > can't be fully automatic. > I don't think it's soooo dependant on workload. It's dependant on access patterns (and working set sizes), and that all can be quantified, as opposed to "workload". I've been meaning to try this for a while yet, and it needs not be as expensive as one would imagine. It just needs a clever implementation that isn't too intrusive and that is customizable enough not to alienate DBAs. I'm not doing database stuff ATM (though I've been doing it for several years), and I don't expect to return to database tasks for a few months. But whenever I get back to it, sure, I'd be willing to invest time on it. What an automated system can do and a DBA cannot, and it's why this idea occurred to me in the first place, is tailor the metrics for variable contexts and situations. Like, I had a DB that was working perfectly fine most of the time, but some days it got "overworked" and sticking with fixed cost variables made no sense - in those situations, random page cost was insanely high because of the workload, but sequential scans would have ran much faster because of OS read-ahead and because of synchroscans. I'm talking of a decision support system that did lots of heavy duty queries, where sequential scans are an alternative. I reckon most OLTP systems are different. So, to make things short, adaptability to varying conditions is what I'd imagine this technique would provide, and a DBA cannot no matter how skilled. That and the advent of SSDs and really really different characteristics of different tablespaces only strengthen my intuition that automation might be better than parameterization.