Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmTFT-00020O-0O for pgsql-general@arkaria.postgresql.org; Mon, 06 Aug 2018 00:19:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fmTFR-0001yc-6C for pgsql-general@arkaria.postgresql.org; Mon, 06 Aug 2018 00:19:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmTEe-0006e2-2k for pgsql-general@lists.postgresql.org; Mon, 06 Aug 2018 00:18:56 +0000 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fmTEV-0001ZP-IP for pgsql-general@lists.postgresql.org; Mon, 06 Aug 2018 00:18:54 +0000 Received: by mail-qk0-x241.google.com with SMTP id b66-v6so7791259qkj.1 for ; Sun, 05 Aug 2018 17:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=jsNcsgmxY6uYWmiaREjEjjNXGPBLjs+BKvHu1UyqlH0=; b=1GyQglUPRNnx3yLZMtKJ3Q5zk8feSyXxAh4rdKYoNLvzCfSBwNHe8L4GKTPjz9c+gi B2q7yJXzjApa+D4wYeDgSCibWpjVrXqiEvpwv6bhq1epSSqtr8RhQJu6AQoWp2++37l/ oPWIYBHG65Hh0F+jHfAW+qszoscXVCY52Q5nQmAliOGFQZZGLc/oLptAheJ5msuqZ8wp Aooxse8rp2bW7m29gukWjcCShBfBNNP9x0Rfgu+D11qMkPm4D/dqtZfF1XaX77YlndFQ /wZVyGwq1EHmi1Yv6ANEIplwzTE2hnnNvccmE2HOmhqLOSnQB3yxLRKXJa5wCQ0CRs2F Yf6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=jsNcsgmxY6uYWmiaREjEjjNXGPBLjs+BKvHu1UyqlH0=; b=pndnd+5U+qPeQLiN3JfWTYSI+TtLHaMMfdWJG4g6aswJu9ZqKk4mPU3zOZ+mFWaoFg KCVXvODd6Q/KghSR6ObA7xJ1o5aUbtxAk22sAm19se0XrctVIZlTcz4V5WdlwZiSQ1JN vMZEDhm2HEe7HTlP3TgcBlerIYayLm898cohs/wme29kdN2ODD7bY43D8796KDWqyNbH tWdXwvxXtVWZZzmjxVI/bvL27XNRy7uQmmmE82kLxshj28ywQj3eEuYwI7QsiZCVTuk4 Bw3CdlUlfij51JB0DpXSiZJe4ZO6u6D7cRHIdwlgvWLzurZGonCz3xxAFTLrsFTIXKi+ +Wcw== X-Gm-Message-State: AOUpUlFIAeeEPwN34eQr6QKp2He4JQgCptifj7Xymp1FhVWrxjZs/r// rN2u0vzZvgI0ibfoHY815quw5A== X-Google-Smtp-Source: AAOMgpcOUCd5nImY1Kds1gQ11hABfguE4kd2msJslNruatGkN5vhRHqW9WVnuLI5YClj8PvNM/5W3A== X-Received: by 2002:a37:288d:: with SMTP id o13-v6mr11592256qko.205.1533514725413; Sun, 05 Aug 2018 17:18:45 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([191.126.99.210]) by smtp.gmail.com with ESMTPSA id e206-v6sm5903844qkb.4.2018.08.05.17.18.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Aug 2018 17:18:42 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id C05A49B6; Sun, 5 Aug 2018 10:43:29 -0400 (-04) Date: Sun, 5 Aug 2018 10:43:29 -0400 From: Alvaro Herrera To: Ron Cc: pgsql-general@lists.postgresql.org Subject: Re: ALTER TABLE .. SET STATISTICS Message-ID: <20180805144329.kjctch4yb42j37i4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <45407d90-85dc-f5ba-58a5-d07fe99e852a@gmail.com> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Aug-05, Ron wrote: > For columns of type bytea which store image data (PDFs, JPGs, etc) would it > speed up the ANALYZE process to SET STATISTICS = 0? Yes. I'd suggest also looking at ALTER TABLE ... SET STORAGE to avoid having Postgres try to compress those columns, which is useless waste of CPU cycles, since those formats already compress. > That way, default_statistics_target could be cranked higher -- giving better > statistics for needed columns -- without polluting pg_statistics with > unneeded data? Right. With the default being 100 I don't think there's a real need to crank it higher server-wide, but it may be useful to crank it higher for specific columns. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services