Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YFBtw-00070b-R9 for pgsql-performance@arkaria.postgresql.org; Sun, 25 Jan 2015 01:22:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YFBtu-0001kV-Lv for pgsql-performance@arkaria.postgresql.org; Sun, 25 Jan 2015 01:22:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YFBts-0001kL-IW for pgsql-performance@postgresql.org; Sun, 25 Jan 2015 01:22:04 +0000 Received: from mail-we0-f181.google.com ([74.125.82.181]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YFBtj-0003T8-7V for pgsql-performance@postgresql.org; Sun, 25 Jan 2015 01:22:02 +0000 Received: by mail-we0-f181.google.com with SMTP id k48so3575160wev.12 for ; Sat, 24 Jan 2015 17:21:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=v49QBtm6VEKsy/uYQuf1D+O64o8gxaLB73SE8NNFVEM=; b=hhxoC7SRyus0fYYBAns4qoyWvY0QlnL2tG6iTP+DG+a5bfVNWX0XihPD7Oti9brbky 57XxOi3lLgtOZQRECD59hWcbrjMmcdCxMDIYZOn72lR6Siu+sf4ap3eeUNrxCN8TfiaH ee0BXRLHfiOEc3WI7TWN1QsY3h/QRrIINE1swxl5ewlGNY/BcuZ5kBpIsZm4rGuJrsWt QMWiB/e4ML3yg1THbW+DFc/+MrTB5Tour3lSYrk7tv246XSNAVy6ENTYq/znc1Uk6qsw 5/2fD1nYibfsJHt9UyMs93gBoFiD9jIrhsZp0KdOqv3YQantsH4xJP83Q7gIYs9ATmAz 1UOw== X-Gm-Message-State: ALoCoQl+Bfma5BeWKkNg8crOqZ3bF45a8rshQpwVEHfPw6OLUIz+a5uxF+EXMSlswpVjexk0eq/f4ixYcNJQ7yhPeMjf0O5muJ8/PTzQV1LJd+7yx6dkhXKQYpdgM2dEl1xUwHfaox89Um1PLwhpcrjpFS0sCiFmpMHZC46SX68SIoIU0N4DmPEraEdnR4HJ1FbP91j25Z/F X-Received: by 10.181.28.168 with SMTP id jp8mr18598881wid.40.1422148913494; Sat, 24 Jan 2015 17:21:53 -0800 (PST) Received: from [192.168.1.163] (ip-78-45-139-138.net.upcbroadband.cz. [78.45.139.138]) by mx.google.com with ESMTPSA id gf9sm8248214wjc.0.2015.01.24.17.21.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jan 2015 17:21:52 -0800 (PST) Message-ID: <54C4452E.9050505@2ndquadrant.com> Date: Sun, 25 Jan 2015 02:21:50 +0100 From: Tomas Vondra Organization: 2ndQuadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: How to tell ANALYZE to collect statistics from the whole table? References: <1422142399144-5835339.post@n5.nabble.com> <54C43D93.9030608@2ndquadrant.com> <1422147871674-5835344.post@n5.nabble.com> In-Reply-To: <1422147871674-5835344.post@n5.nabble.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 25.1.2015 02:04, AlexK987 wrote: > Tomas, > > Thank you for a very useful reply. Right now I do not have a case of > poor performance caused by strong data skew which is not properly > reflected in statistics. I was being defensive, trying to prevent > every possible thing that might go wrong. OK. My recommendation is not to mess with default_statistics unless you actually have to (e.g. increasing the value on all tables, withouth a query where the current value causes trouble). It increases time to plan the queries, collect statistics (ANALYZE / autovacuum) etc. regards -- Tomas Vondra http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance